(4612,238,0.47,'smarty','1','Page created.',1134611451,2,'216.194.127.150','{include_php file=\"shared_handle:company_management/reports/surveys\"}\r\n<h1>{$page.title}</h1>\r\n<h2>{$smarty.session.company.companyName}</h2>\r\n\r\n<hr />\r\n\r\n<div style=\"width:400px;\">\r\n<h3 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'configure\', \'\', \'showHide\');\"><img id=\"configure_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Select Survey and Date Range</h3>\r\n\r\n<div id=\"configure\" style=\"display:block; margin-left:20px;\">\r\n	<form method=\"get\" action=\"index.php\" style=\"margin:0px;\">\r\n	<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\" />\r\n\r\n	<table>\r\n	<tr>\r\n		<td>Survey Name:</td>\r\n		<td colspan=\"3\"><select name=\"surveyId\">\r\n			{foreach from=$surveyList key=\"surveyId\" item=\"row\"}\r\n			<option value=\"{$surveyId}\"{if $surveyId eq $requestedSurveyId} selected=\"selected\"{/if}>{$row.surveyName}</option>\r\n			{/foreach}</select>\r\n	</tr>\r\n	<tr>\r\n		<td>Start Date:</td>\r\n		<td><input type=\"text\" name=\"begin\" size=\"10\" value=\"{$START_DATE|date_format2:\"m/d/Y\"}\" /></td>\r\n		<td>End Date:</td>\r\n		<td><input type=\"text\" name=\"end\" size=\"10\" value=\"{$END_DATE|date_format2:\"m/d/Y\"}\" /></td>\r\n	</tr>\r\n	<tr>\r\n		<td>&nbsp;</td>\r\n		<td colspan=\"3\"><input type=\"checkbox\" name=\"compareDates\" value=\"1\" onclick=\"toggleCompareDates(this);\"{if $comparingDates} checked=\"checked\"{/if}> Compare to another date range?</td>\r\n	</tr>\r\n	<tr>\r\n		<td><span id=\"compareDatesCell_1\" style=\"display:{if $comparingDates}block{else}none{/if};\">Start Date:</span></td>\r\n		<td><span id=\"compareDatesCell_2\" style=\"display:{if $comparingDates}block{else}none{/if};\"><input type=\"text\" name=\"begin2\" size=\"10\" value=\"{$START_DATE2|date_format2:\"m/d/Y\"}\" /></span></td>\r\n		<td><span id=\"compareDatesCell_3\" style=\"display:{if $comparingDates}block{else}none{/if};\">End Date:</span></td>\r\n		<td><span id=\"compareDatesCell_4\" style=\"display:{if $comparingDates}block{else}none{/if};\"><input type=\"text\" name=\"end2\" size=\"10\" value=\"{$END_DATE2|date_format2:\"m/d/Y\"}\" /></span></td>\r\n	</tr>\r\n	</table>\r\n\r\n	<div align=\"center\" style=\"clear:left;\"><input type=\"submit\" value=\"Load Report\" /></div>	\r\n	</form>\r\n\r\n	<script type=\"text/javascript\">{literal}\r\n		function toggleCompareDates(cb) {\r\n			var toState;\r\n			if (cb.checked) {\r\n				toState = \'block\';\r\n			} else {\r\n				toState = \'none\';\r\n			}\r\n			document.getElementById(\'compareDatesCell_1\').style.display = toState;\r\n			document.getElementById(\'compareDatesCell_2\').style.display = toState;\r\n			document.getElementById(\'compareDatesCell_3\').style.display = toState;\r\n			document.getElementById(\'compareDatesCell_4\').style.display = toState;\r\n		}\r\n	{/literal}</script>\r\n</div>\r\n</div>\r\n\r\n{if $report.surveyName}\r\n	<hr />\r\n	<h2>{$report.surveyName}</h2>\r\n	<i>Report for data between <b>{$START_DATE|date_format2:\"m/d/Y\"}</b> and <b>{$END_DATE|date_format2:\"m/d/Y\"}</b>.</i><br />\r\n	Taken <b>{$report.totalTimesTaken|default:0}</b> Times by <b>{$report.uniqueTimesTaken|default:0}</b> unique users<br /><br />\r\n{if $comparingDates}\r\n	<i>Comparing against data between <b>{$START_DATE2|date_format2:\"m/d/Y\"}</b> and <b>{$END_DATE2|date_format2:\"m/d/Y\"}</b>.</i><br />\r\n	Taken <b>{$report.totalTimesTaken2|default:0}</b> Times by <b>{$report.uniqueTimesTaken2|default:0}</b> unique users\r\n{/if}\r\n	<hr />\r\n	<br />\r\n	<table style=\"border:#CCC 1px solid;background:#EEE;\" cellpadding=\"5\"><tr><td style=\"padding-right:10px;\">\r\n	<ol>\r\n	{foreach name=\"qLoop\" from=$report.questions item=\"q\"}\r\n		<li>{$q.question}\r\n		<table width=\"100%\">\r\n		<tr>\r\n			<td colspan=\"4\"></td>\r\n			<td><img src=\"blank.gif\" width=\"110\" height=\"1\" alt=\"\" /></td>\r\n			{if $comparingDates}\r\n			<td colspan=\"2\"></td>\r\n			<td><img src=\"blank.gif\" width=\"110\" height=\"1\" alt=\"\" /></td>\r\n			{/if}\r\n		</tr>\r\n		{if $q.A}\r\n		<tr>\r\n			<td valign=\"top\"><b>A.</b></td>\r\n			<td width=\"100%\"><small>{$q.A}</small></td>\r\n			<td valign=\"bottom\"><b>{$q.sumA|default:0}</b></td>\r\n			<td valign=\"bottom\" align=\"right\">{$q.pctA|default:0}%</td>\r\n			<td valign=\"bottom\">{if $q.sumA > 0}<img src=\"img/graphBar.gif\" width=\"{$q.pctA|ceil}\" height=\"10\" alt=\"\" />{/if}</td>\r\n			{if $comparingDates}\r\n			<td valign=\"bottom\"><b>{$q.sumA2|default:0}</b></td>\r\n			<td valign=\"bottom\" align=\"right\">{$q.pctA2|default:0}%</td>\r\n			<td valign=\"bottom\">{if $q.sumA2 > 0}<img src=\"img/graphBar.gif\" width=\"{$q.pctA2|ceil}\" height=\"10\" alt=\"\" />{/if}</td>\r\n			{/if}\r\n		</tr>\r\n		{/if}\r\n		{if $q.B}\r\n		<tr>\r\n			<td valign=\"top\"><b>B.</b></td>\r\n			<td width=\"100%\"><small>{$q.B}</small></td>\r\n			<td valign=\"bottom\"><b>{$q.sumB|default:0}</b></td>\r\n			<td valign=\"bottom\" align=\"right\">{$q.pctB|default:0}%</td>\r\n			<td valign=\"bottom\">{if $q.sumB > 0}<img src=\"img/graphBar.gif\" width=\"{$q.pctB|ceil}\" height=\"10\" alt=\"\" />{/if}</td>\r\n			{if $comparingDates}\r\n			<td valign=\"bottom\"><b>{$q.sumB2|default:0}</b></td>\r\n			<td valign=\"bottom\" align=\"right\">{$q.pctB2|default:0}%</td>\r\n			<td valign=\"bottom\">{if $q.sumB2 > 0}<img src=\"img/graphBar.gif\" width=\"{$q.pctB2|ceil}\" height=\"10\" alt=\"\" />{/if}</td>\r\n			{/if}\r\n		</tr>\r\n		{/if}\r\n		{if $q.C}\r\n		<tr>\r\n			<td valign=\"top\"><b>C.</b></td>\r\n			<td width=\"100%\"><small>{$q.C}</small></td>\r\n			<td valign=\"bottom\"><b>{$q.sumC|default:0}</b></td>\r\n			<td valign=\"bottom\" align=\"right\">{$q.pctC|default:0}%</td>\r\n			<td valign=\"bottom\">{if $q.sumC > 0}<img src=\"img/graphBar.gif\" width=\"{$q.pctC|ceil}\" height=\"10\" alt=\"\" />{/if}</td>\r\n			{if $comparingDates}\r\n			<td valign=\"bottom\"><b>{$q.sumC2|default:0}</b></td>\r\n			<td valign=\"bottom\" align=\"right\">{$q.pctC2|default:0}%</td>\r\n			<td valign=\"bottom\">{if $q.sumC2 > 0}<img src=\"img/graphBar.gif\" width=\"{$q.pctC2|ceil}\" height=\"10\" alt=\"\" />{/if}</td>\r\n			{/if}\r\n		</tr>\r\n		{/if}\r\n		{if $q.D}\r\n		<tr>\r\n			<td valign=\"top\"><b>D.</b></td>\r\n			<td width=\"100%\"><small>{$q.D}</small></td>\r\n			<td valign=\"bottom\"><b>{$q.sumD|default:0}</b></td>\r\n			<td valign=\"bottom\" align=\"right\">{$q.pctD|default:0}%</td>\r\n			<td valign=\"bottom\">{if $q.sumD > 0}<img src=\"img/graphBar.gif\" width=\"{$q.pctD|ceil}\" height=\"10\" alt=\"\" />{/if}</td>\r\n			{if $comparingDates}\r\n			<td valign=\"bottom\"><b>{$q.sumD2|default:0}</b></td>\r\n			<td valign=\"bottom\" align=\"right\">{$q.pctD2|default:0}%</td>\r\n			<td valign=\"bottom\">{if $q.sumD2 > 0}<img src=\"img/graphBar.gif\" width=\"{$q.pctD2|ceil}\" height=\"10\" alt=\"\" />{/if}</td>\r\n			{/if}\r\n		</tr>\r\n		{/if}\r\n		{if $q.E}\r\n		<tr>\r\n			<td valign=\"top\"><b>E.</b></td>\r\n			<td width=\"100%\"><small>{$q.E}</small></td>\r\n			<td valign=\"bottom\"><b>{$q.sumE|default:0}</b></td>\r\n			<td valign=\"bottom\" align=\"right\">{$q.pctE|default:0}%</td>\r\n			<td valign=\"bottom\">{if $q.sumE > 0}<img src=\"img/graphBar.gif\" width=\"{$q.pctE|ceil}\" height=\"10\" alt=\"\" />{/if}</td>\r\n			{if $comparingDates}\r\n			<td valign=\"bottom\"><b>{$q.sumE2|default:0}</b></td>\r\n			<td valign=\"bottom\" align=\"right\">{$q.pctE2|default:0}%</td>\r\n			<td valign=\"bottom\">{if $q.sumE2 > 0}<img src=\"img/graphBar.gif\" width=\"{$q.pctE2|ceil}\" height=\"10\" alt=\"\" />{/if}</td>\r\n			{/if}\r\n		</tr>\r\n		{/if}\r\n		</table><br /><br /></li>\r\n	{/foreach}\r\n	</td></tr></table>\r\n{/if}'),(4613,45,0.30,'smarty','1','Hiding widgets.',1134613502,2,'216.194.127.150','{assign var=\"hideWidgets\" value=\"true\"}\r\n{assign var=\"wideFormat\" value=\"true\"}\r\n\r\n{php}$GLOBALS[\'SPADE\'][\'db\']->debugModeOn();{/php}\r\n\r\n{if $smarty.request.tm_style_table}\r\n	{session_write var=\"tm_style_table\" value=$smarty.request.tm_style_table}\r\n{/if}\r\n{if $smarty.request.tm_template}\r\n	{session_write var=\"tm_template\" value=$smarty.request.tm_template}\r\n{/if}\r\n\r\n<div align=\"right\">\r\n<form style=\"margin:0px;\" name=\"tmstyleform\" method=\"get\" action=\"index.php\">\r\n<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\nBorder Styles:\r\n<select name=\"tm_style_table\" onchange=\"if(this.value != \'\')this.form.submit();\">\r\n	<option value=\"\">-Change-</option>\r\n	<option value=\"gray\">Gray</option>\r\n	<option value=\"gray_bubble\">Gray Bubble</option>\r\n	<option value=\"blue-white\">Blue-White</option>\r\n	<option value=\"blue-blue\">Blue-Blue</option>\r\n	<option value=\"chrome\">Chrome</option>\r\n	<option value=\"purple-white\">Purple-White</option>\r\n	<option value=\"redlava\">redlava</option>\r\n</select>\r\n&nbsp;&nbsp;\r\nTemplate:\r\n<select name=\"tm_template\" onchange=\"if(this.value != \'\')this.form.submit();\">\r\n	<option value=\"\">-Change-</option>\r\n	<option value=\"default\">Default</option>\r\n	<option value=\"slate\">Slate</option>\r\n</select>\r\n</form>\r\n</div>\r\n\r\n{assign var=\"template\" value=$smarty.session.safe.tm_template|default:\"slate\"}\r\n\r\n\r\n{tablemanager\r\n	Assign=\"tm\"\r\n	Group=\"admin_tools\"\r\n	Profile=\"manage_users\"\r\n	DeleteLogFile=\"tm-delete.log\"\r\n	TemplatePath=\"TM/templates/\"\r\n	StyleTablePath=\"img/st/\"\r\n	StyleTable=$smarty.session.safe.tm_style_table|default:\"gray\"\r\n	AddTemplate=$template|cat:\"_edit.tpl\"\r\n	MainTemplate=$template|cat:\"_main.tpl\"\r\n	ListTemplate=$template|cat:\"_list.tpl\"\r\n	EditTemplate=$template|cat:\"_edit.tpl\"\r\n	Action=\"list\"\r\n	LoginRequired=\"false\"\r\n	HeadingColor=\"90A9C4\"\r\n	HighlightColor=\"F6F9B5\"\r\n	ResultsPerPage=\"20\"\r\n	Color1=\"F7F7F7\"\r\n	Color2=\"E7E7E7\"\r\n	DataStyle=\"hideWrap\"\r\n	MaxStringLength=\"50\"\r\n	DateFormat=\"M j, Y h:i a \"\r\n	}\r\n\r\n'),(4633,271,0.24,'smarty','0','Page created.',1134721912,2,'24.2.76.126','{include_php file=\"shared_handle:company_management/reports/incentives-summary\"}\r\n<h1>{$page.title}</h1>\r\n<h2>{$smarty.session.company.companyName}</h2>\r\n\r\n<hr />\r\n\r\n<div style=\"width:400px;\">\r\n<h3 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'configure\', \'\', \'showHide\');\"><img id=\"configure_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Configure</h3>\r\n\r\n<script type=\"text/javascript\">\r\n{literal}\r\nfunction changeOrder(ord) {\r\n	document.forms.configure.order.value = ord;\r\n	document.forms.configure.submit();\r\n}\r\n{/literal}\r\n</script>\r\n\r\n<div id=\"configure\" style=\"display:none; margin-left:20px;\">\r\n	<form name=\"configure\" method=\"get\" action=\"index.php\" style=\"margin:0px;\">\r\n	<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\" />\r\n	<input type=\"hidden\" name=\"order\" value=\"{$smarty.request.order}\" />\r\n\r\n	<div style=\"float:right;\"><small>&quot;Range Offset&quot; will allow each range to begin at an offset value.</small></div>\r\n\r\n	<table>\r\n	<tr>\r\n		<td>Start Date:</td>\r\n		<td><input type=\"text\" name=\"begin\" size=\"10\" value=\"{$START_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	<tr>\r\n		<td>End Date:</td>\r\n		<td><input type=\"text\" name=\"end\" size=\"10\" value=\"{$END_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	</table>\r\n\r\n	<div align=\"right\" style=\"clear:left;\"><input type=\"submit\" value=\"Submit\" /></div>\r\n	\r\n	</form>\r\n</div>\r\n</div>\r\n\r\n<hr />\r\n<i>Report for data between <b>{$START_DATE|date_format2:\"m/d/Y\"}</b> and <b>{$END_DATE|date_format2:\"m/d/Y\"}</b>.</i>\r\n<hr />\r\n\r\n<h3 class=\"withBG\">Campaigns</h3>\r\n{foreach from=$campaigns item=\"campaign\"}\r\n	<b>Campaign #{$campaign.id}</b>\r\n	<div style=\"margin-left:15px;\">\r\n		<i>eStat</i>: {$campaign.estatName}<br />\r\n		<i>Date Range</i>: {$campaign.dateStart|date_format2:\"m/d/Y\"} <small>({$campaign.dateStart|date_format2:\"h:i:s A\"})</small> to {$campaign.dateEnd|date_format2:\"m/d/Y\"} <small>({$campaign.dateEnd|date_format2:\"h:i:s A\"})</small><br />\r\n		<i>Scoring</i>: {$campaign.value} - {$campaign.type}<br />\r\n	</div>\r\n	<br />\r\n{foreachelse}\r\n	<div style=\"margin-left:15px;\">\r\n		No active campaigns in the current time period.\r\n	</div>\r\n	<br />\r\n{/foreach}\r\n\r\n<h3 class=\"withBG\">User Data</h3>\r\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\">\r\n<tr>\r\n	<td><b>No.</b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'username\');\">Username</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'lastName\');\">Last Name</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'firstName\');\">First Name</a></b></td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td><b><a href=\"javascript:changeOrder({$campaign.id});\">Campaign&nbsp;#{$campaign.id}</a></b></td>\r\n	{/foreach}\r\n	<td><b><a href=\"javascript:changeOrder(\'surveys\');\">Surveys</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'total\');\">Total</a></b></td>\r\n</tr>\r\n{foreach name=\"userDataLoop\" from=$userData item=\"userData\"}\r\n<tr>\r\n	<td>{$smarty.foreach.userDataLoop.iteration}.</td>\r\n	<td>{$userData.username}</td>\r\n	<td>{$userData.lastName|default:\"-none-\"}</td>\r\n	<td>{$userData.firstName|default:\"-none-\"}</td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td align=\"right\">{$userData[$campaign.id]|default:0}</td>\r\n	{/foreach}\r\n	<td align=\"right\">{$userData.surveys|default:0}</td>\r\n	<td align=\"right\"><b>{$userData.total|default:0}</b></td>\r\n</tr>\r\n{/foreach}\r\n</table>\r\n'),(4634,271,0.25,'smarty','0','Page created.',1134722210,2,'24.2.76.126','{include_php file=\"shared_handle:company_management/reports/incentives-summary\"}\r\n<h1>{$page.title}</h1>\r\n<h2>{$smarty.session.company.companyName}</h2>\r\n\r\n<hr />\r\n\r\n<div style=\"width:400px;\">\r\n<h3 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'configure\', \'\', \'showHide\');\"><img id=\"configure_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Configure</h3>\r\n\r\n<script type=\"text/javascript\">\r\n{literal}\r\nfunction changeOrder(ord) {\r\n	document.forms.configure.order.value = ord;\r\n	document.forms.configure.submit();\r\n}\r\n{/literal}\r\n</script>\r\n\r\n<div id=\"configure\" style=\"display:none; margin-left:20px;\">\r\n	<form name=\"configure\" method=\"get\" action=\"index.php\" style=\"margin:0px;\">\r\n	<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\" />\r\n	<input type=\"hidden\" name=\"order\" value=\"{$smarty.request.order}\" />\r\n\r\n	<div style=\"float:right;\"><small>&quot;Range Offset&quot; will allow each range to begin at an offset value.</small></div>\r\n\r\n	<table>\r\n	<tr>\r\n		<td>Start Date:</td>\r\n		<td><input type=\"text\" name=\"begin\" size=\"10\" value=\"{$START_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	<tr>\r\n		<td>End Date:</td>\r\n		<td><input type=\"text\" name=\"end\" size=\"10\" value=\"{$END_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	</table>\r\n\r\n	<div align=\"right\" style=\"clear:left;\"><input type=\"submit\" value=\"Submit\" /></div>\r\n	\r\n	</form>\r\n</div>\r\n</div>\r\n\r\n<hr />\r\n<i>Report for data between <b>{$START_DATE|date_format2:\"m/d/Y\"}</b> and <b>{$END_DATE|date_format2:\"m/d/Y\"}</b>.</i>\r\n<hr />\r\n\r\n<h3 class=\"withBG\">Campaigns</h3>\r\n{foreach from=$campaigns item=\"campaign\"}\r\n	<b>Campaign #{$campaign.id}</b>\r\n	<div style=\"margin-left:15px;\">\r\n		<i>eStat</i>: {$campaign.estatName}<br />\r\n		<i>Date Range</i>: {$campaign.dateStart|date_format2:\"m/d/Y\"} <small>({$campaign.dateStart|date_format2:\"h:i:s A\"})</small> to {$campaign.dateEnd|date_format2:\"m/d/Y\"} <small>({$campaign.dateEnd|date_format2:\"h:i:s A\"})</small><br />\r\n		<i>Scoring</i>: {$campaign.value} - {$campaign.type}<br />\r\n	</div>\r\n	<br />\r\n{foreachelse}\r\n	<div style=\"margin-left:15px;\">\r\n		No active campaigns in the current time period.\r\n	</div>\r\n	<br />\r\n{/foreach}\r\n\r\n<h3 class=\"withBG\">User Data</h3>\r\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" style=\"z-index:10000;\">\r\n<tr>\r\n	<td><b>No.</b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'username\');\">Username</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'lastName\');\">Last Name</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'firstName\');\">First Name</a></b></td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td><b><a href=\"javascript:changeOrder({$campaign.id});\">Campaign&nbsp;#{$campaign.id}</a></b></td>\r\n	{/foreach}\r\n	<td><b><a href=\"javascript:changeOrder(\'surveys\');\">Surveys</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'total\');\">Total</a></b></td>\r\n</tr>\r\n{foreach name=\"userDataLoop\" from=$userData item=\"userData\"}\r\n<tr>\r\n	<td>{$smarty.foreach.userDataLoop.iteration}.</td>\r\n	<td>{$userData.username}</td>\r\n	<td>{$userData.lastName|default:\"-none-\"}</td>\r\n	<td>{$userData.firstName|default:\"-none-\"}</td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td align=\"right\">{$userData[$campaign.id]|default:0}</td>\r\n	{/foreach}\r\n	<td align=\"right\">{$userData.surveys|default:0}</td>\r\n	<td align=\"right\"><b>{$userData.total|default:0}</b></td>\r\n</tr>\r\n{/foreach}\r\n</table>\r\n'),(4635,271,0.26,'smarty','0','Page created.',1134722628,2,'24.2.76.126','{include_php file=\"shared_handle:company_management/reports/incentives-summary\"}\r\n<h1>{$page.title}</h1>\r\n<h2>{$smarty.session.company.companyName}</h2>\r\n\r\n<hr />\r\n\r\n<div style=\"width:400px;\">\r\n<h3 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'configure\', \'\', \'showHide\');\"><img id=\"configure_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Configure</h3>\r\n\r\n<script type=\"text/javascript\">\r\n{literal}\r\nfunction changeOrder(ord) {\r\n	document.forms.configure.order.value = ord;\r\n	document.forms.configure.submit();\r\n}\r\n{/literal}\r\n</script>\r\n\r\n<div id=\"configure\" style=\"display:none; margin-left:20px;\">\r\n	<form name=\"configure\" method=\"get\" action=\"index.php\" style=\"margin:0px;\">\r\n	<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\" />\r\n	<input type=\"hidden\" name=\"order\" value=\"{$smarty.request.order}\" />\r\n\r\n	<div style=\"float:right;\"><small>&quot;Range Offset&quot; will allow each range to begin at an offset value.</small></div>\r\n\r\n	<table>\r\n	<tr>\r\n		<td>Start Date:</td>\r\n		<td><input type=\"text\" name=\"begin\" size=\"10\" value=\"{$START_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	<tr>\r\n		<td>End Date:</td>\r\n		<td><input type=\"text\" name=\"end\" size=\"10\" value=\"{$END_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	</table>\r\n\r\n	<div align=\"right\" style=\"clear:left;\"><input type=\"submit\" value=\"Submit\" /></div>\r\n	\r\n	</form>\r\n</div>\r\n</div>\r\n\r\n<hr />\r\n<i>Report for data between <b>{$START_DATE|date_format2:\"m/d/Y\"}</b> and <b>{$END_DATE|date_format2:\"m/d/Y\"}</b>.</i>\r\n<hr />\r\n\r\n<h3 class=\"withBG\">Campaigns</h3>\r\n{foreach from=$campaigns item=\"campaign\"}\r\n	<b>Campaign #{$campaign.id}</b>\r\n	<div style=\"margin-left:15px;\">\r\n		<i>eStat</i>: {$campaign.estatName}<br />\r\n		<i>Date Range</i>: {$campaign.dateStart|date_format2:\"m/d/Y\"} <small>({$campaign.dateStart|date_format2:\"h:i:s A\"})</small> to {$campaign.dateEnd|date_format2:\"m/d/Y\"} <small>({$campaign.dateEnd|date_format2:\"h:i:s A\"})</small><br />\r\n		<i>Scoring</i>: {$campaign.value} - {$campaign.type}<br />\r\n	</div>\r\n	<br />\r\n{foreachelse}\r\n	<div style=\"margin-left:15px;\">\r\n		No active campaigns in the current time period.\r\n	</div>\r\n	<br />\r\n{/foreach}\r\n\r\n<h3 class=\"withBG\">User Data</h3>\r\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" style=\"z-index:10000;\">\r\n<tr>\r\n	<td><b>No.</b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'username\');\">Username</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'lastName\');\">Last Name</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'firstName\');\">First Name</a></b></td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td><b><a href=\"javascript:changeOrder({$campaign.id});\">Campaign&nbsp;#{$campaign.id}</a></b></td>\r\n	{/foreach}\r\n	<td><b><a href=\"javascript:changeOrder(\'surveys\');\">Surveys</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'total\');\">Total</a></b></td>\r\n</tr>\r\n{foreach name=\"userDataLoop\" from=$userData item=\"userData\"}\r\n<tr>\r\n	<td>{$smarty.foreach.userDataLoop.iteration}.</td>\r\n	<td><a href=\"mailto:{$userData.email|default:\"unknown@unknown.com\"}\">{$userData.username}</a></td>\r\n	<td>{$userData.lastName|default:\"-none-\"}</td>\r\n	<td>{$userData.firstName|default:\"-none-\"}</td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td align=\"right\">{$userData[$campaign.id]|default:0}</td>\r\n	{/foreach}\r\n	<td align=\"right\">{$userData.surveys|default:0}</td>\r\n	<td align=\"right\"><b>{$userData.total|default:0}</b></td>\r\n</tr>\r\n{/foreach}\r\n</table>\r\n'),(4636,271,0.27,'smarty','0','Page created.',1134722665,2,'24.2.76.126','{include_php file=\"shared_handle:company_management/reports/incentives-summary\"}\r\n<h1>{$page.title}</h1>\r\n<h2>{$smarty.session.company.companyName}</h2>\r\n\r\n<hr />\r\n\r\n<div style=\"width:400px;\">\r\n<h3 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'configure\', \'\', \'showHide\');\"><img id=\"configure_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Configure</h3>\r\n\r\n<script type=\"text/javascript\">\r\n{literal}\r\nfunction changeOrder(ord) {\r\n	document.forms.configure.order.value = ord;\r\n	document.forms.configure.submit();\r\n}\r\n{/literal}\r\n</script>\r\n\r\n<div id=\"configure\" style=\"display:none; margin-left:20px;\">\r\n	<form name=\"configure\" method=\"get\" action=\"index.php\" style=\"margin:0px;\">\r\n	<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\" />\r\n	<input type=\"hidden\" name=\"order\" value=\"{$smarty.request.order}\" />\r\n\r\n	<div style=\"float:right;\"><small>&quot;Range Offset&quot; will allow each range to begin at an offset value.</small></div>\r\n\r\n	<table>\r\n	<tr>\r\n		<td>Start Date:</td>\r\n		<td><input type=\"text\" name=\"begin\" size=\"10\" value=\"{$START_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	<tr>\r\n		<td>End Date:</td>\r\n		<td><input type=\"text\" name=\"end\" size=\"10\" value=\"{$END_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	</table>\r\n\r\n	<div align=\"right\" style=\"clear:left;\"><input type=\"submit\" value=\"Submit\" /></div>\r\n	\r\n	</form>\r\n</div>\r\n</div>\r\n\r\n<hr />\r\n<i>Report for data between <b>{$START_DATE|date_format2:\"m/d/Y\"}</b> and <b>{$END_DATE|date_format2:\"m/d/Y\"}</b>.</i>\r\n<hr />\r\n\r\n<h3 class=\"withBG\">Campaigns</h3>\r\n{foreach from=$campaigns item=\"campaign\"}\r\n	<b>Campaign #{$campaign.id}</b>\r\n	<div style=\"margin-left:15px;\">\r\n		<i>eStat</i>: {$campaign.estatName}<br />\r\n		<i>Date Range</i>: {$campaign.dateStart|date_format2:\"m/d/Y\"} <small>({$campaign.dateStart|date_format2:\"h:i:s A\"})</small> to {$campaign.dateEnd|date_format2:\"m/d/Y\"} <small>({$campaign.dateEnd|date_format2:\"h:i:s A\"})</small><br />\r\n		<i>Scoring</i>: {$campaign.value} - {$campaign.type}<br />\r\n	</div>\r\n	<br />\r\n{foreachelse}\r\n	<div style=\"margin-left:15px;\">\r\n		No active campaigns in the current time period.\r\n	</div>\r\n	<br />\r\n{/foreach}\r\n\r\n<h3 class=\"withBG\">User Data</h3>\r\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" style=\"z-index:10000;\">\r\n<tr bgcolor=\"#CCC\">\r\n	<td><b>No.</b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'username\');\">Username</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'lastName\');\">Last Name</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'firstName\');\">First Name</a></b></td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td><b><a href=\"javascript:changeOrder({$campaign.id});\">Campaign&nbsp;#{$campaign.id}</a></b></td>\r\n	{/foreach}\r\n	<td><b><a href=\"javascript:changeOrder(\'surveys\');\">Surveys</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'total\');\">Total</a></b></td>\r\n</tr>\r\n{foreach name=\"userDataLoop\" from=$userData item=\"userData\"}\r\n<tr>\r\n	<td>{$smarty.foreach.userDataLoop.iteration}.</td>\r\n	<td><a href=\"mailto:{$userData.email|default:\"unknown@unknown.com\"}\">{$userData.username}</a></td>\r\n	<td>{$userData.lastName|default:\"-none-\"}</td>\r\n	<td>{$userData.firstName|default:\"-none-\"}</td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td align=\"right\">{$userData[$campaign.id]|default:0}</td>\r\n	{/foreach}\r\n	<td align=\"right\">{$userData.surveys|default:0}</td>\r\n	<td align=\"right\"><b>{$userData.total|default:0}</b></td>\r\n</tr>\r\n{/foreach}\r\n</table>\r\n'),(4637,271,0.28,'smarty','0','Page created.',1134722685,2,'24.2.76.126','{include_php file=\"shared_handle:company_management/reports/incentives-summary\"}\r\n<h1>{$page.title}</h1>\r\n<h2>{$smarty.session.company.companyName}</h2>\r\n\r\n<hr />\r\n\r\n<div style=\"width:400px;\">\r\n<h3 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'configure\', \'\', \'showHide\');\"><img id=\"configure_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Configure</h3>\r\n\r\n<script type=\"text/javascript\">\r\n{literal}\r\nfunction changeOrder(ord) {\r\n	document.forms.configure.order.value = ord;\r\n	document.forms.configure.submit();\r\n}\r\n{/literal}\r\n</script>\r\n\r\n<div id=\"configure\" style=\"display:none; margin-left:20px;\">\r\n	<form name=\"configure\" method=\"get\" action=\"index.php\" style=\"margin:0px;\">\r\n	<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\" />\r\n	<input type=\"hidden\" name=\"order\" value=\"{$smarty.request.order}\" />\r\n\r\n	<div style=\"float:right;\"><small>&quot;Range Offset&quot; will allow each range to begin at an offset value.</small></div>\r\n\r\n	<table>\r\n	<tr>\r\n		<td>Start Date:</td>\r\n		<td><input type=\"text\" name=\"begin\" size=\"10\" value=\"{$START_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	<tr>\r\n		<td>End Date:</td>\r\n		<td><input type=\"text\" name=\"end\" size=\"10\" value=\"{$END_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	</table>\r\n\r\n	<div align=\"right\" style=\"clear:left;\"><input type=\"submit\" value=\"Submit\" /></div>\r\n	\r\n	</form>\r\n</div>\r\n</div>\r\n\r\n<hr />\r\n<i>Report for data between <b>{$START_DATE|date_format2:\"m/d/Y\"}</b> and <b>{$END_DATE|date_format2:\"m/d/Y\"}</b>.</i>\r\n<hr />\r\n\r\n<h3 class=\"withBG\">Campaigns</h3>\r\n{foreach from=$campaigns item=\"campaign\"}\r\n	<b>Campaign #{$campaign.id}</b>\r\n	<div style=\"margin-left:15px;\">\r\n		<i>eStat</i>: {$campaign.estatName}<br />\r\n		<i>Date Range</i>: {$campaign.dateStart|date_format2:\"m/d/Y\"} <small>({$campaign.dateStart|date_format2:\"h:i:s A\"})</small> to {$campaign.dateEnd|date_format2:\"m/d/Y\"} <small>({$campaign.dateEnd|date_format2:\"h:i:s A\"})</small><br />\r\n		<i>Scoring</i>: {$campaign.value} - {$campaign.type}<br />\r\n	</div>\r\n	<br />\r\n{foreachelse}\r\n	<div style=\"margin-left:15px;\">\r\n		No active campaigns in the current time period.\r\n	</div>\r\n	<br />\r\n{/foreach}\r\n\r\n<h3 class=\"withBG\">User Data</h3>\r\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" style=\"z-index:10000;\">\r\n<tr bgcolor=\"#CCCCCC\">\r\n	<td><b>No.</b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'username\');\">Username</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'lastName\');\">Last Name</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'firstName\');\">First Name</a></b></td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td><b><a href=\"javascript:changeOrder({$campaign.id});\">Campaign&nbsp;#{$campaign.id}</a></b></td>\r\n	{/foreach}\r\n	<td><b><a href=\"javascript:changeOrder(\'surveys\');\">Surveys</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'total\');\">Total</a></b></td>\r\n</tr>\r\n{foreach name=\"userDataLoop\" from=$userData item=\"userData\"}\r\n<tr>\r\n	<td>{$smarty.foreach.userDataLoop.iteration}.</td>\r\n	<td><a href=\"mailto:{$userData.email|default:\"unknown@unknown.com\"}\">{$userData.username}</a></td>\r\n	<td>{$userData.lastName|default:\"-none-\"}</td>\r\n	<td>{$userData.firstName|default:\"-none-\"}</td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td align=\"right\">{$userData[$campaign.id]|default:0}</td>\r\n	{/foreach}\r\n	<td align=\"right\">{$userData.surveys|default:0}</td>\r\n	<td align=\"right\"><b>{$userData.total|default:0}</b></td>\r\n</tr>\r\n{/foreach}\r\n</table>\r\n'),(5009,303,0.10,'smarty','0','Page created.',1143571395,1124,'216.194.127.150',''),(5010,303,0.11,'smarty','0','Page created.',1143571704,1124,'216.194.127.150','<hl><b>Stretching</b></hl>\r\n\r\n<p>Many people overlook the benefits of stretching before physical activity. Stretching, in addition to warming up, can help optimize your workout as well as help prevent or reduce injuries. It doesn’t matter what kind of shape you are in, your body needs to be warmed up and stretched before participating in any physical activity. The aims of stretching are to gently lengthen muscles before and after any form of exercise, and to improve tissue elasticity / flexibility. </p>\r\n\r\n\r\n<p>There are many different muscle groups within the body that can be stretched. Some tips that one should remember when stretching are</p>\r\n\r\n<p>\r\n1.	Begin with gradual mobility exercises of all the joints, i.e. simply rotate the wrists, bend the arm and roll your shoulders. This will allow the body\'s natural lubrication to protect the surface of your bones at these joints.  Using the natural range of motion the joints have their own fluid to aid in protection.</p>\r\n<p>\r\n2.	Always warm up the body prior to stretching, as this increases blood flow around the body, which in turn makes the muscles more supple. </p>\r\n<p>\r\n3.	After exercise, slowly bring your heart rate down before you begin stretching in order to avoid blood pooling within your muscles, which can lead to cramping and dizzy spells. </p> \r\n<p>\r\n4.	If you’re wet and sweaty, you can put on a sweatshirt to keep your body warm as you cool down. This will also help keep you from getting a chill. You could also take a warm shower or bath to keep warm and relax the muscles. </p>\r\n<p>\r\n5.	Never bounce while you stretch, unless you are doing specific stretches for certain sports, i.e. ballistic stretching for martial arts.</p>\r\n<p>\r\n6.	Hold the stretch until you feel the muscle loosen off, then repeat for a further 15 seconds. </p>\r\n<p>\r\n7.	While stretching you should feel some slight discomfort, if you don’t feel anything, then you may be doing the stretch incorrectly, or simply the muscle has eased off. </p>\r\n<p>\r\n8.	Stop immediately if you feel any severe pain. </p>\r\n<p>\r\n9.	Remember to breathe regularly and rhythmically, exhale as you extend the stretch, and do not hold your breath.</p>\r\n<p>\r\n10.	To remember to stretch each muscle group start with your legs, and work your way up the body.</p>\r\n\r\n<p>Always remember to do warm up and cool down stretches before and after participating in physical activity. Through stretching one can protect their body from injury as they strive to keep it healthy. </p>\r\n'),(5011,303,0.12,'smarty','1','Page created.',1143573092,1124,'216.194.127.150','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n<hl><b>Stretching</b></hl>\r\n\r\n<p>Many people overlook the benefits of stretching before physical activity. Stretching, in addition to warming up, can help optimize your workout as well as help prevent or reduce injuries. It doesn’t matter what kind of shape you are in, your body needs to be warmed up and stretched before participating in any physical activity. The aims of stretching are to gently lengthen muscles before and after any form of exercise, and to improve tissue elasticity / flexibility. </p>\r\n\r\n\r\n<p>There are many different muscle groups within the body that can be stretched. Some tips that one should remember when stretching are</p>\r\n\r\n<p>\r\n1.	Begin with gradual mobility exercises of all the joints, i.e. simply rotate the wrists, bend the arm and roll your shoulders. This will allow the body\'s natural lubrication to protect the surface of your bones at these joints.  Using the natural range of motion the joints have their own fluid to aid in protection.</p>\r\n<p>\r\n2.	Always warm up the body prior to stretching, as this increases blood flow around the body, which in turn makes the muscles more supple. </p>\r\n<p>\r\n3.	After exercise, slowly bring your heart rate down before you begin stretching in order to avoid blood pooling within your muscles, which can lead to cramping and dizzy spells. </p> \r\n<p>\r\n4.	If you’re wet and sweaty, you can put on a sweatshirt to keep your body warm as you cool down. This will also help keep you from getting a chill. You could also take a warm shower or bath to keep warm and relax the muscles. </p>\r\n<p>\r\n5.	Never bounce while you stretch, unless you are doing specific stretches for certain sports, i.e. ballistic stretching for martial arts.</p>\r\n<p>\r\n6.	Hold the stretch until you feel the muscle loosen off, then repeat for a further 15 seconds. </p>\r\n<p>\r\n7.	While stretching you should feel some slight discomfort, if you don’t feel anything, then you may be doing the stretch incorrectly, or simply the muscle has eased off. </p>\r\n<p>\r\n8.	Stop immediately if you feel any severe pain. </p>\r\n<p>\r\n9.	Remember to breathe regularly and rhythmically, exhale as you extend the stretch, and do not hold your breath.</p>\r\n<p>\r\n10.	To remember to stretch each muscle group start with your legs, and work your way up the body.</p>\r\n\r\n<p>Always remember to do warm up and cool down stretches before and after participating in physical activity. Through stretching one can protect their body from injury as they strive to keep it healthy. </p>\r\n'),(4871,230,0.12,'smarty','1','Page created.',1140503681,2,'24.2.76.126','{include_php file=\"shared_handle:jsGetData\"}{assign var=\"pgLayout\" value=\"no layout\"}<html>\r\n<head></head>\r\n<body>\r\n\r\n	<div id=\"theData\" style=\"display:none;\">{$jsData}</div>\r\n\r\n	<script type=\"text/javascript\">\r\n		if (parent && parent.document) {ldelim}\r\n			parent.document.getElementById(\'{$jsObj}\').innerHTML = document.getElementById(\'theData\').innerHTML;\r\n		{rdelim}\r\n	</script>\r\n\r\n</body>\r\n</html>\r\n'),(4872,286,0.16,'smarty','0','Page created.',1140740640,16,'216.194.127.150','{include file=\"layouts/forceLoggedIn.tpl\"}\r\n{include_php file=\"shared_handle:company/consumerSurveyList\"}\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>Healthy For Life</h1>\r\n\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n	<img class=\"iconClipboard\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n</td><td valign=\"top\" width=\"100%\">\r\n	Welcome to Healthy For Life 2006. Participants in this program are awarded points for completing additional activities. Take this short assessment each month and the points you have earned will be tracked throughout the year. This will also serve as a reminder of activities that need to be completed. Remember- proper documentation, including the wellness coordinator’s initials, will still be required.  	\r\n</td></tr>\r\n</table>\r\n\r\n<blockquote>\r\n<table width=\"100%\"><tr>\r\n<td valign=\"top\" width=\"100%\">\r\n	<h3>Available Surveys:</h3>\r\n	<table>\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=\"ico{$item.id}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"ico{$item.id}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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</td>\r\n</tr>\r\n</table>\r\n</blockquote>'),(4873,196,1.58,'smarty','0','Finally added table for adjustments',1140741027,16,'216.194.127.150','{if $smarty.session.company.preferences.hide_incentives eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n\r\n{* HANDLERS *}\r\n{include_php file=\"shared_handle:company/participationPoints_v2\"}\r\n{include_php file=\"shared_handle:company/surveyList\"}\r\n{include_php file=\"shared_handle:company/incentivePointAdjustments\"}\r\n\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{if $smarty.session.company.preferences.title_my_incentives}{$smarty.session.company.preferences.title_my_incentives}</h1>{else}\r\n<h1>{$page.title}</h1>{/if}\r\n\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n	<img class=\"iconPrize\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n</td><td valign=\"top\" width=\"100%\">\r\n	{$incentiveText|default:\"<em>Yearly Incentive</em><br /><br />Not Yet Determined.\"}	\r\n</td></tr>\r\n</table>\r\n<br />\r\n{assign var=\"surveyPointsEarned\" value=$surveyPointsEarned|default:\"0\"}\r\n{assign var=\"totalIncentivePointAdjustments\" value=$totalIncentivePointAdjustments|default:\"0\"}\r\n<h2 class=\"boxed\"><i>Total Points Earned</i>: <em>{$totalParticipationPoints|math:\"x+$surveyPointsEarned+$totalIncentivePointAdjustments\"}</em></h2>\r\n\r\n<blockquote>\r\n<table width=\"700\">\r\n<tr><td valign=\"top\">\r\n	\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}{else}Available Surveys:</h3></td>{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}\r\n	{assign var=\"hideCheck\" value=\"hide_survey_`$item.id`\"}\r\n	{if $smarty.session.company.preferences[$hideCheck] neq \"yes\"}\r\n		<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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	{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">>\r\n		None found.</td></tr>\r\n	{/foreach}\r\n\r\n	<tr><td>&nbsp;</td>\r\n	    <td align=\"right\"><em>Survey points earned:</em></td>\r\n	    <td align=\"center\"><span class=\"boxed\">{$surveyPointsEarned|default:0}</span></td></tr>\r\n\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.wellnessConnection}{$smarty.session.company.preferences.wellnessConnection}<br /><a href=\"?pg=wellnessConnection\">Click Here</a>{else}</h3></td>\r\n		{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n\r\n\r\n	{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\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		<tr><td><img class=\"icoStethescope\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>HRA Score</u>:</b>\r\n		    {if ($aHRA.dateTaken eq \"\") OR ($aHRA.dateTaken < $smarty.now|math:\"x - 31536000\")}<br /><a href=\"javascript://\" onclick=\"openSurvey(8);\">Available Now</a>{/if}</td>\r\n		    <td align=\"center\"><em>{$aHRA.pointsEarned}</em></td></tr>\r\n	{/if}\r\n\r\n	{if $vanity eq \"onai\" or $vanity eq \"mycompany\" or $vanity eq \"zions\" or $vanity eq \"zions2\"}\r\n	<tr><td><img class=\"icoWeights\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>Consumer Tools</u>:</b><br /><em>NEW<i>!</i></em></td>\r\n		    <td align=\"center\"><a href=\"?pg=consumer_tools\">Click Here</a></td></tr>\r\n	{/if}\r\n\r\n	{if 0 neq $totalIncentivePointAdjustments}\r\n	<br style=\"clear:left;\" />\r\n	<tr><td colspan=\"3\"><h3>Adjustments/Redemptions:</h3></td></tr>\r\n        {foreach from=$incentivePointAdjustments item=\"adjustment\" name=\"loopAdjustments\"}<tr><td nowrap>\r\n	<tr><td colspan=\"2\"><small><i>{$adjustment.dateAssigned|date_format2:\"m/d/Y\"}</i> - {$adjustment.comment}</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$adjustment.points}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Total:</em></td>\r\n		<td align=\"center\" nowrap=\"nowrap\"><span class=\"boxed\"><nobr>{$totalIncentivePointAdjustments|default:0}</nobr></span></td></tr>\r\n	{/if}\r\n\r\n	</table>\r\n\r\n</td><td valign=\"top\">\r\n	<h3>Feedback:</h3>\r\n	<table>\r\n	<tr><td>\r\n	<img class=\"icoNurse\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n	</td><td>\r\n	<ul>\r\n		<li><a href=\"javascript:viewSurveys();\">Review My History</a></li>\r\n		{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\r\n		<li><a href=\"?pg=HRAScoreInfo\">HRA Score Info</a></li>\r\n		{/if}\r\n	<ul>\r\n	</td></tr>\r\n	</table>\r\n	<br />\r\n\r\n	{if $aScales|@count gt 0} {* PARTICIPATION POINTS -- IF APPLICABLE *}\r\n	<table align=\"right\">\r\n	<tr><td colspan=\"3\"><h3>Participation Points:</h3></td></tr>\r\n        {foreach from=$aScales item=\"scale\" name=\"loopScales\"}<tr><td nowrap>\r\n	<tr><td>{$scale.name|niceText}</td>\r\n	    <td><small>({$scale.dateStart|date_format2:\"m/d/y\"} - {$scale.dateEnd|date_format2:\"m/d/y\"})</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$aScores[$scale.id]|number_format:\"1\"}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Participation points earned:</em></td>\r\n		<td align=\"right\"><span class=\"boxed\">{$totalParticipationPoints|default:0}</span></td></tr>\r\n	</table>\r\n	{/if}\r\n\r\n	</td></tr>\r\n</table>\r\n</blockquote>'),(4875,196,1.60,'smarty','0','Finally added table for adjustments',1140741446,16,'216.194.127.150','{if $smarty.session.company.preferences.hide_incentives eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n\r\n{* HANDLERS *}\r\n{include_php file=\"shared_handle:company/participationPoints_v2\"}\r\n{include_php file=\"shared_handle:company/surveyList\"}\r\n{include_php file=\"shared_handle:company/incentivePointAdjustments\"}\r\n\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{if $smarty.session.company.preferences.title_my_incentives}{$smarty.session.company.preferences.title_my_incentives}</h1>{else}\r\n<h1>{$page.title}</h1>{/if}\r\n\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n	<img class=\"iconPrize\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n</td><td valign=\"top\" width=\"100%\">\r\n	{$incentiveText|default:\"<em>Yearly Incentive</em><br /><br />Not Yet Determined.\"}	\r\n</td></tr>\r\n</table>\r\n<br />\r\n{assign var=\"surveyPointsEarned\" value=$surveyPointsEarned|default:\"0\"}\r\n{assign var=\"totalIncentivePointAdjustments\" value=$totalIncentivePointAdjustments|default:\"0\"}\r\n<h2 class=\"boxed\"><i>Total Points Earned</i>: <em>{$totalParticipationPoints|math:\"x+$surveyPointsEarned+$totalIncentivePointAdjustments\"}</em></h2>\r\n\r\n<blockquote>\r\n<table width=\"700\">\r\n<tr><td valign=\"top\">\r\n	\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}{else}Available Surveys:</h3></td>{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}\r\n	{assign var=\"hideCheck\" value=\"hide_survey_`$item.id`\"}\r\n	{if $smarty.session.company.preferences[$hideCheck] neq \"yes\"}\r\n		<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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	{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">>\r\n		None found.</td></tr>\r\n	{/foreach}\r\n\r\n	<tr><td>&nbsp;</td>\r\n	    <td align=\"right\"><em>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}points earned{else}Survey points earned:{/if}</em></td>\r\n	    <td align=\"center\"><span class=\"boxed\">{$surveyPointsEarned|default:0}</span></td></tr>\r\n\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.wellnessConnection}{$smarty.session.company.preferences.wellnessConnection}<br /><a href=\"?pg=wellnessConnection\">Click Here</a>{else}</h3></td>\r\n		{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n\r\n\r\n	{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\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		<tr><td><img class=\"icoStethescope\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>HRA Score</u>:</b>\r\n		    {if ($aHRA.dateTaken eq \"\") OR ($aHRA.dateTaken < $smarty.now|math:\"x - 31536000\")}<br /><a href=\"javascript://\" onclick=\"openSurvey(8);\">Available Now</a>{/if}</td>\r\n		    <td align=\"center\"><em>{$aHRA.pointsEarned}</em></td></tr>\r\n	{/if}\r\n\r\n	{if $vanity eq \"onai\" or $vanity eq \"mycompany\" or $vanity eq \"zions\" or $vanity eq \"zions2\"}\r\n	<tr><td><img class=\"icoWeights\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>Consumer Tools</u>:</b><br /><em>NEW<i>!</i></em></td>\r\n		    <td align=\"center\"><a href=\"?pg=consumer_tools\">Click Here</a></td></tr>\r\n	{/if}\r\n\r\n	{if 0 neq $totalIncentivePointAdjustments}\r\n	<br style=\"clear:left;\" />\r\n	<tr><td colspan=\"3\"><h3>Adjustments/Redemptions:</h3></td></tr>\r\n        {foreach from=$incentivePointAdjustments item=\"adjustment\" name=\"loopAdjustments\"}<tr><td nowrap>\r\n	<tr><td colspan=\"2\"><small><i>{$adjustment.dateAssigned|date_format2:\"m/d/Y\"}</i> - {$adjustment.comment}</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$adjustment.points}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Total:</em></td>\r\n		<td align=\"center\" nowrap=\"nowrap\"><span class=\"boxed\"><nobr>{$totalIncentivePointAdjustments|default:0}</nobr></span></td></tr>\r\n	{/if}\r\n\r\n	</table>\r\n\r\n</td><td valign=\"top\">\r\n	<h3>Feedback:</h3>\r\n	<table>\r\n	<tr><td>\r\n	<img class=\"icoNurse\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n	</td><td>\r\n	<ul>\r\n		<li><a href=\"javascript:viewSurveys();\">Review My History</a></li>\r\n		{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\r\n		<li><a href=\"?pg=HRAScoreInfo\">HRA Score Info</a></li>\r\n		{/if}\r\n	<ul>\r\n	</td></tr>\r\n	</table>\r\n	<br />\r\n\r\n	{if $aScales|@count gt 0} {* PARTICIPATION POINTS -- IF APPLICABLE *}\r\n	<table align=\"right\">\r\n	<tr><td colspan=\"3\"><h3>Participation Points:</h3></td></tr>\r\n        {foreach from=$aScales item=\"scale\" name=\"loopScales\"}<tr><td nowrap>\r\n	<tr><td>{$scale.name|niceText}</td>\r\n	    <td><small>({$scale.dateStart|date_format2:\"m/d/y\"} - {$scale.dateEnd|date_format2:\"m/d/y\"})</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$aScores[$scale.id]|number_format:\"1\"}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Participation points earned:</em></td>\r\n		<td align=\"right\"><span class=\"boxed\">{$totalParticipationPoints|default:0}</span></td></tr>\r\n	</table>\r\n	{/if}\r\n\r\n	</td></tr>\r\n</table>\r\n</blockquote>'),(4877,196,1.62,'smarty','0','Finally added table for adjustments',1140741562,16,'216.194.127.150','{if $smarty.session.company.preferences.hide_incentives eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n\r\n{* HANDLERS *}\r\n{include_php file=\"shared_handle:company/participationPoints_v2\"}\r\n{include_php file=\"shared_handle:company/surveyList\"}\r\n{include_php file=\"shared_handle:company/incentivePointAdjustments\"}\r\n\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{if $smarty.session.company.preferences.title_my_incentives}{$smarty.session.company.preferences.title_my_incentives}</h1>{else}\r\n<h1>{$page.title}</h1>{/if}\r\n\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n	<img class=\"iconPrize\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n</td><td valign=\"top\" width=\"100%\">\r\n	{$incentiveText|default:\"<em>Yearly Incentive</em><br /><br />Not Yet Determined.\"}	\r\n</td></tr>\r\n</table>\r\n<br />\r\n{assign var=\"surveyPointsEarned\" value=$surveyPointsEarned|default:\"0\"}\r\n{assign var=\"totalIncentivePointAdjustments\" value=$totalIncentivePointAdjustments|default:\"0\"}\r\n<h2 class=\"boxed\"><i>Total Points Earned</i>: <em>{$totalParticipationPoints|math:\"x+$surveyPointsEarned+$totalIncentivePointAdjustments\"}</em></h2>\r\n\r\n<blockquote>\r\n<table width=\"700\">\r\n<tr><td valign=\"top\">\r\n	\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}{else}Available Surveys:</h3></td>{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}\r\n	{assign var=\"hideCheck\" value=\"hide_survey_`$item.id`\"}\r\n	{if $smarty.session.company.preferences[$hideCheck] neq \"yes\"}\r\n		<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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	{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">>\r\n		None found.</td></tr>\r\n	{/foreach}\r\n\r\n	<tr><td>&nbsp;</td>\r\n	    <td align=\"right\"><em>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}&nbsppoints earned{else}Survey points earned:{/if}</em></td>\r\n	    <td align=\"center\"><span class=\"boxed\">{$surveyPointsEarned|default:0}</span></td></tr>\r\n\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.wellnessConnection}{$smarty.session.company.preferences.wellnessConnection}<br /><a href=\"?pg=wellnessConnection\">Click Here</a>{else}</h3></td>\r\n		{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n\r\n\r\n	{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\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		<tr><td><img class=\"icoStethescope\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>HRA Score</u>:</b>\r\n		    {if ($aHRA.dateTaken eq \"\") OR ($aHRA.dateTaken < $smarty.now|math:\"x - 31536000\")}<br /><a href=\"javascript://\" onclick=\"openSurvey(8);\">Available Now</a>{/if}</td>\r\n		    <td align=\"center\"><em>{$aHRA.pointsEarned}</em></td></tr>\r\n	{/if}\r\n\r\n	{if $vanity eq \"onai\" or $vanity eq \"mycompany\" or $vanity eq \"zions\" or $vanity eq \"zions2\"}\r\n	<tr><td><img class=\"icoWeights\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>Consumer Tools</u>:</b><br /><em>NEW<i>!</i></em></td>\r\n		    <td align=\"center\"><a href=\"?pg=consumer_tools\">Click Here</a></td></tr>\r\n	{/if}\r\n\r\n	{if 0 neq $totalIncentivePointAdjustments}\r\n	<br style=\"clear:left;\" />\r\n	<tr><td colspan=\"3\"><h3>Adjustments/Redemptions:</h3></td></tr>\r\n        {foreach from=$incentivePointAdjustments item=\"adjustment\" name=\"loopAdjustments\"}<tr><td nowrap>\r\n	<tr><td colspan=\"2\"><small><i>{$adjustment.dateAssigned|date_format2:\"m/d/Y\"}</i> - {$adjustment.comment}</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$adjustment.points}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Total:</em></td>\r\n		<td align=\"center\" nowrap=\"nowrap\"><span class=\"boxed\"><nobr>{$totalIncentivePointAdjustments|default:0}</nobr></span></td></tr>\r\n	{/if}\r\n\r\n	</table>\r\n\r\n</td><td valign=\"top\">\r\n	<h3>Feedback:</h3>\r\n	<table>\r\n	<tr><td>\r\n	<img class=\"icoNurse\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n	</td><td>\r\n	<ul>\r\n		<li><a href=\"javascript:viewSurveys();\">Review My History</a></li>\r\n		{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\r\n		<li><a href=\"?pg=HRAScoreInfo\">HRA Score Info</a></li>\r\n		{/if}\r\n	<ul>\r\n	</td></tr>\r\n	</table>\r\n	<br />\r\n\r\n	{if $aScales|@count gt 0} {* PARTICIPATION POINTS -- IF APPLICABLE *}\r\n	<table align=\"right\">\r\n	<tr><td colspan=\"3\"><h3>Participation Points:</h3></td></tr>\r\n        {foreach from=$aScales item=\"scale\" name=\"loopScales\"}<tr><td nowrap>\r\n	<tr><td>{$scale.name|niceText}</td>\r\n	    <td><small>({$scale.dateStart|date_format2:\"m/d/y\"} - {$scale.dateEnd|date_format2:\"m/d/y\"})</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$aScores[$scale.id]|number_format:\"1\"}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Participation points earned:</em></td>\r\n		<td align=\"right\"><span class=\"boxed\">{$totalParticipationPoints|default:0}</span></td></tr>\r\n	</table>\r\n	{/if}\r\n\r\n	</td></tr>\r\n</table>\r\n</blockquote>'),(5044,272,0.86,'smarty','0','Working on forms, etc.',1146543281,2,'24.2.76.126','{stored_object name=$smarty.session.session_id|truncate:10:\"\" type=\"comp\" from=\"comp\" assign=\"comp\"}\r\n\r\n{if $smarty.request.confirmReset}{stored_object name=$smarty.session.session_id|truncate:10:\"\" type=\"comp\" destroy=\"true\"}{/if}\r\n\r\n{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<form method=\"post\" action=\"index.php\">\r\n<input type=\"hidden\" name=\"pg\" value=\"{toc_next}\">\r\n<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n\r\n<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n<tr>\r\n<td valign=\"top\">\r\n<br>\r\n<table border=0 cellpadding=0 cellspacing=0>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\">A. Competing for...</td><td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"p2p\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'p2p\');\">Pound for pound <i>(Weight lost)</i></a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"pctWt\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'pctWt\');\">Percent of body weight lost</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"minEx\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'minEx\');\">Total minutes exercised</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"disEx\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'disEx\');\">Total distance exercised</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"veg\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'veg\');\">Vegetable challenge</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"gain\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'gain\');\">Weight gained</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;\"></td></tr>\r\n</table>\r\n</td>\r\n<td valign=\"top\">\r\n<br>\r\n<table border=0 cellpadding=0 cellspacing=0>\r\n<tr>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif\"></td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\">\r\n\r\nB. The competition name is...\r\n</td>\r\n<td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif\"></td>\r\n</tr>\r\n<tr>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td>\r\n<td>\r\n\r\n<div onclick=\"validateDiv(this);\" id=\"step1_block_B\" style=\"margin-top:-1px;margin-left:0px;border:solid 1px gray;background-color:silver;zIndex:100;position:absolute;filter:alpha(opacity=25);-moz-opacity:0.25;\">\r\n    <table border=0 cellspacing=0>\r\n    <tr>\r\n      <td><h3>Name:</h3></td>\r\n      <td><input type=\"text\" name=\"comp[tmp]\" id=\"comp[tmp]\" disabled=\"true\" onkeyup=\"unBlock(\'step1_block_C\');\"/></td>\r\n    </tr>\r\n    <tr>\r\n      <td valign=\"top\"><small><b>Examples:</b></small></td>\r\n      <td><small>&quot;The chubby family reunion&quot;<br />&quot;Company shape-up marathon&quot;<br />&quot;Super Summer Slimdown&quot;</small></td>\r\n    </tr>\r\n    </table>\r\n</div>\r\n\r\n\r\n    <table border=0 cellspacing=0>\r\n    <tr>\r\n      <td><h3>Name:</h3></td>\r\n      <td><input type=\"text\" name=\"comp[title]\" id=\"comp[title]\" onkeyup=\"unBlock(\'step1_block_C\');\"/></td>\r\n    </tr>\r\n    <tr>\r\n      <td valign=\"top\"><small><b>Examples:</b></small></td>\r\n      <td><small>&quot;The chubby family reunion&quot;<br />&quot;Company shape-up marathon&quot;<br />&quot;Super Summer Slimdown&quot;</small></td>\r\n    </tr>\r\n    </table>\r\n\r\n</td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td>\r\n</tr>\r\n<tr><td style=\"height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;\"></td></tr>\r\n</table>\r\n    <br/>\r\n    <div style=\"border:solid 1px black;width:94%;height:85px;\">\r\n      test\r\n    </div>\r\n</td>\r\n<td valign=\"top\">\r\n<br>\r\n<table border=0 cellpadding=0 cellspacing=0>\r\n<tr>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif\"></td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\">\r\n\r\nC. Who\'s competing...\r\n</td>\r\n<td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif\"></td>\r\n</tr>\r\n<tr>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td>\r\n<td>\r\n\r\n<div onclick=\"validateDiv(this);\" id=\"step1_block_C\" style=\"margin-top:-1px;margin-left:-10px;border:solid 1px gray;background-color:silver;zIndex:100;position:absolute;filter:alpha(opacity=25);-moz-opacity:0.25;\">\r\n    <table border=0 cellpaddin=0 cellspacing=0>\r\n      <tr>\r\n	<td colspan=\"2\">\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	     <tr>\r\n	       <td colspan=2><li style=\"color:#cccccc\">Invate your friends</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small style=\"color:#cccccc\">\r\n		   My friend\'s Name:\r\n                 </small>\r\n	       </td>\r\n	       <td>\r\n	         &nbsp;&nbsp;&nbsp;<input type=\"text id=\"tmp1\" name=\"temp1\" style=\"width:110px;\" disabled />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small style=\"color:#cccccc\">\r\n		   My friend\'s Email:\r\n	         </small>\r\n	       </td>\r\n	       <td>\r\n	          &nbsp;&nbsp;&nbsp;<input type=\"text id=\"tmp1\" name=\"temp1\" style=\"width:110px;\" disabled/>\r\n               </td>\r\n             </tr>\r\n             <tr>\r\n	       <td colspan=\"2\" align=\"right\">\r\n	         <small style=\"color:#cccccc\">\r\n		   <span>\r\n                     Add more\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	</td>\r\n      </tr>\r\n      <tr><td colspan=\"2\"><li style=\"color:#cccccc\">Let them know with an email...</li></td></tr>\r\n      <tr>\r\n        <td valign=\"top\" colspan=2>\r\n	  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	      <tr>\r\n		 <td valign=\"top\">\r\n		    <small style=\"color:#cccccc\">\r\n			<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n			  <tr><td>&nbsp;&nbsp;&nbsp;<input type=\"radio\" value=\"kind\" name=\"tmp2\"/> <span style=\"color:#cccccc;\">Kind Message</span></td></tr>\r\n			  <tr><td>&nbsp;&nbsp;&nbsp;<input type=\"radio\" value=\"smack\" name=\"tmp2\"/> <span style=\"color:#cccccc;\">Trash Talking Message</span></td></tr>\r\n			  <tr><td>&nbsp;&nbsp;&nbsp;<input type=\"radio\" value=\"challenge\" name=\"tmp2\"/> <span style=\"color:#cccccc;\">Motivational Message</span></td></tr>\r\n			  <tr><td>&nbsp;&nbsp;&nbsp;<input type=\"radio\" value=\"custom\" name=\"tmp2\"/> <span style=\"color:#cccccc;\">Make Your Own Message</span></td></tr>\r\n                        </table>\r\n		    </small>\r\n		 </td>\r\n		 <td valign=\"top\" id=\"invateHolder\">\r\n		    <div id=\"tmp3\" style=\"border-bottom:solid 1px #CCC;border-left:solid 1px #CCC;padding-right:5px;visibility:hidden;\">\r\n			<small style=\"color:#cccccc\">\r\n			   <a href=\"javascript:setInviteWeight(\'heavy\');\">Heavy</a><br />\r\n			   <a href=\"javascript:setInviteWeight(\'medium\');\">Medium</a><br />\r\n			   <a href=\"javascript:setInviteWeight(\'light\');\">Light</a><br />\r\n			</small>\r\n		    </div>\r\n		</td>\r\n	     </tr>\r\n	  </table>\r\n        </td>\r\n     </tr>\r\n     </table>\r\n</div>\r\n\r\n    <table border=0 cellpaddin=0 cellspacing=0>\r\n      <tr>\r\n	<td colspan=\"2\">\r\n	  <div id=\'enterFriendNameDiv\' style=\'display:block;\'>\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	     <tr>\r\n	       <td colspan=2><li>Invate your friends</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Name:\r\n                 </small>\r\n	       </td>\r\n	       <td>\r\n	         <input type=\"text id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Email:\r\n	         </small>\r\n	       </td>\r\n	       <td>\r\n		  <input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td colspan=\"2\" align=\"right\">\r\n	         <small>\r\n		   <span onclick=\"extraCompetitors(\'open\');\" style=\"cursor:pointer;\">\r\n                     Add more\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	  </div>\r\n	  <div id=\"myEnteredFriendsDiv\" style=\"display:none;\">\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n	     <tr>\r\n	       <td><li>My Competitors:</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"left\" id=\"competitorListHolder\" style=\"padding-left:15px\">\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   <span onclick=\"editCompetitors();\" style=\"cursor:pointer;\">\r\n                     Edit my competitors\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	  </div>\r\n	</td>\r\n      </tr>\r\n      <tr><td colspan=\"2\"><li>Let them know with an email...</li></td></tr>\r\n      <tr>\r\n        <td valign=\"top\" colspan=2>\r\n	  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	      <tr>\r\n		 <td valign=\"top\">\r\n		    <small>\r\n			<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n			  <tr><td id=\'kind\'><input type=\"radio\" value=\"kind\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'kind\');\"/> <a href=\"javascript:setInviteStyle(\'kind\');\">Kind Message</a></td></tr>\r\n			  <tr><td id=\'smack\'><input type=\"radio\" value=\"smack\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'smack\');\"/> <a href=\"javascript:setInviteStyle(\'smack\');\">Trash Talking Message</a></td></tr>\r\n			  <tr><td id=\'challenge\'><input type=\"radio\" value=\"challenge\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'challenge\');\" /> <a href=\"javascript:setInviteStyle(\'challenge\');\">Challenge</a></td></tr>\r\n			  <tr><td id=\'custom\'><input type=\"radio\" value=\"custom\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'custom\');\"/> <a href=\"javascript:setInviteStyle(\'custom\');\">Make Your Own</a></td></tr>\r\n                        </table>\r\n		    </small>\r\n		 </td>\r\n		 <td valign=\"top\" id=\"invateHolder\">\r\n		    <div id=\"InvateW\" style=\"border-bottom:solid 1px #CCC;border-left:solid 1px #CCC;padding-right:5px;visibility:hidden;\">\r\n			<small>\r\n			   <input type=\"radio\" value=\"heavy\" name=\"comp[invite_subtype]\"  onclick=\"displayLetter(\'{$vanity}\')\" /> <a href=\"javascript:setInviteWeight(\'heavy\');\">Heavy</a><br />\r\n			   <input type=\"radio\" value=\"medium\" name=\"comp[invite_subtype]\" onclick=\"displayLetter(\'{$vanity}\')\" /> <a href=\"javascript:setInviteWeight(\'medium\');\">Medium</a><br />\r\n			   <input type=\"radio\" value=\"light\" name=\"comp[invite_subtype]\" onclick=\"displayLetter(\'{$vanity}\')\" /> <a href=\"javascript:setInviteWeight(\'light\');\">Light</a><br />\r\n			</small>\r\n		    </div>\r\n		</td>\r\n	     </tr>\r\n	  </table>\r\n        </td>\r\n     </tr>\r\n     </table>\r\n\r\n\r\n</td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td>\r\n</tr>\r\n<tr><td style=\"height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;\"></td></tr>\r\n</table>\r\n</td>\r\n<td>\r\n</td>\r\n</tr>\r\n</table>\r\n<br />\r\n<table border=\"0\" cellpadding=0 cellspacing=0 width=\"100%\">\r\n<tr>\r\n<td width=\"10px\" style=\"background-image:url({$skinFolder}images/ehc/containers/note/top.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/note/topLeftCorner.gif\"></td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/note/top.gif);background-repeat:repeat-x;\"></td>\r\n<td width=\"15px\" style=\"background-image:url({$skinFolder}images/ehc/containers/note/top.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/note/topRightCorner.gif\"></td>\r\n</tr>\r\n<tr>\r\n<td width=\"10px\" style=\"background-image:url({$skinFolder}images/ehc/containers/note/left.gif);background-repeat:repeat-y;\"></td>\r\n   <td>\r\n      <!-- <iframe src=\"\" id=\"letterHolder\" name=\"letterHolder\" style=\"width:100%;height:410px;\" scrollbars=\"no\" frameborder=\"0\"></iframe> -->\r\n      <div id=\"letterHolder\" name=\"letterHolder\" style=\"width:100%;height:410px;border:solid 1px white;\"></div>\r\n   </td>\r\n<td width=\"10px\" style=\"background-image:url({$skinFolder}images/ehc/containers/note/right.gif);background-repeat:repeat-y;\"></td>\r\n</tr>\r\n<tr><td style=\"height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;\"></td></tr>\r\n</table>\r\n{* <iframe src=\"?pg=compCreate/inviteFrame\" style=\"width:100%;height:410px;\" scrollbars=\"no\" frameborder=\"0\"></iframe> *}\r\n\r\n<div id=\"invite-div\"></div>\r\n<br />\r\n\r\n<div align=\"right\">\r\n  <a href=\"?pg=compCreate/step2\"><img src=\"{$skinFolder}images/btn_next.gif\" alt=\"Next\" border=\"0\" /></a>\r\n</div>\r\n\r\n<div id=\"myCompetitors\" style=\"width:300px;background-color:white;zIndex:100;position:absolute;display:none;top:-70px;left:300px;border:solid 1px #CCC;filter: alpha(opacity=85)\">\r\n  <center>\r\n   <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"95%\">\r\n      <tr><td align=\"right\" valign=\"top\" style=\"height:5px\"><small><span style=\"cursor:pointer;\" onclick=\"extraCompetitors(\'close\');\">close window</span><small></td></tr>\r\n      <tr><td style=\"border-bottom:solid 1px #CCC;\"><h2>More Competitors...</td></tr>\r\n      <tr>\r\n         <td align=\"center\">\r\n	    <table id=\"competitorsTable\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"90%\">\r\n                <tr>\r\n		  <td></td>\r\n		  <td align=\"center\" valign=\"bottom\">Name</td>\r\n                  <td align=\"center\" valign=\"bottom\">Email</td>\r\n                </tr>\r\n	        <tr>\r\n		  <td>2.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>3.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>4.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>5.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>6.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>7.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>8.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>9.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>10.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>11.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n		<tr>\r\n		  <td colspan=\"3\" align=\"right\"><small><span style=\"cursor:pointer;\" onclick=\'addMoreCompetitors();\'>Add More Lines</span></small></td>\r\n		</tr>\r\n            </table>\r\n         </td>\r\n      </tr>\r\n      <tr>\r\n	<td align=\"right\" style=\"border-top:solid 1px #CCC;\"><img style=\"cursor:pointer;\" onclick=\"addingCompetitors();\" src=\"{$skinFolder}images/btn_next.gif\" alt=\"Add\" border=\"0\" /></td>\r\n      </tr>\r\n   </table>\r\n  </center>\r\n</div>\r\n\r\n</form>\r\n\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/js-get-data.js\"></script>\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/AJAX.js\"></script>\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/NewComp.js\"></script>\r\n\r\n<script language=\"JavaScript\">\r\n	\r\n        //jsGetData(\'?pg=jsGetData\',\'invite-div\', \'madlib.form\', \'&compType=friends&inviteType=smack\');\r\n\r\n	var examples = Array();\r\n	{foreach from=$examples key=\"key\" item=\"example\"}\r\n	examples[{$key}] = \'{eval var=$example.body|addslashes|replace:\"\\r\":\"\"|replace:\"\\n\":\"\\\\n\"}\';\r\n	{/foreach}\r\n	\r\n	{literal}\r\n\r\n\r\n	{/literal}\r\n</script>'),(4936,298,0.10,'smarty','1','Page created.',1141790112,934,'216.194.127.150',''),(5048,272,0.88,'smarty','0','Working on forms, etc.',1146544346,2,'24.2.76.126','{stored_object name=$smarty.session.session_id|truncate:10:\"\" type=\"comp\" from=\"comp\" assign=\"comp\"}\r\n\r\n{if $smarty.request.confirmReset}{stored_object name=$smarty.session.session_id|truncate:10:\"\" type=\"comp\" destroy=\"true\"}{/if}\r\n\r\n{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<form method=\"post\" action=\"index.php\">\r\n<input type=\"hidden\" name=\"pg\" value=\"{toc_next}\">\r\n<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n\r\n<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n<tr>\r\n<td valign=\"top\">\r\n<br>\r\n<table border=0 cellpadding=0 cellspacing=0>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\">A. Competing for...</td><td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"p2p\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'p2p\');\">Pound for pound <i>(Weight lost)</i></a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"pctWt\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'pctWt\');\">Percent of body weight lost</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"minEx\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'minEx\');\">Total minutes exercised</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"disEx\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'disEx\');\">Total distance exercised</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"veg\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'veg\');\">Vegetable challenge</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"gain\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'gain\');\">Weight gained</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;\"></td></tr>\r\n</table>\r\n</td>\r\n<td valign=\"top\">\r\n<br>\r\n<table border=0 cellpadding=0 cellspacing=0>\r\n<tr>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif\"></td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\">\r\n\r\nB. The competition name is...\r\n</td>\r\n<td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif\"></td>\r\n</tr>\r\n<tr>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td>\r\n<td>\r\n\r\n<div onclick=\"validateDiv(this);\" id=\"step1_block_B\" style=\"margin-top:-1px;margin-left:0px;border:solid 1px gray;background-color:silver;zIndex:100;position:absolute;filter:alpha(opacity=25);-moz-opacity:0.25;\">\r\n    <table border=0 cellspacing=0>\r\n    <tr>\r\n      <td><h3>Name:</h3></td>\r\n      <td><input type=\"text\" name=\"comp[tmp]\" id=\"comp[tmp]\" disabled=\"true\" onkeyup=\"unBlock(\'step1_block_C\');\"/></td>\r\n    </tr>\r\n    <tr>\r\n      <td valign=\"top\"><small><b>Examples:</b></small></td>\r\n      <td><small>&quot;The chubby family reunion&quot;<br />&quot;Company shape-up marathon&quot;<br />&quot;Super Summer Slimdown&quot;</small></td>\r\n    </tr>\r\n    </table>\r\n</div>\r\n\r\n\r\n    <table border=0 cellspacing=0>\r\n    <tr>\r\n      <td><h3>Name:</h3></td>\r\n      <td><input type=\"text\" name=\"comp[title]\" id=\"comp[title]\" onkeyup=\"unBlock(\'step1_block_C\');\"/></td>\r\n    </tr>\r\n    <tr>\r\n      <td valign=\"top\"><small><b>Examples:</b></small></td>\r\n      <td><small>&quot;The chubby family reunion&quot;<br />&quot;Company shape-up marathon&quot;<br />&quot;Super Summer Slimdown&quot;</small></td>\r\n    </tr>\r\n    </table>\r\n\r\n</td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td>\r\n</tr>\r\n<tr><td style=\"height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;\"></td></tr>\r\n</table>\r\n    <br/>\r\n    <div style=\"border:solid 1px black;width:94%;height:85px;\">\r\n      test\r\n    </div>\r\n</td>\r\n<td valign=\"top\">\r\n<br>\r\n<table border=0 cellpadding=0 cellspacing=0>\r\n<tr>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif\"></td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\">\r\n\r\nC. Who\'s competing...\r\n</td>\r\n<td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif\"></td>\r\n</tr>\r\n<tr>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td>\r\n<td>\r\n\r\n<div onclick=\"validateDiv(this);\" id=\"step1_block_C\" style=\"margin-top:-1px;margin-left:-10px;border:solid 1px gray;background-color:silver;zIndex:100;position:absolute;filter:alpha(opacity=25);-moz-opacity:0.25;\">\r\n    <table border=0 cellpaddin=0 cellspacing=0>\r\n      <tr>\r\n	<td colspan=\"2\">\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	     <tr>\r\n	       <td colspan=2><li style=\"color:#cccccc\">Invate your friends</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small style=\"color:#cccccc\">\r\n		   My friend\'s Name:\r\n                 </small>\r\n	       </td>\r\n	       <td>\r\n	         &nbsp;&nbsp;&nbsp;<input type=\"text id=\"tmp1\" name=\"temp1\" style=\"width:110px;\" disabled />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small style=\"color:#cccccc\">\r\n		   My friend\'s Email:\r\n	         </small>\r\n	       </td>\r\n	       <td>\r\n	          &nbsp;&nbsp;&nbsp;<input type=\"text id=\"tmp1\" name=\"temp1\" style=\"width:110px;\" disabled/>\r\n               </td>\r\n             </tr>\r\n             <tr>\r\n	       <td colspan=\"2\" align=\"right\">\r\n	         <small style=\"color:#cccccc\">\r\n		   <span>\r\n                     Add more\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	</td>\r\n      </tr>\r\n      <tr><td colspan=\"2\"><li style=\"color:#cccccc\">Let them know with an email...</li></td></tr>\r\n      <tr>\r\n        <td valign=\"top\" colspan=2>\r\n	  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	      <tr>\r\n		 <td valign=\"top\">\r\n		    <small style=\"color:#cccccc\">\r\n			<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n			  <tr><td>&nbsp;&nbsp;&nbsp;<input type=\"radio\" value=\"kind\" name=\"tmp2\"/> <span style=\"color:#cccccc;\">Kind Message</span></td></tr>\r\n			  <tr><td>&nbsp;&nbsp;&nbsp;<input type=\"radio\" value=\"smack\" name=\"tmp2\"/> <span style=\"color:#cccccc;\">Trash Talking Message</span></td></tr>\r\n			  <tr><td>&nbsp;&nbsp;&nbsp;<input type=\"radio\" value=\"challenge\" name=\"tmp2\"/> <span style=\"color:#cccccc;\">Motivational Message</span></td></tr>\r\n			  <tr><td>&nbsp;&nbsp;&nbsp;<input type=\"radio\" value=\"custom\" name=\"tmp2\"/> <span style=\"color:#cccccc;\">Make Your Own Message</span></td></tr>\r\n                        </table>\r\n		    </small>\r\n		 </td>\r\n		 <td valign=\"top\" id=\"invateHolder\">\r\n		    <div id=\"tmp3\" style=\"border-bottom:solid 1px #CCC;border-left:solid 1px #CCC;padding-right:5px;visibility:hidden;\">\r\n			<small style=\"color:#cccccc\">\r\n			   <a href=\"javascript:setInviteWeight(\'heavy\');\">Heavy</a><br />\r\n			   <a href=\"javascript:setInviteWeight(\'medium\');\">Medium</a><br />\r\n			   <a href=\"javascript:setInviteWeight(\'light\');\">Light</a><br />\r\n			</small>\r\n		    </div>\r\n		</td>\r\n	     </tr>\r\n	  </table>\r\n        </td>\r\n     </tr>\r\n     </table>\r\n</div>\r\n\r\n    <table border=0 cellpaddin=0 cellspacing=0>\r\n      <tr>\r\n	<td colspan=\"2\">\r\n	  <div id=\'enterFriendNameDiv\' style=\'display:block;\'>\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	     <tr>\r\n	       <td colspan=2><li>Invate your friends</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Name:\r\n                 </small>\r\n	       </td>\r\n	       <td>\r\n	         <input type=\"text id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Email:\r\n	         </small>\r\n	       </td>\r\n	       <td>\r\n		  <input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td colspan=\"2\" align=\"right\">\r\n	         <small>\r\n		   <span onclick=\"extraCompetitors(\'open\');\" style=\"cursor:pointer;\">\r\n                     Add more\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	  </div>\r\n	  <div id=\"myEnteredFriendsDiv\" style=\"display:none;\">\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n	     <tr>\r\n	       <td><li>My Competitors:</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"left\" id=\"competitorListHolder\" style=\"padding-left:15px\">\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   <span onclick=\"editCompetitors();\" style=\"cursor:pointer;\">\r\n                     Edit my competitors\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	  </div>\r\n	</td>\r\n      </tr>\r\n      <tr><td colspan=\"2\"><li>Let them know with an email...</li></td></tr>\r\n      <tr>\r\n        <td valign=\"top\" colspan=2>\r\n	  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	      <tr>\r\n		 <td valign=\"top\">\r\n		    <small>\r\n			<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n			  <tr><td id=\'kind\'><input type=\"radio\" value=\"kind\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'kind\');\"/> <a href=\"javascript:setInviteStyle(\'kind\');\">Kind Message</a></td></tr>\r\n			  <tr><td id=\'smack\'><input type=\"radio\" value=\"smack\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'smack\');\"/> <a href=\"javascript:setInviteStyle(\'smack\');\">Trash Talking Message</a></td></tr>\r\n			  <tr><td id=\'challenge\'><input type=\"radio\" value=\"challenge\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'challenge\');\" /> <a href=\"javascript:setInviteStyle(\'challenge\');\">Challenge</a></td></tr>\r\n			  <tr><td id=\'custom\'><input type=\"radio\" value=\"custom\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'custom\');\"/> <a href=\"javascript:setInviteStyle(\'custom\');\">Make Your Own</a></td></tr>\r\n                        </table>\r\n		    </small>\r\n		 </td>\r\n		 <td valign=\"top\" id=\"invateHolder\">\r\n		    <div id=\"InvateW\" style=\"border-bottom:solid 1px #CCC;border-left:solid 1px #CCC;padding-right:5px;visibility:hidden;\">\r\n			<small>\r\n			   <input type=\"radio\" value=\"heavy\" name=\"comp[invite_subtype]\"  onclick=\"displayLetter(\'{$vanity}\')\" /> <a href=\"javascript:setInviteWeight(\'heavy\');\">Heavy</a><br />\r\n			   <input type=\"radio\" value=\"medium\" name=\"comp[invite_subtype]\" onclick=\"displayLetter(\'{$vanity}\')\" /> <a href=\"javascript:setInviteWeight(\'medium\');\">Medium</a><br />\r\n			   <input type=\"radio\" value=\"light\" name=\"comp[invite_subtype]\" onclick=\"displayLetter(\'{$vanity}\')\" /> <a href=\"javascript:setInviteWeight(\'light\');\">Light</a><br />\r\n			</small>\r\n		    </div>\r\n		</td>\r\n	     </tr>\r\n	  </table>\r\n        </td>\r\n     </tr>\r\n     </table>\r\n\r\n\r\n</td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td>\r\n</tr>\r\n<tr><td style=\"height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;\"></td></tr>\r\n</table>\r\n</td>\r\n<td>\r\n</td>\r\n</tr>\r\n</table>\r\n<br />\r\n<table border=\"0\" cellpadding=0 cellspacing=0 width=\"100%\">\r\n<tr>\r\n<td width=\"10px\" style=\"background-image:url({$skinFolder}images/ehc/containers/note/top.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/note/topLeftCorner.gif\"></td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/note/top.gif);background-repeat:repeat-x;\"></td>\r\n<td width=\"15px\" style=\"background-image:url({$skinFolder}images/ehc/containers/note/top.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/note/topRightCorner.gif\"></td>\r\n</tr>\r\n<tr>\r\n<td width=\"10px\" style=\"background-image:url({$skinFolder}images/ehc/containers/note/left.gif);background-repeat:repeat-y;\"></td>\r\n   <td>\r\n      <!-- <iframe src=\"\" id=\"letterHolder\" name=\"letterHolder\" style=\"width:100%;height:410px;\" scrollbars=\"no\" frameborder=\"0\"></iframe> -->\r\n      <div id=\"letterHolder\" name=\"letterHolder\" style=\"width:100%;height:410px;border:solid 1px white;\"></div>\r\n   </td>\r\n<td width=\"10px\" style=\"background-image:url({$skinFolder}images/ehc/containers/note/right.gif);background-repeat:repeat-y;\"></td>\r\n</tr>\r\n<tr><td style=\"height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;\"></td></tr>\r\n</table>\r\n{* <iframe src=\"?pg=compCreate/inviteFrame\" style=\"width:100%;height:410px;\" scrollbars=\"no\" frameborder=\"0\"></iframe> *}\r\n\r\n<div id=\"invite-div\"></div>\r\n<br />\r\n\r\n<div align=\"right\">\r\n  <button type=\"image\" src=\"{$skinFolder}images/btn_next.gif\" alt=\"Next\" border=\"0\" />\r\n</div>\r\n\r\n<div id=\"myCompetitors\" style=\"width:300px;background-color:white;zIndex:100;position:absolute;display:none;top:-70px;left:300px;border:solid 1px #CCC;filter: alpha(opacity=85)\">\r\n  <center>\r\n   <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"95%\">\r\n      <tr><td align=\"right\" valign=\"top\" style=\"height:5px\"><small><span style=\"cursor:pointer;\" onclick=\"extraCompetitors(\'close\');\">close window</span><small></td></tr>\r\n      <tr><td style=\"border-bottom:solid 1px #CCC;\"><h2>More Competitors...</td></tr>\r\n      <tr>\r\n         <td align=\"center\">\r\n	    <table id=\"competitorsTable\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"90%\">\r\n                <tr>\r\n		  <td></td>\r\n		  <td align=\"center\" valign=\"bottom\">Name</td>\r\n                  <td align=\"center\" valign=\"bottom\">Email</td>\r\n                </tr>\r\n	        <tr>\r\n		  <td>2.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>3.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>4.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>5.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>6.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>7.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>8.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>9.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>10.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>11.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n		<tr>\r\n		  <td colspan=\"3\" align=\"right\"><small><span style=\"cursor:pointer;\" onclick=\'addMoreCompetitors();\'>Add More Lines</span></small></td>\r\n		</tr>\r\n            </table>\r\n         </td>\r\n      </tr>\r\n      <tr>\r\n	<td align=\"right\" style=\"border-top:solid 1px #CCC;\"><img style=\"cursor:pointer;\" onclick=\"addingCompetitors();\" src=\"{$skinFolder}images/btn_next.gif\" alt=\"Add\" border=\"0\" /></td>\r\n      </tr>\r\n   </table>\r\n  </center>\r\n</div>\r\n\r\n</form>\r\n\r\n{stored_object_fill_form object=$comp name=\"comp\"}\r\n\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/js-get-data.js\"></script>\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/AJAX.js\"></script>\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/NewComp.js\"></script>\r\n\r\n<script language=\"JavaScript\">\r\n	\r\n        //jsGetData(\'?pg=jsGetData\',\'invite-div\', \'madlib.form\', \'&compType=friends&inviteType=smack\');\r\n\r\n	var examples = Array();\r\n	{foreach from=$examples key=\"key\" item=\"example\"}\r\n	examples[{$key}] = \'{eval var=$example.body|addslashes|replace:\"\\r\":\"\"|replace:\"\\n\":\"\\\\n\"}\';\r\n	{/foreach}\r\n	\r\n	{literal}\r\n\r\n\r\n	{/literal}\r\n</script>'),(4824,196,1.52,'smarty','0','Finally added table for adjustments',1139606135,16,'216.194.127.150','{if $smarty.session.company.preferences.hide_incentives eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n\r\n{* HANDLERS *}\r\n{include_php file=\"shared_handle:company/participationPoints_v2\"}\r\n{include_php file=\"shared_handle:company/surveyList\"}\r\n{include_php file=\"shared_handle:company/incentivePointAdjustments\"}\r\n{***{include_php file=\"shared_handle:company/wellnessConnectionList\"}***}\r\n\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{if $smarty.session.company.preferences.title_my_incentives}{$smarty.session.company.preferences.title_my_incentives}</h1>{else}\r\n<h1>{$page.title}</h1>{/if}\r\n\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n	<img class=\"iconPrize\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n</td><td valign=\"top\" width=\"100%\">\r\n	{$incentiveText|default:\"<em>Yearly Incentive</em><br /><br />Not Yet Determined.\"}	\r\n</td></tr>\r\n</table>\r\n<br />\r\n{assign var=\"surveyPointsEarned\" value=$surveyPointsEarned|default:\"0\"}\r\n{assign var=\"totalIncentivePointAdjustments\" value=$totalIncentivePointAdjustments|default:\"0\"}\r\n<h2 class=\"boxed\"><i>Total Points Earned</i>: <em>{$totalParticipationPoints|math:\"x+$surveyPointsEarned+$totalIncentivePointAdjustments\"}</em></h2>\r\n\r\n<blockquote>\r\n<table width=\"700\">\r\n<tr><td valign=\"top\">\r\n	\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}{else}Available Surveys:</h3></td>{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}\r\n	{assign var=\"hideCheck\" value=\"hide_survey_`$item.id`\"}\r\n	{if $smarty.session.company.preferences[$hideCheck] neq \"yes\"}\r\n		<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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	{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">>\r\n		None found.</td></tr>\r\n	{/foreach}\r\n\r\n	<tr><td>&nbsp;</td>\r\n	    <td align=\"right\"><em>Survey points earned:</em></td>\r\n	    <td align=\"center\"><span class=\"boxed\">{$surveyPointsEarned|default:0}</span></td></tr>\r\n\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.wellnessConnection}{$smarty.session.company.preferences.wellnessConnection}</ br><a href=\"?wellnessConnection\">Click Here</a>{else}</h3></td>\r\n		{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n\r\n{**** Wellness Connection Special Surveys \r\n\r\n<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=\"ico{$item.id}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"ico{$item.id}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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	</tr>\r\n\r\n\r\n\r\n\r\nEnd Wellness Connection Speacial Surveys *******}\r\n\r\n	{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\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		<tr><td><img class=\"icoStethescope\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>HRA Score</u>:</b>\r\n		    {if ($aHRA.dateTaken eq \"\") OR ($aHRA.dateTaken < $smarty.now|math:\"x - 31536000\")}<br /><a href=\"javascript://\" onclick=\"openSurvey(8);\">Available Now</a>{/if}</td>\r\n		    <td align=\"center\"><em>{$aHRA.pointsEarned}</em></td></tr>\r\n	{/if}\r\n\r\n	{if $vanity eq \"onai\" or $vanity eq \"mycompany\" or $vanity eq \"zions\" or $vanity eq \"zions2\"}\r\n	<tr><td><img class=\"icoWeights\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>Consumer Tools</u>:</b><br /><em>NEW<i>!</i></em></td>\r\n		    <td align=\"center\"><a href=\"?pg=consumer_tools\">Click Here</a></td></tr>\r\n	{/if}\r\n\r\n	{if 0 neq $totalIncentivePointAdjustments}\r\n	<br style=\"clear:left;\" />\r\n	<tr><td colspan=\"3\"><h3>Adjustments/Redemptions:</h3></td></tr>\r\n        {foreach from=$incentivePointAdjustments item=\"adjustment\" name=\"loopAdjustments\"}<tr><td nowrap>\r\n	<tr><td colspan=\"2\"><small><i>{$adjustment.dateAssigned|date_format2:\"m/d/Y\"}</i> - {$adjustment.comment}</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$adjustment.points}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Total:</em></td>\r\n		<td align=\"center\" nowrap=\"nowrap\"><span class=\"boxed\"><nobr>{$totalIncentivePointAdjustments|default:0}</nobr></span></td></tr>\r\n	{/if}\r\n\r\n	</table>\r\n\r\n</td><td valign=\"top\">\r\n	<h3>Feedback:</h3>\r\n	<table>\r\n	<tr><td>\r\n	<img class=\"icoNurse\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n	</td><td>\r\n	<ul>\r\n		<li><a href=\"javascript:viewSurveys();\">Review My Survey Taking History</a></li>\r\n		{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\r\n		<li><a href=\"?pg=HRAScoreInfo\">HRA Score Info</a></li>\r\n		{/if}\r\n	<ul>\r\n	</td></tr>\r\n	</table>\r\n	<br />\r\n\r\n	{if $aScales|@count gt 0} {* PARTICIPATION POINTS -- IF APPLICABLE *}\r\n	<table align=\"right\">\r\n	<tr><td colspan=\"3\"><h3>Participation Points:</h3></td></tr>\r\n        {foreach from=$aScales item=\"scale\" name=\"loopScales\"}<tr><td nowrap>\r\n	<tr><td>{$scale.name|niceText}</td>\r\n	    <td><small>({$scale.dateStart|date_format2:\"m/d/y\"} - {$scale.dateEnd|date_format2:\"m/d/y\"})</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$aScores[$scale.id]|number_format:\"1\"}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Participation points earned:</em></td>\r\n		<td align=\"right\"><span class=\"boxed\">{$totalParticipationPoints|default:0}</span></td></tr>\r\n	</table>\r\n	{/if}\r\n\r\n	</td></tr>\r\n</table>\r\n</blockquote>');
INSERT INTO `_page_history` VALUES (5074,272,0.93,'smarty','1','Working on forms, etc.',1146552057,2,'24.2.76.126','{stored_object name=$smarty.session.session_id|truncate:10:\"\" type=\"comp\" from=\"comp\" assign=\"comp\"}\r\n\r\n{if $smarty.request.confirmReset}{stored_object name=$smarty.session.session_id|truncate:10:\"\" type=\"comp\" destroy=\"true\"}{/if}\r\n\r\n<form name=\"compStartForm\" method=\"post\" style=\"margin:0px;\" action=\"index.php\">\r\n<input type=\"hidden\" name=\"pg\" value=\"{toc_next}\">\r\n<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n\r\n{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n<tr>\r\n<td valign=\"top\">\r\n<table border=0 cellpadding=0 cellspacing=0>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\">A. Competing for...</td><td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"p2p\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'p2p\');\">Pound for pound <i>(Weight lost)</i></a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"pctWt\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'pctWt\');\">Percent of body weight lost</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"minEx\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'minEx\');\">Total minutes exercised</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"disEx\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'disEx\');\">Total distance exercised</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"veg\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'veg\');\">Vegetable challenge</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td><small><input type=\"radio\" name=\"comp[type]\" id=\"comp[type]\" value=\"gain\" onclick=\"unBlock(\'step1_block_B\');\"> <a href=\"javascript:setCompType(\'gain\');\">Weight gained</a></small></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;\"></td></tr>\r\n</table>\r\n</td>\r\n<td valign=\"top\">\r\n<table border=0 cellpadding=0 cellspacing=0>\r\n<tr>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif\"></td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\">\r\n\r\nB. The competition name is...\r\n</td>\r\n<td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif\"></td>\r\n</tr>\r\n<tr>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td>\r\n<td>\r\n\r\n<div onclick=\"validateDiv(this);\" id=\"step1_block_B\" style=\"margin-top:-1px;margin-left:0px;border:solid 1px gray;background-color:silver;zIndex:100;position:absolute;filter:alpha(opacity=25);-moz-opacity:0.25;\">\r\n    <table border=0 cellspacing=0>\r\n    <tr>\r\n      <td><h3>Name:</h3></td>\r\n      <td><input type=\"text\" name=\"comp[tmp]\" id=\"comp[tmp]\" disabled=\"true\" onkeyup=\"unBlock(\'step1_block_C\');\"/></td>\r\n    </tr>\r\n    <tr>\r\n      <td valign=\"top\"><small><b>Examples:</b></small></td>\r\n      <td><small>&quot;The chubby family reunion&quot;<br />&quot;Company shape-up marathon&quot;<br />&quot;Super Summer Slimdown&quot;</small></td>\r\n    </tr>\r\n    </table>\r\n</div>\r\n\r\n\r\n    <table border=0 cellspacing=0>\r\n    <tr>\r\n      <td><h3>Name:</h3></td>\r\n      <td><input type=\"text\" name=\"comp[title]\" id=\"comp[title]\" onkeyup=\"unBlock(\'step1_block_C\');\"/></td>\r\n    </tr>\r\n    <tr>\r\n      <td valign=\"top\"><small><b>Examples:</b></small></td>\r\n      <td><small>&quot;The chubby family reunion&quot;<br />&quot;Company shape-up marathon&quot;<br />&quot;Super Summer Slimdown&quot;</small></td>\r\n    </tr>\r\n    </table>\r\n\r\n</td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td>\r\n</tr>\r\n<tr><td style=\"height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;\"></td></tr>\r\n</table>\r\n    <br/>\r\n    <div style=\"border:solid 1px black;width:94%;height:85px;\">\r\n      test\r\n    </div>\r\n</td>\r\n<td valign=\"top\">\r\n<table border=0 cellpadding=0 cellspacing=0>\r\n<tr>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif\"></td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\">\r\n\r\nC. Who\'s competing...\r\n</td>\r\n<td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif\"></td>\r\n</tr>\r\n<tr>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td>\r\n<td>\r\n\r\n<div onclick=\"validateDiv(this);\" id=\"step1_block_C\" style=\"margin-top:-1px;margin-left:-10px;border:solid 1px gray;background-color:silver;zIndex:100;position:absolute;filter:alpha(opacity=25);-moz-opacity:0.25;\">\r\n    <table border=0 cellpaddin=0 cellspacing=0>\r\n      <tr>\r\n	<td colspan=\"2\">\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	     <tr>\r\n	       <td colspan=2><li style=\"color:#cccccc\">Invite your friends</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small style=\"color:#cccccc\">\r\n		   My friend\'s Name:\r\n                 </small>\r\n	       </td>\r\n	       <td>\r\n	         &nbsp;&nbsp;&nbsp;<input type=\"text id=\"tmp1\" name=\"temp1\" style=\"width:110px;\" disabled />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small style=\"color:#cccccc\">\r\n		   My friend\'s Email:\r\n	         </small>\r\n	       </td>\r\n	       <td>\r\n	          &nbsp;&nbsp;&nbsp;<input type=\"text id=\"tmp1\" name=\"temp1\" style=\"width:110px;\" disabled/>\r\n               </td>\r\n             </tr>\r\n             <tr>\r\n	       <td colspan=\"2\" align=\"right\">\r\n	         <small style=\"color:#cccccc\">\r\n		   <span>\r\n                     Add more\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	</td>\r\n      </tr>\r\n      <tr><td colspan=\"2\"><li style=\"color:#cccccc\">Let them know with an email...</li></td></tr>\r\n      <tr>\r\n        <td valign=\"top\" colspan=2>\r\n	  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	      <tr>\r\n		 <td valign=\"top\">\r\n		    <small style=\"color:#cccccc\">\r\n			<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n			  <tr><td>&nbsp;&nbsp;&nbsp;<input type=\"radio\" value=\"kind\" name=\"tmp2\"/> <span style=\"color:#cccccc;\">Kind Message</span></td></tr>\r\n			  <tr><td>&nbsp;&nbsp;&nbsp;<input type=\"radio\" value=\"smack\" name=\"tmp2\"/> <span style=\"color:#cccccc;\">Trash Talking Message</span></td></tr>\r\n			  <tr><td>&nbsp;&nbsp;&nbsp;<input type=\"radio\" value=\"challenge\" name=\"tmp2\"/> <span style=\"color:#cccccc;\">Motivational Message</span></td></tr>\r\n			  <tr><td>&nbsp;&nbsp;&nbsp;<input type=\"radio\" value=\"custom\" name=\"tmp2\"/> <span style=\"color:#cccccc;\">Make Your Own Message</span></td></tr>\r\n                        </table>\r\n		    </small>\r\n		 </td>\r\n		 <td valign=\"top\" id=\"invateHolder\">\r\n		    <div id=\"tmp3\" style=\"border-bottom:solid 1px #CCC;border-left:solid 1px #CCC;padding-right:5px;visibility:hidden;\">\r\n			<small style=\"color:#cccccc\">\r\n			   <a href=\"javascript:setInviteWeight(\'heavy\');\">Heavy</a><br />\r\n			   <a href=\"javascript:setInviteWeight(\'medium\');\">Medium</a><br />\r\n			   <a href=\"javascript:setInviteWeight(\'light\');\">Light</a><br />\r\n			</small>\r\n		    </div>\r\n		</td>\r\n	     </tr>\r\n	  </table>\r\n        </td>\r\n     </tr>\r\n     </table>\r\n</div>\r\n\r\n    <table border=0 cellpaddin=0 cellspacing=0>\r\n      <tr>\r\n	<td colspan=\"2\">\r\n	  <div id=\'enterFriendNameDiv\' style=\'display:block;\'>\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	     <tr>\r\n	       <td colspan=2><li>Invate your friends</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Name:\r\n                 </small>\r\n	       </td>\r\n	       <td>\r\n	         <input type=\"text id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Email:\r\n	         </small>\r\n	       </td>\r\n	       <td>\r\n		  <input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td colspan=\"2\" align=\"right\">\r\n	         <small>\r\n		   <span onclick=\"extraCompetitors(\'open\');\" style=\"cursor:pointer;\">\r\n                     Add more\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	  </div>\r\n	  <div id=\"myEnteredFriendsDiv\" style=\"display:none;\">\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n	     <tr>\r\n	       <td><li>My Competitors:</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"left\" id=\"competitorListHolder\" style=\"padding-left:15px\">\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   <span onclick=\"editCompetitors();\" style=\"cursor:pointer;\">\r\n                     Edit my competitors\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	  </div>\r\n	</td>\r\n      </tr>\r\n      <tr><td colspan=\"2\"><li>Let them know with an email...</li></td></tr>\r\n      <tr>\r\n        <td valign=\"top\" colspan=2>\r\n	  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	      <tr>\r\n		 <td valign=\"top\">\r\n		    <small>\r\n			<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n			  <tr><td id=\'kind\'><input type=\"radio\" value=\"kind\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'kind\');\"/> <a href=\"javascript:setInviteStyle(\'kind\');\">Kind Message</a></td></tr>\r\n			  <tr><td id=\'smack\'><input type=\"radio\" value=\"smack\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'smack\');\"/> <a href=\"javascript:setInviteStyle(\'smack\');\">Trash Talking Message</a></td></tr>\r\n			  <tr><td id=\'challenge\'><input type=\"radio\" value=\"challenge\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'challenge\');\" /> <a href=\"javascript:setInviteStyle(\'challenge\');\">Challenge</a></td></tr>\r\n			  <tr><td id=\'custom\'><input type=\"radio\" value=\"custom\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'custom\');\"/> <a href=\"javascript:setInviteStyle(\'custom\');\">Make Your Own</a></td></tr>\r\n                        </table>\r\n		    </small>\r\n		 </td>\r\n		 <td valign=\"top\" id=\"invateHolder\">\r\n		    <div id=\"InvateW\" style=\"border-bottom:solid 1px #CCC;border-left:solid 1px #CCC;padding-right:5px;visibility:hidden;\">\r\n			<small>\r\n			   <input type=\"radio\" value=\"heavy\" name=\"comp[invite_subtype]\"  onclick=\"displayLetter(\'{$vanity}\')\" /> <a href=\"javascript:setInviteWeight(\'heavy\');\">Heavy</a><br />\r\n			   <input type=\"radio\" value=\"medium\" name=\"comp[invite_subtype]\" onclick=\"displayLetter(\'{$vanity}\')\" /> <a href=\"javascript:setInviteWeight(\'medium\');\">Medium</a><br />\r\n			   <input type=\"radio\" value=\"light\" name=\"comp[invite_subtype]\" onclick=\"displayLetter(\'{$vanity}\')\" /> <a href=\"javascript:setInviteWeight(\'light\');\">Light</a><br />\r\n			</small>\r\n		    </div>\r\n		</td>\r\n	     </tr>\r\n	  </table>\r\n        </td>\r\n     </tr>\r\n     </table>\r\n\r\n\r\n</td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td>\r\n</tr>\r\n<tr><td style=\"height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;\"></td></tr>\r\n</table>\r\n</td>\r\n<td>\r\n</td>\r\n</tr>\r\n</table>\r\n<br />\r\n<table border=\"0\" cellpadding=0 cellspacing=0 width=\"100%\">\r\n<tr>\r\n<td width=\"10px\" style=\"background-image:url({$skinFolder}images/ehc/containers/note/top.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/note/topLeftCorner.gif\"></td>\r\n<td style=\"background-image:url({$skinFolder}images/ehc/containers/note/top.gif);background-repeat:repeat-x;\"></td>\r\n<td width=\"15px\" style=\"background-image:url({$skinFolder}images/ehc/containers/note/top.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/note/topRightCorner.gif\"></td>\r\n</tr>\r\n<tr>\r\n<td width=\"10px\" style=\"background-image:url({$skinFolder}images/ehc/containers/note/left.gif);background-repeat:repeat-y;\"></td>\r\n   <td>\r\n      <!-- <iframe src=\"\" id=\"letterHolder\" name=\"letterHolder\" style=\"width:100%;height:410px;\" scrollbars=\"no\" frameborder=\"0\"></iframe> -->\r\n      <div id=\"letterHolder\" name=\"letterHolder\" style=\"width:100%;height:410px;border:solid 1px white;\"></div>\r\n   </td>\r\n<td width=\"10px\" style=\"background-image:url({$skinFolder}images/ehc/containers/note/right.gif);background-repeat:repeat-y;\"></td>\r\n</tr>\r\n<tr><td style=\"height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;\"></td></tr>\r\n</table>\r\n{* <iframe src=\"?pg=compCreate/inviteFrame\" style=\"width:100%;height:410px;\" scrollbars=\"no\" frameborder=\"0\"></iframe> *}\r\n\r\n<div id=\"invite-div\"></div>\r\n<br />\r\n\r\n<div align=\"right\">\r\n  <input type=\"image\" src=\"{$skinFolder}images/btn_next.gif\" alt=\"Next\" border=\"0\" />\r\n</div>\r\n\r\n<div id=\"myCompetitors\" style=\"width:300px;background-color:white;zIndex:100;position:absolute;display:none;top:-70px;left:300px;border:solid 1px #CCC;filter: alpha(opacity=85)\">\r\n  <center>\r\n   <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"95%\">\r\n      <tr><td align=\"right\" valign=\"top\" style=\"height:5px\"><small><span style=\"cursor:pointer;\" onclick=\"extraCompetitors(\'close\');\">close window</span><small></td></tr>\r\n      <tr><td style=\"border-bottom:solid 1px #CCC;\"><h2>More Competitors...</td></tr>\r\n      <tr>\r\n         <td align=\"center\">\r\n	    <table id=\"competitorsTable\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"90%\">\r\n                <tr>\r\n		  <td></td>\r\n		  <td align=\"center\" valign=\"bottom\">Name</td>\r\n                  <td align=\"center\" valign=\"bottom\">Email</td>\r\n                </tr>\r\n	        <tr>\r\n		  <td>2.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>3.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>4.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>5.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>6.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>7.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>8.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>9.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>10.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>11.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n		<tr>\r\n		  <td colspan=\"3\" align=\"right\"><small><span style=\"cursor:pointer;\" onclick=\'addMoreCompetitors();\'>Add More Lines</span></small></td>\r\n		</tr>\r\n            </table>\r\n         </td>\r\n      </tr>\r\n      <tr>\r\n	<td align=\"right\" style=\"border-top:solid 1px #CCC;\"><img style=\"cursor:pointer;\" onclick=\"addingCompetitors();\" src=\"{$skinFolder}images/btn_next.gif\" alt=\"Add\" border=\"0\" /></td>\r\n      </tr>\r\n   </table>\r\n  </center>\r\n</div>\r\n\r\n</form>\r\n\r\n{stored_object_fill_form object=$comp name=\"comp\"}\r\n\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/js-get-data.js\"></script>\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/AJAX.js\"></script>\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/NewComp.js\"></script>\r\n\r\n<script language=\"JavaScript\">\r\n	\r\n        //jsGetData(\'?pg=jsGetData\',\'invite-div\', \'madlib.form\', \'&compType=friends&inviteType=smack\');\r\n\r\n	var examples = Array();\r\n	{foreach from=$examples key=\"key\" item=\"example\"}\r\n	examples[{$key}] = \'{eval var=$example.body|addslashes|replace:\"\\r\":\"\"|replace:\"\\n\":\"\\\\n\"}\';\r\n	{/foreach}\r\n	\r\n	{literal}\r\n\r\n\r\n	{/literal}\r\n</script>'),(5073,273,0.43,'smarty','1','Enabling stored_object',1146551734,2,'24.2.76.126','{stored_object name=$smarty.session.session_id|truncate:10:\"\" type=\"comp\" from=\"comp\" assign=\"comp\"}\r\n{if $smarty.request.confirmReset}{stored_object name=$smarty.session.session_id|truncate:10:\"\" type=\"comp\" destroy=\"true\"}{/if}\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/NewComp.js\"></script>\r\n\r\n{toc_next assign=\"next\"}\r\n{toc_prev assign=\"prev\"}\r\n\r\n<form name=\"compStartForm\" method=\"post\" style=\"margin:0px;\" action=\"index.php\">\r\n<input type=\"hidden\" name=\"pg\" value=\"{$next.pageName}\">\r\n<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n\r\n{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n{if $comp.startDate}\r\n	{assign var=\"startDate\" value=$comp.startDate}\r\n{else}\r\n	{assign var=\"startDate\" value=$smarty.now}\r\n{/if}\r\n{if $comp.endDate}\r\n	{assign var=\"endDate\" value=$comp.endDate}\r\n{else}\r\n	{assign var=\"endDate\" value=$smarty.now|math:\"x+5184000\"}  {* Now + 2 Months *}\r\n{/if}\r\n\r\n<table border=0 cellpadding=0 cellspacing=0>\r\n<tr>\r\n<td width=\"50%\" style=\"padding-top:10px\">\r\n<!-- A CONTENT -->\r\n<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif\"></td><td colspan=2 style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\">A. When are we starting...</td><td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td><td nowrap><font size=-2>Choose a starting date:</font></td><td nowrap><font size=-2>Choose an end date:</font></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td>\r\n	<td nowrap>\r\n        	{* <iframe name=\"frameCalendar\" height=\"144\" width=\"100%\" src=\"?pg=jscalendar&id=0&year={$startDate|date_format2:\"Y\"}&month={$startDate|date_format2:\"m\"}&day={$startDate|date_format2:\"j\"}\" scrolling=\"No\" frameborder=\"image/gif\"></iframe> *}\r\n		<iframe name=\"frameCalendar\" height=\"144\" width=\"100%\" src=\"?pg=jscalendar&parentForm=compStartForm&targetName=comp[startDate]&targetViewableName=comp[startDateViewable]&id=0&year={$startDate|date_format2:\"Y\"}&month={$startDate|date_format2:\"m\"}&day={$startDate|date_format2:\"j\"}\" scrolling=\"No\" frameborder=\"image/gif\"></iframe>\r\n	</td>\r\n        <td nowrap style=\"border-left:solid 1px gray;\">\r\n        	{* <iframe name=\"frameCalendar2\" height=\"144\" width=\"100%\" src=\"?pg=jscalendar&id=1&year={$endDate|date_format2:\"Y\"}&month={$endDate|date_format2:\"m\"}&day={$endDate|date_format2:\"j\"}\" scrolling=\"No\" frameborder=\"image/gif\"></iframe> *}\r\n		<iframe name=\"frameCalendar2\" height=\"144\" width=\"100%\" src=\"?pg=jscalendar&parentForm=compStartForm&targetName=comp[endDate]&targetViewableName=comp[endDateViewable]&id=1&year={$endDate|date_format2:\"Y\"}&month={$endDate|date_format2:\"m\"}&day={$endDate|date_format2:\"j\"}\" scrolling=\"No\" frameborder=\"image/gif\"></iframe>\r\n        </td>\r\n	<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr ><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td>\r\n       <td nowrap>\r\n	     <font size=-1>Starting on: </font>\r\n             <input type=\"text\" style=\"border:solid 1px white;width:90px;\" disabled=\"disabled\" name=\"comp[startDateViewable]\" value=\"{if not $comp.startDate}Click a Date {else}{$comp.startDate|date_format2:\"M j, Y\"}{/if}\">\r\n	     <input id=\"comp_startDate\" type=\"hidden\" name=\"comp[startDate]\" value=\"\">\r\n       </td>\r\n       <td nowrap>\r\n             <font size=-1>Ending on: </font><input style=\"border:solid 1px white;width:90px;\" type=\"text\" disabled=\"disabled\" name=\"comp[endDateViewable]\" value=\"{if not $comp.endDate}Click a Date {else}{$comp.endDate|date_format2:\"M j, Y\"}{/if}\">\r\n   	     <input id=\"comp_endDate\" type=\"hidden\" name=\"comp[endDate]\" value=\"\">\r\n       </td>\r\n      <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td></tr>\r\n   <tr><td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif\"></td><td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\" colspan=2></td><td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif\"></td></tr>\r\n</table>\r\n<!-- END OF A CONTENT -->\r\n</td>\r\n<td valign=top style=\"padding-top:10px;padding-left:20px;\">\r\n<!-- B CONTENT -->\r\n<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n   <tr>\r\n	<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif\"></td>\r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\">B. And the winner takes home ...</td>\r\n        <td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif\"></td>\r\n   </tr>\r\n   <tr> \r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td>\r\n        <td nowrap>\r\n<!-- Div to Block content -->\r\n<div onclick=\"validateDiv(this);\" id=\"step2_block_B\" style=\"margin-top:-1px;margin-left:-13px;border:solid 1px gray;background-color:silver;zIndex:100;position:absolute;filter:alpha(opacity=25); width:107%;\">\r\n<table border=0 cellpadding=0 cellspacing=0>\r\n  <tr>\r\n  <td style=\'padding-left:13px\'><h2><font color=\'silver\'>Prize Method:</font></h2></td>\r\n  <td><select name=\"tmp5\" disabled>\r\n        <option value=\"\">Cash Settlement</option>\r\n      </select>\r\n  </td>\r\n  </tr>\r\n  <tr>\r\n  <td style=\'padding-left:13px;padding-top:3px;\'><b><font color=\'silver\'>Type:</font></b></td>\r\n  <td></td>\r\n  </tr>\r\n  <tr>\r\n  <td colspan=\"2\" align=\"right\"><img src=\"blank.gif\" width=\"200\" height=\"100\" alt=\"\" border=\"0\" /></td>\r\n  </tr>\r\n</table>\r\n\r\n</div>\r\n<!-- end of DIV -->\r\n<table border=0 cellpadding=0 cellspacing=0>\r\n  <tr>\r\n  <td><h2>Prize Method:</h2></td>\r\n  <td><select name=\"comp[prize_method]\">\r\n        <option value=\"\">Cash Settlement</option>\r\n      </select>\r\n  </td>\r\n  </tr>\r\n  <tr>\r\n  <td><b>Type:</b></td>\r\n  <td><input type=\"text\" value=\"$50.00\" /></td>\r\n  </tr>\r\n  <tr>\r\n  <td colspan=\"2\" align=\"right\"><img src=\"blank.gif\" width=\"200\" height=\"100\" alt=\"\" border=\"0\" /></td>\r\n  </tr>\r\n</table>\r\n        </td>\r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td>\r\n   </tr>\r\n   <tr>\r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif\"></td>\r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"></td>\r\n        <td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif\"></td>\r\n   </tr>\r\n</table>\r\n\r\n<!-- END OF B CONTENT -->\r\n</td>\r\n</tr>\r\n</table>\r\n\r\n\r\n<script language=\"javascript\">\r\n	validateDates();\r\n	{literal}\r\n		\r\n	{/literal}\r\n</script>\r\n\r\n{stored_object_fill_form object=$comp name=\"comp\"}\r\n\r\n<div align=\"right\">\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\" onclick=\"pg.value=\'{$next.pageName}\';\">{/if}	\r\n</div>\r\n\r\n</form>'),(4652,273,0.10,'smarty','0','Page created.',1135916196,3,'24.2.76.126',''),(4653,273,0.11,'smarty','0','Page created.',1135916244,3,'24.2.76.126','<h1>Step 2</h1>'),(5075,275,0.17,'smarty','0','Page created.',1146552095,2,'24.2.76.126','<form name=\"compStartForm\" method=\"post\" style=\"margin:0px;\" action=\"index.php\">\r\n\r\n{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n   <tr>\r\n	<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif\"></td>\r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\">A. Competition Fee Payment</td>\r\n        <td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif\"></td>\r\n   </tr>\r\n   <tr> \r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td>\r\n        <td nowrap>\r\n\r\n<b>Competition title</b><br />\r\nEtc.<br />\r\netc.<br />\r\n\r\n<table width=\"100%\">\r\n<tr>\r\n  <td valign=\"top\"><b>Billing Information:</b>\r\n	<p>Enter the billing information for the credit card owner.<br />\r\n	<small>(* indicates a required field)</small></p>\r\n	\r\n	<div id=\"billInfo\" style=\"text-align:right;\">\r\n	*First Name:\r\n	<input type=\"text\" name=\"bill[firstname]\" value=\"{$smarty.request.bill.firstname|default:$userInfo.firstName}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n	*Last Name:\r\n	<input type=\"text\" name=\"bill[lastname]\" value=\"{$smarty.request.bill.lastname|default:$userInfo.lastName}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	Company:\r\n	<input type=\"text\" name=\"bill[company]\" value=\"{$smarty.request.bill.company|default:$userInfo.company}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	*Address:\r\n	<input type=\"text\" name=\"bill[address1]\" value=\"{$smarty.request.bill.address1|default:$userInfo.address1}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n	Line 2:\r\n	<input type=\"text\" name=\"bill[address2]\" value=\"{$smarty.request.bill.address2|default:$userInfo.address2}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	*City:\r\n	<input type=\"text\" name=\"bill[city]\" value=\"{$smarty.request.bill.city|default:$userInfo.city}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	*State, *Zip:\r\n	<input type=\"text\" name=\"bill[state]\" value=\"{$smarty.request.bill.state|default:$userInfo.state}\" class=\"textInput\" style=\"width:30px;\" maxlength=\"2\" />\r\n	<input type=\"text\" name=\"bill[zip]\" value=\"{$smarty.request.bill.zip|default:$userInfo.zip}\" class=\"textInput\" style=\"width:50px;\" /><br />\r\n\r\n	*Country:\r\n	<input type=\"text\" name=\"bill[country]\" value=\"{$smarty.request.bill.country|default:$userInfo.country}\" class=\"textInput\" style=\"width:200px;\" maxlength=\"30\" /><br />\r\n\r\n	*Phone:<small>(xxx-xxx-xxxx)\r\n	<input type=\"text\" name=\"bill[phone]\" value=\"{$smarty.request.bill.phone|default:$userInfo.phone}\" class=\"textInput\" style=\"width:200px;\" maxlength=\"80\" /><br />\r\n	</div>\r\n</div>\r\n</td>\r\n  <td valign=\"top\"><b>Payment Information:</b>\r\n\r\n	<script language=\"javascript\">{literal}\r\n	function verifyFormatCcnum(obj) {\r\n		if (obj.value.match(/[^\\d]/)) {\r\n			alert(\'The Credit Card Number should contain no dashes or spaces.\\n\\nI.E.  4007000000027\');\r\n			obj.value = obj.value.replace(/[^\\d]/g, \'\');\r\n			obj.focus();\r\n		}\r\n	}\r\n	function verifyFormatCcexp(obj) {\r\n		if (obj.value.match(/[^\\d]/)) {\r\n			alert(\'The format for Credit Card expiration date is MMYY with no slash.\\n\\nI.E.  0606  for June, 2006\');\r\n			obj.value = obj.value.replace(/[^\\d]/g, \'\');\r\n			obj.focus();\r\n		}\r\n	}\r\n	{/literal}</script>\r\n\r\n        <div style=\"text-align:right;\">\r\n	Payment Method:\r\n	<select name=\"bill[paymentMethod]\" size=\"1\">\r\n		<option value=\"visa\"{if $smarty.request.bill.paymentMethod eq \"visa\"} selected{/if}>Visa</option>\r\n		<option value=\"mastercard\"{if $smarty.request.bill.paymentMethod eq \"mastercard\"} selected{/if}>Mastercard</option>\r\n		<option value=\"american express\"{if $smarty.request.bill.paymentMethod eq \"american express\"} selected{/if}>American Express</option>\r\n		<option value=\"discover\"{if $smarty.request.bill.paymentMethod eq \"discover\"} selected{/if}>Discover</option>\r\n	</select><br />\r\n\r\n	Card Number:\r\n	<input type=\"text\" name=\"bill[ccnum]\" value=\"\" class=\"textInput\" style=\"width:200px;\" onchange=\"verifyFormatCcnum(this);\" onkeyup=\"verifyFormatCcnum(this);\" /><br />\r\n\r\n	Expiration Date: <small>(MMYY)</small>\r\n	<input type=\"text\" name=\"bill[ccexp]\" value=\"\" class=\"textInput\" maxlength=\"4\" style=\"width:50px;\" onchange=\"verifyFormatCcexp(this);\" onkeyup=\"verifyFormatCcexp(this);\" /><br />\r\n        </div>\r\n</td>\r\n</tr>\r\n</table>\r\n        </td>\r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td>\r\n   </tr>\r\n   <tr>\r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif\"></td>\r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\" ></td>\r\n        <td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif\"></td>\r\n   </tr>\r\n</table>\r\n\r\n</form>'),(5076,275,0.18,'smarty','1','Page created.',1146552194,2,'24.2.76.126','{stored_object name=$smarty.session.session_id|truncate:10:\"\" type=\"comp\" from=\"comp\" assign=\"comp\"}\r\n{if $smarty.request.confirmReset}{stored_object name=$smarty.session.session_id|truncate:10:\"\" type=\"comp\" destroy=\"true\"}{/if}\r\n\r\n{toc_next assign=\"next\"}\r\n{toc_prev assign=\"prev\"}\r\n\r\n<form name=\"compStartForm\" method=\"post\" style=\"margin:0px;\" action=\"index.php\">\r\n<input type=\"hidden\" name=\"pg\" value=\"{$next.pageName}\">\r\n<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n\r\n{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n   <tr>\r\n	<td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif\"></td>\r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;\">A. Competition Fee Payment</td>\r\n        <td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif\"></td>\r\n   </tr>\r\n   <tr> \r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;\"></td>\r\n        <td nowrap>\r\n\r\n<b>Competition title</b><br />\r\nEtc.<br />\r\netc.<br />\r\n\r\n<table width=\"100%\">\r\n<tr>\r\n  <td valign=\"top\"><b>Billing Information:</b>\r\n	<p>Enter the billing information for the credit card owner.<br />\r\n	<small>(* indicates a required field)</small></p>\r\n	\r\n	<div id=\"billInfo\" style=\"text-align:right;\">\r\n	*First Name:\r\n	<input type=\"text\" name=\"bill[firstname]\" value=\"{$smarty.request.bill.firstname|default:$userInfo.firstName}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n	*Last Name:\r\n	<input type=\"text\" name=\"bill[lastname]\" value=\"{$smarty.request.bill.lastname|default:$userInfo.lastName}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	Company:\r\n	<input type=\"text\" name=\"bill[company]\" value=\"{$smarty.request.bill.company|default:$userInfo.company}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	*Address:\r\n	<input type=\"text\" name=\"bill[address1]\" value=\"{$smarty.request.bill.address1|default:$userInfo.address1}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n	Line 2:\r\n	<input type=\"text\" name=\"bill[address2]\" value=\"{$smarty.request.bill.address2|default:$userInfo.address2}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	*City:\r\n	<input type=\"text\" name=\"bill[city]\" value=\"{$smarty.request.bill.city|default:$userInfo.city}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	*State, *Zip:\r\n	<input type=\"text\" name=\"bill[state]\" value=\"{$smarty.request.bill.state|default:$userInfo.state}\" class=\"textInput\" style=\"width:30px;\" maxlength=\"2\" />\r\n	<input type=\"text\" name=\"bill[zip]\" value=\"{$smarty.request.bill.zip|default:$userInfo.zip}\" class=\"textInput\" style=\"width:50px;\" /><br />\r\n\r\n	*Country:\r\n	<input type=\"text\" name=\"bill[country]\" value=\"{$smarty.request.bill.country|default:$userInfo.country}\" class=\"textInput\" style=\"width:200px;\" maxlength=\"30\" /><br />\r\n\r\n	*Phone:<small>(xxx-xxx-xxxx)\r\n	<input type=\"text\" name=\"bill[phone]\" value=\"{$smarty.request.bill.phone|default:$userInfo.phone}\" class=\"textInput\" style=\"width:200px;\" maxlength=\"80\" /><br />\r\n	</div>\r\n</div>\r\n</td>\r\n  <td valign=\"top\"><b>Payment Information:</b>\r\n\r\n	<script language=\"javascript\">{literal}\r\n	function verifyFormatCcnum(obj) {\r\n		if (obj.value.match(/[^\\d]/)) {\r\n			alert(\'The Credit Card Number should contain no dashes or spaces.\\n\\nI.E.  4007000000027\');\r\n			obj.value = obj.value.replace(/[^\\d]/g, \'\');\r\n			obj.focus();\r\n		}\r\n	}\r\n	function verifyFormatCcexp(obj) {\r\n		if (obj.value.match(/[^\\d]/)) {\r\n			alert(\'The format for Credit Card expiration date is MMYY with no slash.\\n\\nI.E.  0606  for June, 2006\');\r\n			obj.value = obj.value.replace(/[^\\d]/g, \'\');\r\n			obj.focus();\r\n		}\r\n	}\r\n	{/literal}</script>\r\n\r\n        <div style=\"text-align:right;\">\r\n	Payment Method:\r\n	<select name=\"bill[paymentMethod]\" size=\"1\">\r\n		<option value=\"visa\"{if $smarty.request.bill.paymentMethod eq \"visa\"} selected{/if}>Visa</option>\r\n		<option value=\"mastercard\"{if $smarty.request.bill.paymentMethod eq \"mastercard\"} selected{/if}>Mastercard</option>\r\n		<option value=\"american express\"{if $smarty.request.bill.paymentMethod eq \"american express\"} selected{/if}>American Express</option>\r\n		<option value=\"discover\"{if $smarty.request.bill.paymentMethod eq \"discover\"} selected{/if}>Discover</option>\r\n	</select><br />\r\n\r\n	Card Number:\r\n	<input type=\"text\" name=\"bill[ccnum]\" value=\"\" class=\"textInput\" style=\"width:200px;\" onchange=\"verifyFormatCcnum(this);\" onkeyup=\"verifyFormatCcnum(this);\" /><br />\r\n\r\n	Expiration Date: <small>(MMYY)</small>\r\n	<input type=\"text\" name=\"bill[ccexp]\" value=\"\" class=\"textInput\" maxlength=\"4\" style=\"width:50px;\" onchange=\"verifyFormatCcexp(this);\" onkeyup=\"verifyFormatCcexp(this);\" /><br />\r\n        </div>\r\n</td>\r\n</tr>\r\n</table>\r\n        </td>\r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;\"></td>\r\n   </tr>\r\n   <tr>\r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\"><img src=\"{$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif\"></td>\r\n        <td style=\"background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;\" ></td>\r\n        <td><img src=\"{$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif\"></td>\r\n   </tr>\r\n</table>\r\n\r\n{stored_object_fill_form object=$comp name=\"comp\"}\r\n\r\n<div align=\"right\">\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\" onclick=\"pg.value=\'{$next.pageName}\';\">{/if}	\r\n</div>\r\n\r\n</form>'),(4656,273,0.12,'smarty','0','Page created.',1135916802,3,'24.2.76.126','{inclue_php file=\"layouts/comp_create_navbar.tpl\"}\r\n\r\n<form method=\"post\" action=\"index.php\">\r\n\r\n<table width=\"100%\">\r\n<tr>\r\n  <td><h2>Prize Method:</h2></td>\r\n  <td><select name=\"comp[prize_method]\">\r\n        <option value=\"\">Cash Settlement</option>\r\n      </select></td>\r\n  <td rowspan=\"2\"><img src=\"blank.gif\" width=\"200\" height=\"100\" alt=\"\" border=\"1\" /></td>\r\n</tr>\r\n<tr>\r\n  <td><b>Type:</b></td>\r\n  <td><input type=\"text\" value=\"$50.00\" /></td>\r\n</tr>\r\n</table>\r\n\r\n\r\n</form>'),(4657,273,0.13,'smarty','0','Page created.',1135916912,3,'24.2.76.126','{inclue_php file=\"layouts/comp_create_navbar.tpl\"}\r\n\r\n<form method=\"post\" action=\"index.php\">\r\n\r\n<table width=\"100%\">\r\n<tr>\r\n  <td><h2>Prize Method:</h2></td>\r\n  <td><select name=\"comp[prize_method]\">\r\n        <option value=\"\">Cash Settlement</option>\r\n      </select></td>\r\n  <td rowspan=\"2\"><img src=\"blank.gif\" width=\"200\" height=\"100\" alt=\"\" border=\"1\" /></td>\r\n</tr>\r\n<tr>\r\n  <td><b>Type:</b></td>\r\n  <td><input type=\"text\" value=\"$50.00\" /></td>\r\n</tr>\r\n</table>\r\n\r\n<a name=\"invitations\" />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'enterEmails\', \'hideEnterEmails\', \'showHide\');\"><img id=\"enterEmails_img\" src=\"./img/blank.gif\" class=\"showHide_{if $newcomp.hideEnterEmails}off{else}on{/if}\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n	Invite Some Competitors:</h2>\r\n	<input type=\"hidden\" id=\"hideEnterEmails\" name=\"newcomp[hideEnterEmails]\" value=\"{$newcomp.hideEnterEmails|default:\"0\"}\">\r\n\r\n<div>Enter a name and email address for each person you would like to invite into this competition. If this is a company wide competition simply enter EMPLOYEES as the name and the appropriate email address to reach them. If you did not create a letter to send, then SKIP this section.<br /><br /></div>\r\n\r\n<div id=\"enterEmails\" style=\"display:{if $newcomp.hideEnterEmails eq \"1\"}none{else}block{/if};\">\r\n	<div class=\"pixel underline2\">&nbsp;</div>\r\n	<div id=\"inviteList\">\r\n	<table align=\"center\" style=\"margin:10px;\">\r\n	<tr>\r\n		<td><div>&nbsp;</div></td>\r\n		<td><h3 class=\"withBG\">Name</h2></td>\r\n		<td><h3 class=\"withBG\">E-Mail</h2></td>\r\n		<td><h3 class=\"withBG\">Your Relation</h2></td>\r\n	</tr> \r\n	{section name=\"contactLoop\" loop=$addCount}  {* $addCount is assigned by the handler... *}\r\n	<tr>\r\n		<td><div>#{$smarty.section.contactLoop.iteration}</div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][name][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" style=\"width:200px;\" name=\"newcomp[invite][email][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][relation][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n	</tr>\r\n	{/section}\r\n	</table>\r\n	</div>\r\n	\r\n	<div align=\"right\" style=\"margin-right:30px;\">\r\n		<a href=\"javascript://\" onclick=\"addEmailRows();return false;\">&gt; Click to add more now! &lt;</a>\r\n	</div>\r\n</div>\r\n<div class=\"pixel underline2\">&nbsp;</div>\r\n\r\n\r\n<script language=\"javascript\">\r\n	var addCount = {$addCount};\r\n	{literal}\r\n	function addEmailRows() {\r\n		addCount++;\r\n		var obj = document.getElementById(\'inviteList\');\r\n		var html = obj.innerHTML;\r\n		html = html.replace(/\\<\\/TABLE\\>/i, \'\');\r\n		html += \'<tr><td><div>#\'+addCount+\'</div></td><td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][name][\'+addCount+\']\"></div></td><td><div><input type=\"text\" class=\"textInput\" style=\"width:200px;\" name=\"newcomp[invite][email][\'+addCount+\']\"></div></td><td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][relation][\'+addCount+\']\"></div></td></tr></table>\';\r\n		obj.innerHTML = html;\r\n	}\r\n	{/literal}\r\n</script>\r\n\r\n{stored_object_fill_form object=$newcomp name=\"newcomp\"}\r\n\r\n<div class=\"hBox\" style=\"text-align:right;\">\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\" onclick=\"pg.value=\'{$next.pageName}\';\">{/if}	\r\n</div>\r\n\r\n</form>'),(4658,273,0.14,'smarty','0','Page created.',1135916935,3,'24.2.76.126','{include_php file=\"layouts/comp_create_navbar.tpl\"}\r\n\r\n<form method=\"post\" action=\"index.php\">\r\n\r\n<table width=\"100%\">\r\n<tr>\r\n  <td><h2>Prize Method:</h2></td>\r\n  <td><select name=\"comp[prize_method]\">\r\n        <option value=\"\">Cash Settlement</option>\r\n      </select></td>\r\n  <td rowspan=\"2\"><img src=\"blank.gif\" width=\"200\" height=\"100\" alt=\"\" border=\"1\" /></td>\r\n</tr>\r\n<tr>\r\n  <td><b>Type:</b></td>\r\n  <td><input type=\"text\" value=\"$50.00\" /></td>\r\n</tr>\r\n</table>\r\n\r\n<a name=\"invitations\" />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'enterEmails\', \'hideEnterEmails\', \'showHide\');\"><img id=\"enterEmails_img\" src=\"./img/blank.gif\" class=\"showHide_{if $newcomp.hideEnterEmails}off{else}on{/if}\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n	Invite Some Competitors:</h2>\r\n	<input type=\"hidden\" id=\"hideEnterEmails\" name=\"newcomp[hideEnterEmails]\" value=\"{$newcomp.hideEnterEmails|default:\"0\"}\">\r\n\r\n<div>Enter a name and email address for each person you would like to invite into this competition. If this is a company wide competition simply enter EMPLOYEES as the name and the appropriate email address to reach them. If you did not create a letter to send, then SKIP this section.<br /><br /></div>\r\n\r\n<div id=\"enterEmails\" style=\"display:{if $newcomp.hideEnterEmails eq \"1\"}none{else}block{/if};\">\r\n	<div class=\"pixel underline2\">&nbsp;</div>\r\n	<div id=\"inviteList\">\r\n	<table align=\"center\" style=\"margin:10px;\">\r\n	<tr>\r\n		<td><div>&nbsp;</div></td>\r\n		<td><h3 class=\"withBG\">Name</h2></td>\r\n		<td><h3 class=\"withBG\">E-Mail</h2></td>\r\n		<td><h3 class=\"withBG\">Your Relation</h2></td>\r\n	</tr> \r\n	{section name=\"contactLoop\" loop=$addCount}  {* $addCount is assigned by the handler... *}\r\n	<tr>\r\n		<td><div>#{$smarty.section.contactLoop.iteration}</div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][name][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" style=\"width:200px;\" name=\"newcomp[invite][email][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][relation][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n	</tr>\r\n	{/section}\r\n	</table>\r\n	</div>\r\n	\r\n	<div align=\"right\" style=\"margin-right:30px;\">\r\n		<a href=\"javascript://\" onclick=\"addEmailRows();return false;\">&gt; Click to add more now! &lt;</a>\r\n	</div>\r\n</div>\r\n<div class=\"pixel underline2\">&nbsp;</div>\r\n\r\n\r\n<script language=\"javascript\">\r\n	var addCount = {$addCount};\r\n	{literal}\r\n	function addEmailRows() {\r\n		addCount++;\r\n		var obj = document.getElementById(\'inviteList\');\r\n		var html = obj.innerHTML;\r\n		html = html.replace(/\\<\\/TABLE\\>/i, \'\');\r\n		html += \'<tr><td><div>#\'+addCount+\'</div></td><td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][name][\'+addCount+\']\"></div></td><td><div><input type=\"text\" class=\"textInput\" style=\"width:200px;\" name=\"newcomp[invite][email][\'+addCount+\']\"></div></td><td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][relation][\'+addCount+\']\"></div></td></tr></table>\';\r\n		obj.innerHTML = html;\r\n	}\r\n	{/literal}\r\n</script>\r\n\r\n{stored_object_fill_form object=$newcomp name=\"newcomp\"}\r\n\r\n<div class=\"hBox\" style=\"text-align:right;\">\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\" onclick=\"pg.value=\'{$next.pageName}\';\">{/if}	\r\n</div>\r\n\r\n</form>'),(4945,272,0.60,'smarty','0','Working...',1141939923,2271,'67.50.41.87','{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<form method=\"post\" action=\"index.php\">\r\n<div id=\"myCompetitors\" style=\"width:300px;background-color:white;zIndex:100;position:absolute;display:none;top:5;left:300px;border:solid 1px #CCC;filter: alpha(opacity=90)\">\r\n  <center>\r\n   <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"95%\">\r\n      <tr><td align=\"right\" valign=\"top\" style=\"height:5px\"><small><span style=\"cursor:pointer;\" onclick=\"extraCompetitors(\'close\');\">close window</span><small></td></tr>\r\n      <tr><td style=\"border-bottom:solid 1px #CCC;\"><h2>More Competitors...</td></tr>\r\n      <tr>\r\n         <td align=\"center\">\r\n	    <table id=\"competitorsTable\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"90%\">\r\n                <tr>\r\n		  <td></td>\r\n		  <td align=\"center\" valign=\"bottom\">Name</td>\r\n                  <td align=\"center\" valign=\"bottom\">Email</td>\r\n                </tr>\r\n	        <tr>\r\n		  <td>1.</td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>2.</td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>3.</td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>4.</td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>5.</td>\r\n		  <td><input type=\"text name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>6.</td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>7.</td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>8.</td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>9.</td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>10.</td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n		<tr>\r\n		  <td colspan=\"3\" align=\"right\"><small><span style=\"cursor:pointer;\" onclick=\'addMoreCompetitors();\'>Add More Lines</span></small></td>\r\n		</tr>\r\n            </table>\r\n         </td>\r\n      </tr>\r\n      <tr>\r\n	<td align=\"right\" style=\"border-top:solid 1px #CCC;\"><img style=\"cursor:pointer;\" src=\"{$skinFolder}images/btn_next.gif\" alt=\"Add\" border=\"0\" /></td>\r\n      </tr>\r\n   </table>\r\n  </center>\r\n</div>\r\n<table width=\"100%\" border=0>\r\n <tr>\r\n  <td nowrap><h2> A. Competing for...</h2></td>\r\n  <td nowrap><h2>B. The competition name is...</h2></td>\r\n  <td nowrap><h2>C. How\'s competing...</h2></td>\r\n </tr>\r\n <tr>\r\n  <td valign=\"top\" width=\"30%\">\r\n    <small>\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"p2p\" checked> <a href=\"javascript:setCompType(\'p2p\');\">Pound for pound <i>(Weight lost)</i></a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"pctWt\"> <a href=\"javascript:setCompType(\'pctWt\');\">Percent of body weight lost</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"minEx\"> <a href=\"javascript:setCompType(\'minEx\');\">Total minutes excercised</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"disEx\"> <a href=\"javascript:setCompType(\'disEx\');\">Total distance excercised</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"veg\"> <a href=\"javascript:setCompType(\'veg\');\">Vegitable challenge</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"gain\"> <a href=\"javascript:setCompType(\'gain\');\">Weight gained</a><br />\r\n    </small>\r\n  </td>\r\n  <td valign=\"top\">\r\n    <table border=0 cellspacing=0>\r\n    <tr>\r\n      <td><h3>Name:</h3></td>\r\n      <td><input type=\"text\" name=\"comp[title]\" /></td>\r\n    </tr>\r\n    <tr>\r\n      <td valign=\"top\"><small><b>Examples:</b></small></td>\r\n      <td><small>&quot;The chubby family reunion&quot;<br />&quot;Company shape-up marathon&quot;<br />&quot;Super Summer Slimdown&quot;</small></td>\r\n    </tr>\r\n    <tr>\r\n      <td colspan=\"2\">\r\n	<br/>\r\n        <div style=\"border:solid 1px black;width:98%;height:60px;\">\r\n	  test\r\n	</div>\r\n      </td>\r\n    </tr>\r\n    </table>\r\n  </td>\r\n  <td valign=\"top\">\r\n     <table border=1 cellpaddin=0 cellspacing=0>\r\n      <tr>\r\n	<td colspan=\"2\">\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	     <tr>\r\n	       <td colspan=2><li>Invate your friends</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Name:\r\n                 </small>\r\n	       </td>\r\n	       <td>\r\n	         <input type=\"text name=\"comp[competitor_name]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Email:\r\n	         </small>\r\n	       </td>\r\n	       <td>\r\n	         <input type=\"text name=\"comp[competitor_email]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td colspan=\"2\" align=\"right\">\r\n	         <small>\r\n		   <span onclick=\"extraCompetitors(\'open\');\" style=\"cursor:pointer;\">\r\n                     Add more\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	</td>\r\n      </tr>\r\n      <tr>\r\n        <td valign=\"top\">\r\n          <small>\r\n            <input type=\"radio\" value=\"kind\" name=\"comp[invite_type]\" /> <a href=\"javascript:setInviteStyle(\'kind\');\">Kind</a><br />\r\n            <input type=\"radio\" value=\"smack\" name=\"comp[invite_type]\" /> <a href=\"javascript:setInviteStyle(\'smack\');\">Smack</a><br />\r\n            <input type=\"radio\" value=\"challenge\" name=\"comp[invite_type]\" /> <a href=\"javascript:setInviteStyle(\'challenge\');\">Challenge</a><br />\r\n            <input type=\"radio\" value=\"custom\" name=\"comp[invite_type]\" /> <a href=\"javascript:setInviteStyle(\'custom\');\">Make Your Own</a><br />\r\n          </small>\r\n        </td>\r\n        <td valign=\"top\">\r\n	    <div id=\"InvateW\" style=\"border-bottom:solid 1px #CCC;border-left:solid 1px #CCC;padding-right:5px;visibility:hidden;\">\r\n	      <small>\r\n	    	<input type=\"radio\" value=\"heavy\" name=\"comp[invite_subtype]\" /> <a href=\"javascript:setInviteWeight(\'heavy\');\">Heavy</a><br />\r\n            	<input type=\"radio\" value=\"medium\" name=\"comp[invite_subtype]\" /> <a href=\"javascript:setInviteWeight(\'medium\');\">Medium</a><br />\r\n            	<input type=\"radio\" value=\"light\" name=\"comp[invite_subtype]\" /> <a href=\"javascript:setInviteWeight(\'light\');\">Light</a><br />\r\n              </small>\r\n            </div>\r\n        </td>\r\n     </tr>\r\n     </table>\r\n  </td>\r\n</tr>\r\n</table>\r\n\r\n{* <iframe src=\"?pg=compCreate/inviteFrame\" style=\"width:100%;height:410px;\" scrollbars=\"no\" frameborder=\"0\"></iframe> *}\r\n\r\n<div id=\"invite-div\"></div>\r\n<br />\r\n\r\n<div align=\"right\">\r\n  <a href=\"?pg=compCreate/step2\"><img src=\"{$skinFolder}images/btn_next.gif\" alt=\"Next\" border=\"0\" /></a>\r\n</div>\r\n</form>\r\n\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/js-get-data.js\"></script>\r\n\r\n<script language=\"JavaScript\">\r\n	\r\n        //jsGetData(\'?pg=jsGetData\',\'invite-div\', \'madlib.form\', \'&compType=friends&inviteType=smack\');\r\n\r\n	var examples = Array();\r\n	{foreach from=$examples key=\"key\" item=\"example\"}\r\n	examples[{$key}] = \'{eval var=$example.body|addslashes|replace:\"\\r\":\"\"|replace:\"\\n\":\"\\\\n\"}\';\r\n	{/foreach}\r\n	\r\n	{literal}\r\n	function setCompType(type) {\r\n		checkValue(type, \'comp[type]\');\r\n	}\r\n\r\n	function setInviteStyle(type) {\r\n		checkValue(type, \'comp[invite_type]\');\r\n		var oInvateW = document.getElementById(\'InvateW\');\r\n		if(type == \'custom\')\r\n		  oInvateW.style.visibility = \"hidden\";\r\n		else\r\n		  oInvateW.style.visibility = \"visible\";\r\n	}\r\n\r\n	function setInviteWeight(type) {\r\n		checkValue(type, \'comp[invite_subtype]\');\r\n	}\r\n\r\n	function checkValue(type, eName) {\r\n		var aInput=document.getElementsByName(eName);\r\n		for (i = 0; i < aInput.length; i++)\r\n		{\r\n			aInput[i].checked = (aInput[i].value == type) ? true : false;\r\n		}\r\n	}\r\n\r\n	/*  This functions should go inside of JS file  *******/\r\n\r\n	// This function adds a new row in the CompetitorsTable to add more competitors\r\n        // the current limit of competitors is 10\r\n	function addMoreCompetitors(){\r\n	  var oTable = document.getElementById(\"competitorsTable\");\r\n	  var rowNum = oTable.rows.length - 1;\r\n          if(rowNum >= 15){\r\n		alert(\'message: No more than 15\');\r\n		return;\r\n	  }\r\n	  var w = oTable.insertRow(rowNum);\r\n	  var x = w.insertCell(0);\r\n	  var y = w.insertCell(1);\r\n	  var z = w.insertCell(2);\r\n	\r\n	  x.innerHTML = rowNum + \".\";\r\n	  y.innerHTML = \"<input type=\'text\' name=\'comp[competitor_name]\' style=\'width:110px;\' />\";\r\n	  z.innerHTML = \"<input type=\'text\' name=\'comp[competitor_email]\' style=\'width:110px;\' />\";\r\n	  \r\n	  return;\r\n	}\r\n\r\n	function extraCompetitors(type){\r\n	  var oDiv = document.getElementById(\"myCompetitors\");\r\n\r\n	  if(type == \"close\"){\r\n	     oDiv.style.display = \"none\";\r\n	  }else{\r\n             oDiv.style.display = \"block\";\r\n	  }\r\n	  return;\r\n	}\r\n\r\n	{/literal}\r\n</script>'),(4826,196,1.54,'smarty','0','Finally added table for adjustments',1139606284,16,'216.194.127.150','{if $smarty.session.company.preferences.hide_incentives eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n\r\n{* HANDLERS *}\r\n{include_php file=\"shared_handle:company/participationPoints_v2\"}\r\n{include_php file=\"shared_handle:company/surveyList\"}\r\n{include_php file=\"shared_handle:company/incentivePointAdjustments\"}\r\n{***{include_php file=\"shared_handle:company/wellnessConnectionList\"}***}\r\n\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{if $smarty.session.company.preferences.title_my_incentives}{$smarty.session.company.preferences.title_my_incentives}</h1>{else}\r\n<h1>{$page.title}</h1>{/if}\r\n\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n	<img class=\"iconPrize\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n</td><td valign=\"top\" width=\"100%\">\r\n	{$incentiveText|default:\"<em>Yearly Incentive</em><br /><br />Not Yet Determined.\"}	\r\n</td></tr>\r\n</table>\r\n<br />\r\n{assign var=\"surveyPointsEarned\" value=$surveyPointsEarned|default:\"0\"}\r\n{assign var=\"totalIncentivePointAdjustments\" value=$totalIncentivePointAdjustments|default:\"0\"}\r\n<h2 class=\"boxed\"><i>Total Points Earned</i>: <em>{$totalParticipationPoints|math:\"x+$surveyPointsEarned+$totalIncentivePointAdjustments\"}</em></h2>\r\n\r\n<blockquote>\r\n<table width=\"700\">\r\n<tr><td valign=\"top\">\r\n	\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}{else}Available Surveys:</h3></td>{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}\r\n	{assign var=\"hideCheck\" value=\"hide_survey_`$item.id`\"}\r\n	{if $smarty.session.company.preferences[$hideCheck] neq \"yes\"}\r\n		<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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	{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">>\r\n		None found.</td></tr>\r\n	{/foreach}\r\n\r\n	<tr><td>&nbsp;</td>\r\n	    <td align=\"right\"><em>Survey points earned:</em></td>\r\n	    <td align=\"center\"><span class=\"boxed\">{$surveyPointsEarned|default:0}</span></td></tr>\r\n\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.wellnessConnection}{$smarty.session.company.preferences.wellnessConnection}<br /><a href=\"?wellnessConnection\">Click Here</a>{else}</h3></td>\r\n		{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n\r\n\r\n	{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\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		<tr><td><img class=\"icoStethescope\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>HRA Score</u>:</b>\r\n		    {if ($aHRA.dateTaken eq \"\") OR ($aHRA.dateTaken < $smarty.now|math:\"x - 31536000\")}<br /><a href=\"javascript://\" onclick=\"openSurvey(8);\">Available Now</a>{/if}</td>\r\n		    <td align=\"center\"><em>{$aHRA.pointsEarned}</em></td></tr>\r\n	{/if}\r\n\r\n	{if $vanity eq \"onai\" or $vanity eq \"mycompany\" or $vanity eq \"zions\" or $vanity eq \"zions2\"}\r\n	<tr><td><img class=\"icoWeights\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>Consumer Tools</u>:</b><br /><em>NEW<i>!</i></em></td>\r\n		    <td align=\"center\"><a href=\"?pg=consumer_tools\">Click Here</a></td></tr>\r\n	{/if}\r\n\r\n	{if 0 neq $totalIncentivePointAdjustments}\r\n	<br style=\"clear:left;\" />\r\n	<tr><td colspan=\"3\"><h3>Adjustments/Redemptions:</h3></td></tr>\r\n        {foreach from=$incentivePointAdjustments item=\"adjustment\" name=\"loopAdjustments\"}<tr><td nowrap>\r\n	<tr><td colspan=\"2\"><small><i>{$adjustment.dateAssigned|date_format2:\"m/d/Y\"}</i> - {$adjustment.comment}</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$adjustment.points}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Total:</em></td>\r\n		<td align=\"center\" nowrap=\"nowrap\"><span class=\"boxed\"><nobr>{$totalIncentivePointAdjustments|default:0}</nobr></span></td></tr>\r\n	{/if}\r\n\r\n	</table>\r\n\r\n</td><td valign=\"top\">\r\n	<h3>Feedback:</h3>\r\n	<table>\r\n	<tr><td>\r\n	<img class=\"icoNurse\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n	</td><td>\r\n	<ul>\r\n		<li><a href=\"javascript:viewSurveys();\">Review My Survey Taking History</a></li>\r\n		{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\r\n		<li><a href=\"?pg=HRAScoreInfo\">HRA Score Info</a></li>\r\n		{/if}\r\n	<ul>\r\n	</td></tr>\r\n	</table>\r\n	<br />\r\n\r\n	{if $aScales|@count gt 0} {* PARTICIPATION POINTS -- IF APPLICABLE *}\r\n	<table align=\"right\">\r\n	<tr><td colspan=\"3\"><h3>Participation Points:</h3></td></tr>\r\n        {foreach from=$aScales item=\"scale\" name=\"loopScales\"}<tr><td nowrap>\r\n	<tr><td>{$scale.name|niceText}</td>\r\n	    <td><small>({$scale.dateStart|date_format2:\"m/d/y\"} - {$scale.dateEnd|date_format2:\"m/d/y\"})</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$aScores[$scale.id]|number_format:\"1\"}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Participation points earned:</em></td>\r\n		<td align=\"right\"><span class=\"boxed\">{$totalParticipationPoints|default:0}</span></td></tr>\r\n	</table>\r\n	{/if}\r\n\r\n	</td></tr>\r\n</table>\r\n</blockquote>'),(4948,202,0.99,'smarty','0','Added company preference check to show SHOPPING stuff.',1141974681,2,'24.2.76.126','{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=\"\" height=\"120\" width=\"91\" /><br />\r\n		<small><a href=\"#\">Reebok\'s Heart Rate Monitor.  Click here.</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=\"{if $smarty.session.company.preferences.landing_logo_url}{$smarty.session.company.preferences.landing_logo_url}{else}{$skinFolder}images/ehc/corporateBuilding_sm.jpg{/if}\" 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	{if $landingSurveyText OR $surveys|@count gt 0}\r\n		<h2 class=\"uline\">Company Surveys:</h2>\r\n		<blockquote>\r\n		{$landingSurveyText}\r\n		{if $surveys|@count gt 0}\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		{/if}\r\n		</blockquote>\r\n	{/if}\r\n	{if $smarty.session.company.preferences.hide_shop neq \"yes\"}\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	{/if}\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		{if $smarty.session.company.preferences.hide_login eq \"yes\"}\r\n			<p><b>You are not logged in or your session has expired.</b><br /><br />\r\n			If you would like to log in now, you need to close this window and log in from the company website.<br /><br />\r\n			If you have any questions please contact our support department.</p>\r\n		{else}\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=\"{$smarty.request.return|default:$signup.return|default:\"my_login\"}\" />\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$smarty.request.cid}\" />\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\" />\r\n			<input type=\"hidden\" name=\"no_expire_keep_alive\" value=\"pg cid\" />\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		{/if}		\r\n	</td></tr>\r\n	<tr><td align=\"right\">\r\n		<br />\r\n		{if $smarty.session.company.companyName && $smarty.session.company.preferences.hide_login neq \"yes\"}\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}'),(4664,273,0.15,'smarty','0','Page created.',1135917362,3,'24.2.76.126','{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<form method=\"post\" action=\"index.php\">\r\n\r\n<table width=\"100%\">\r\n<tr>\r\n  <td><h2>Prize Method:</h2></td>\r\n  <td><select name=\"comp[prize_method]\">\r\n        <option value=\"\">Cash Settlement</option>\r\n      </select></td>\r\n  <td rowspan=\"2\"><img src=\"blank.gif\" width=\"200\" height=\"100\" alt=\"\" border=\"1\" /></td>\r\n</tr>\r\n<tr>\r\n  <td><b>Type:</b></td>\r\n  <td><input type=\"text\" value=\"$50.00\" /></td>\r\n</tr>\r\n</table>\r\n\r\n<a name=\"invitations\" />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'enterEmails\', \'hideEnterEmails\', \'showHide\');\"><img id=\"enterEmails_img\" src=\"./img/blank.gif\" class=\"showHide_{if $newcomp.hideEnterEmails}off{else}on{/if}\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n	Invite Some Competitors:</h2>\r\n	<input type=\"hidden\" id=\"hideEnterEmails\" name=\"newcomp[hideEnterEmails]\" value=\"{$newcomp.hideEnterEmails|default:\"0\"}\">\r\n\r\n<div>Enter a name and email address for each person you would like to invite into this competition. If this is a company wide competition simply enter EMPLOYEES as the name and the appropriate email address to reach them. If you did not create a letter to send, then SKIP this section.<br /><br /></div>\r\n\r\n<div id=\"enterEmails\" style=\"display:{if $newcomp.hideEnterEmails eq \"1\"}none{else}block{/if};\">\r\n	<div class=\"pixel underline2\">&nbsp;</div>\r\n	<div id=\"inviteList\">\r\n	<table align=\"center\" style=\"margin:10px;\">\r\n	<tr>\r\n		<td><div>&nbsp;</div></td>\r\n		<td><h3 class=\"withBG\">Name</h2></td>\r\n		<td><h3 class=\"withBG\">E-Mail</h2></td>\r\n		<td><h3 class=\"withBG\">Your Relation</h2></td>\r\n	</tr> \r\n	{section name=\"contactLoop\" loop=$addCount}  {* $addCount is assigned by the handler... *}\r\n	<tr>\r\n		<td><div>#{$smarty.section.contactLoop.iteration}</div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][name][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" style=\"width:200px;\" name=\"newcomp[invite][email][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][relation][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n	</tr>\r\n	{/section}\r\n	</table>\r\n	</div>\r\n	\r\n	<div align=\"right\" style=\"margin-right:30px;\">\r\n		<a href=\"javascript://\" onclick=\"addEmailRows();return false;\">&gt; Click to add more now! &lt;</a>\r\n	</div>\r\n</div>\r\n<div class=\"pixel underline2\">&nbsp;</div>\r\n\r\n\r\n<script language=\"javascript\">\r\n	var addCount = {$addCount};\r\n	{literal}\r\n	function addEmailRows() {\r\n		addCount++;\r\n		var obj = document.getElementById(\'inviteList\');\r\n		var html = obj.innerHTML;\r\n		html = html.replace(/\\<\\/TABLE\\>/i, \'\');\r\n		html += \'<tr><td><div>#\'+addCount+\'</div></td><td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][name][\'+addCount+\']\"></div></td><td><div><input type=\"text\" class=\"textInput\" style=\"width:200px;\" name=\"newcomp[invite][email][\'+addCount+\']\"></div></td><td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][relation][\'+addCount+\']\"></div></td></tr></table>\';\r\n		obj.innerHTML = html;\r\n	}\r\n	{/literal}\r\n</script>\r\n\r\n{stored_object_fill_form object=$newcomp name=\"newcomp\"}\r\n\r\n<div class=\"hBox\" style=\"text-align:right;\">\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\" onclick=\"pg.value=\'{$next.pageName}\';\">{/if}	\r\n</div>\r\n\r\n</form>'),(4665,273,0.16,'smarty','0','Page created.',1135917518,3,'24.2.76.126','{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<form method=\"post\" action=\"index.php\">\r\n\r\n<table width=\"100%\">\r\n<tr>\r\n  <td><h2>Prize Method:</h2></td>\r\n  <td><select name=\"comp[prize_method]\">\r\n        <option value=\"\">Cash Settlement</option>\r\n      </select></td>\r\n  <td rowspan=\"2\"><img src=\"blank.gif\" width=\"200\" height=\"100\" alt=\"\" border=\"1\" /></td>\r\n</tr>\r\n<tr>\r\n  <td><b>Type:</b></td>\r\n  <td><input type=\"text\" value=\"$50.00\" /></td>\r\n</tr>\r\n</table>\r\n\r\n<a name=\"invitations\" />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'enterEmails\', \'hideEnterEmails\', \'showHide\');\"><img id=\"enterEmails_img\" src=\"./img/blank.gif\" class=\"showHide_{if $newcomp.hideEnterEmails}off{else}on{/if}\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n	Invite Some Competitors:</h2>\r\n	<input type=\"hidden\" id=\"hideEnterEmails\" name=\"newcomp[hideEnterEmails]\" value=\"{$newcomp.hideEnterEmails|default:\"0\"}\">\r\n\r\n<div>Enter a name and email address for each person you would like to invite into this competition. If this is a company wide competition simply enter EMPLOYEES as the name and the appropriate email address to reach them. If you did not create a letter to send, then SKIP this section.<br /><br /></div>\r\n\r\n<div id=\"enterEmails\" style=\"display:{if $newcomp.hideEnterEmails eq \"1\"}none{else}block{/if};\">\r\n	<div class=\"pixel underline2\">&nbsp;</div>\r\n	<div id=\"inviteList\">\r\n	<table align=\"center\" style=\"margin:10px;\">\r\n	<tr>\r\n		<td><div>&nbsp;</div></td>\r\n		<td><h3 class=\"withBG\">Name</h2></td>\r\n		<td><h3 class=\"withBG\">E-Mail</h2></td>\r\n		<td><h3 class=\"withBG\">Your Relation</h2></td>\r\n	</tr> \r\n	{section name=\"contactLoop\" loop=$addCount}  {* $addCount is assigned by the handler... *}\r\n	<tr>\r\n		<td><div>#{$smarty.section.contactLoop.iteration}</div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][name][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" style=\"width:200px;\" name=\"newcomp[invite][email][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][relation][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n	</tr>\r\n	{/section}\r\n	</table>\r\n	</div>\r\n	\r\n	<div align=\"right\" style=\"margin-right:30px;\">\r\n		<a href=\"javascript://\" onclick=\"addEmailRows();return false;\">&gt; Click to add more now! &lt;</a>\r\n	</div>\r\n</div>\r\n<div class=\"pixel underline2\">&nbsp;</div>\r\n\r\n\r\n<script language=\"javascript\">\r\n	var addCount = {$addCount};\r\n	{literal}\r\n	function addEmailRows() {\r\n		addCount++;\r\n		var obj = document.getElementById(\'inviteList\');\r\n		var html = obj.innerHTML;\r\n		html = html.replace(/\\<\\/TABLE\\>/i, \'\');\r\n		html += \'<tr><td><div>#\'+addCount+\'</div></td><td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][name][\'+addCount+\']\"></div></td><td><div><input type=\"text\" class=\"textInput\" style=\"width:200px;\" name=\"newcomp[invite][email][\'+addCount+\']\"></div></td><td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][relation][\'+addCount+\']\"></div></td></tr></table>\';\r\n		obj.innerHTML = html;\r\n	}\r\n	{/literal}\r\n</script>\r\n\r\n{* stored_object_fill_form object=$newcomp name=\"newcomp\" *}\r\n\r\n<div class=\"hBox\" style=\"text-align:right;\">\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\" onclick=\"pg.value=\'{$next.pageName}\';\">{/if}	\r\n</div>\r\n\r\n</form>'),(4666,273,0.17,'smarty','0','Page created.',1135917821,3,'24.2.76.126','{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<form method=\"post\" action=\"index.php\">\r\n\r\n<table width=\"100%\">\r\n<tr>\r\n  <td><h2>Prize Method:</h2></td>\r\n  <td><select name=\"comp[prize_method]\">\r\n        <option value=\"\">Cash Settlement</option>\r\n      </select></td>\r\n  <td rowspan=\"2\"><img src=\"blank.gif\" width=\"200\" height=\"100\" alt=\"\" border=\"1\" /></td>\r\n</tr>\r\n<tr>\r\n  <td><b>Type:</b></td>\r\n  <td><input type=\"text\" value=\"$50.00\" /></td>\r\n</tr>\r\n</table>\r\n\r\n<a name=\"invitations\" />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'enterEmails\', \'hideEnterEmails\', \'showHide\');\"><img id=\"enterEmails_img\" src=\"./img/blank.gif\" class=\"showHide_{if $newcomp.hideEnterEmails}off{else}on{/if}\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n	Invite Some Competitors:</h2>\r\n	<input type=\"hidden\" id=\"hideEnterEmails\" name=\"newcomp[hideEnterEmails]\" value=\"{$newcomp.hideEnterEmails|default:\"0\"}\">\r\n\r\n<div>Enter a name and email address for each person you would like to invite into this competition. If this is a company wide competition simply enter EMPLOYEES as the name and the appropriate email address to reach them. If you did not create a letter to send, then SKIP this section.<br /><br /></div>\r\n\r\n<div id=\"enterEmails\" style=\"display:{if $newcomp.hideEnterEmails eq \"1\"}none{else}block{/if};\">\r\n	<div class=\"pixel underline2\">&nbsp;</div>\r\n	<div id=\"inviteList\">\r\n	<table align=\"center\" style=\"margin:10px;\">\r\n	<tr>\r\n		<td><div>&nbsp;</div></td>\r\n		<td><h3 class=\"withBG\">Name</h2></td>\r\n		<td><h3 class=\"withBG\">E-Mail</h2></td>\r\n		<td><h3 class=\"withBG\">Your Relation</h2></td>\r\n	</tr> \r\n	{section name=\"contactLoop\" loop=$addCount}  {* $addCount is assigned by the handler... *}\r\n	<tr>\r\n		<td><div>#{$smarty.section.contactLoop.iteration}</div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][name][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" style=\"width:200px;\" name=\"newcomp[invite][email][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n		<td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][relation][{$smarty.section.contactLoop.iteration}]\"></div></td>\r\n	</tr>\r\n	{/section}\r\n	</table>\r\n	</div>\r\n	\r\n	<div align=\"right\" style=\"margin-right:30px;\">\r\n		<a href=\"javascript://\" onclick=\"addEmailRows();return false;\">&gt; Click to add more now! &lt;</a>\r\n	</div>\r\n</div>\r\n<div class=\"pixel underline2\">&nbsp;</div>\r\n\r\n\r\n<script language=\"javascript\">\r\n	var addCount = {$addCount};\r\n	{literal}\r\n	function addEmailRows() {\r\n		addCount++;\r\n		var obj = document.getElementById(\'inviteList\');\r\n		var html = obj.innerHTML;\r\n		html = html.replace(/\\<\\/TABLE\\>/i, \'\');\r\n		html += \'<tr><td><div>#\'+addCount+\'</div></td><td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][name][\'+addCount+\']\"></div></td><td><div><input type=\"text\" class=\"textInput\" style=\"width:200px;\" name=\"newcomp[invite][email][\'+addCount+\']\"></div></td><td><div><input type=\"text\" class=\"textInput\" name=\"newcomp[invite][relation][\'+addCount+\']\"></div></td></tr></table>\';\r\n		obj.innerHTML = html;\r\n	}\r\n	{/literal}\r\n</script>\r\n\r\n{* stored_object_fill_form object=$newcomp name=\"newcomp\" *}\r\n\r\n<div align=\"right\">\r\n	<input type=\"image\" src=\"{$skinFolder}images/btn_back.gif\" class=\"btn_image\" onclick=\"pg.value=\'{$prev.pageName}\';\">\r\n	<input type=\"image\" src=\"{$skinFolder}images/btn_next.gif\" class=\"btn_image\" onclick=\"pg.value=\'{$next.pageName}\';\">\r\n</div>\r\n\r\n</form>'),(4827,286,0.10,'smarty','0','Page created.',1139606296,16,'216.194.127.150',''),(4828,286,0.11,'smarty','0','Page created.',1139606378,16,'216.194.127.150','{include_php file=\"shared_handle:company/wellnessConnectionList\"}\r\n\r\n	<table>\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=\"ico{$item.id}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"ico{$item.id}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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>'),(4829,196,1.55,'smarty','0','Finally added table for adjustments',1139606750,16,'216.194.127.150','{if $smarty.session.company.preferences.hide_incentives eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n\r\n{* HANDLERS *}\r\n{include_php file=\"shared_handle:company/participationPoints_v2\"}\r\n{include_php file=\"shared_handle:company/surveyList\"}\r\n{include_php file=\"shared_handle:company/incentivePointAdjustments\"}\r\n{***{include_php file=\"shared_handle:company/wellnessConnectionList\"}***}\r\n\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{if $smarty.session.company.preferences.title_my_incentives}{$smarty.session.company.preferences.title_my_incentives}</h1>{else}\r\n<h1>{$page.title}</h1>{/if}\r\n\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n	<img class=\"iconPrize\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n</td><td valign=\"top\" width=\"100%\">\r\n	{$incentiveText|default:\"<em>Yearly Incentive</em><br /><br />Not Yet Determined.\"}	\r\n</td></tr>\r\n</table>\r\n<br />\r\n{assign var=\"surveyPointsEarned\" value=$surveyPointsEarned|default:\"0\"}\r\n{assign var=\"totalIncentivePointAdjustments\" value=$totalIncentivePointAdjustments|default:\"0\"}\r\n<h2 class=\"boxed\"><i>Total Points Earned</i>: <em>{$totalParticipationPoints|math:\"x+$surveyPointsEarned+$totalIncentivePointAdjustments\"}</em></h2>\r\n\r\n<blockquote>\r\n<table width=\"700\">\r\n<tr><td valign=\"top\">\r\n	\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}{else}Available Surveys:</h3></td>{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}\r\n	{assign var=\"hideCheck\" value=\"hide_survey_`$item.id`\"}\r\n	{if $smarty.session.company.preferences[$hideCheck] neq \"yes\"}\r\n		<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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	{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">>\r\n		None found.</td></tr>\r\n	{/foreach}\r\n\r\n	<tr><td>&nbsp;</td>\r\n	    <td align=\"right\"><em>Survey points earned:</em></td>\r\n	    <td align=\"center\"><span class=\"boxed\">{$surveyPointsEarned|default:0}</span></td></tr>\r\n\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.wellnessConnection}{$smarty.session.company.preferences.wellnessConnection}<br /><a href=\"?pg=wellnessConnection\">Click Here</a>{else}</h3></td>\r\n		{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n\r\n\r\n	{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\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		<tr><td><img class=\"icoStethescope\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>HRA Score</u>:</b>\r\n		    {if ($aHRA.dateTaken eq \"\") OR ($aHRA.dateTaken < $smarty.now|math:\"x - 31536000\")}<br /><a href=\"javascript://\" onclick=\"openSurvey(8);\">Available Now</a>{/if}</td>\r\n		    <td align=\"center\"><em>{$aHRA.pointsEarned}</em></td></tr>\r\n	{/if}\r\n\r\n	{if $vanity eq \"onai\" or $vanity eq \"mycompany\" or $vanity eq \"zions\" or $vanity eq \"zions2\"}\r\n	<tr><td><img class=\"icoWeights\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>Consumer Tools</u>:</b><br /><em>NEW<i>!</i></em></td>\r\n		    <td align=\"center\"><a href=\"?pg=consumer_tools\">Click Here</a></td></tr>\r\n	{/if}\r\n\r\n	{if 0 neq $totalIncentivePointAdjustments}\r\n	<br style=\"clear:left;\" />\r\n	<tr><td colspan=\"3\"><h3>Adjustments/Redemptions:</h3></td></tr>\r\n        {foreach from=$incentivePointAdjustments item=\"adjustment\" name=\"loopAdjustments\"}<tr><td nowrap>\r\n	<tr><td colspan=\"2\"><small><i>{$adjustment.dateAssigned|date_format2:\"m/d/Y\"}</i> - {$adjustment.comment}</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$adjustment.points}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Total:</em></td>\r\n		<td align=\"center\" nowrap=\"nowrap\"><span class=\"boxed\"><nobr>{$totalIncentivePointAdjustments|default:0}</nobr></span></td></tr>\r\n	{/if}\r\n\r\n	</table>\r\n\r\n</td><td valign=\"top\">\r\n	<h3>Feedback:</h3>\r\n	<table>\r\n	<tr><td>\r\n	<img class=\"icoNurse\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n	</td><td>\r\n	<ul>\r\n		<li><a href=\"javascript:viewSurveys();\">Review My Survey Taking History</a></li>\r\n		{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\r\n		<li><a href=\"?pg=HRAScoreInfo\">HRA Score Info</a></li>\r\n		{/if}\r\n	<ul>\r\n	</td></tr>\r\n	</table>\r\n	<br />\r\n\r\n	{if $aScales|@count gt 0} {* PARTICIPATION POINTS -- IF APPLICABLE *}\r\n	<table align=\"right\">\r\n	<tr><td colspan=\"3\"><h3>Participation Points:</h3></td></tr>\r\n        {foreach from=$aScales item=\"scale\" name=\"loopScales\"}<tr><td nowrap>\r\n	<tr><td>{$scale.name|niceText}</td>\r\n	    <td><small>({$scale.dateStart|date_format2:\"m/d/y\"} - {$scale.dateEnd|date_format2:\"m/d/y\"})</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$aScores[$scale.id]|number_format:\"1\"}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Participation points earned:</em></td>\r\n		<td align=\"right\"><span class=\"boxed\">{$totalParticipationPoints|default:0}</span></td></tr>\r\n	</table>\r\n	{/if}\r\n\r\n	</td></tr>\r\n</table>\r\n</blockquote>'),(4830,286,0.12,'smarty','0','Page created.',1139606806,16,'216.194.127.150','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n\r\n{include_php file=\"shared_handle:company/wellnessConnectionList\"}\r\n\r\n	<table>\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=\"ico{$item.id}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"ico{$item.id}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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>'),(4831,196,1.56,'smarty','0','Finally added table for adjustments',1139607241,16,'216.194.127.150','{if $smarty.session.company.preferences.hide_incentives eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n\r\n{* HANDLERS *}\r\n{include_php file=\"shared_handle:company/participationPoints_v2\"}\r\n{include_php file=\"shared_handle:company/surveyList\"}\r\n{include_php file=\"shared_handle:company/incentivePointAdjustments\"}\r\n{***{include_php file=\"shared_handle:company/wellnessConnectionList\"}***}\r\n\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{if $smarty.session.company.preferences.title_my_incentives}{$smarty.session.company.preferences.title_my_incentives}{else}</h1>\r\n<h1>{$page.title}</h1>{/if}\r\n\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n	<img class=\"iconPrize\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n</td><td valign=\"top\" width=\"100%\">\r\n	{$incentiveText|default:\"<em>Yearly Incentive</em><br /><br />Not Yet Determined.\"}	\r\n</td></tr>\r\n</table>\r\n<br />\r\n{assign var=\"surveyPointsEarned\" value=$surveyPointsEarned|default:\"0\"}\r\n{assign var=\"totalIncentivePointAdjustments\" value=$totalIncentivePointAdjustments|default:\"0\"}\r\n<h2 class=\"boxed\"><i>Total Points Earned</i>: <em>{$totalParticipationPoints|math:\"x+$surveyPointsEarned+$totalIncentivePointAdjustments\"}</em></h2>\r\n\r\n<blockquote>\r\n<table width=\"700\">\r\n<tr><td valign=\"top\">\r\n	\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}{else}Available Surveys:</h3></td>{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}\r\n	{assign var=\"hideCheck\" value=\"hide_survey_`$item.id`\"}\r\n	{if $smarty.session.company.preferences[$hideCheck] neq \"yes\"}\r\n		<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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	{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">>\r\n		None found.</td></tr>\r\n	{/foreach}\r\n\r\n	<tr><td>&nbsp;</td>\r\n	    <td align=\"right\"><em>Survey points earned:</em></td>\r\n	    <td align=\"center\"><span class=\"boxed\">{$surveyPointsEarned|default:0}</span></td></tr>\r\n\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.wellnessConnection}{$smarty.session.company.preferences.wellnessConnection}<br /><a href=\"?pg=wellnessConnection\">Click Here</a>{else}</h3></td>\r\n		{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n\r\n\r\n	{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\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		<tr><td><img class=\"icoStethescope\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>HRA Score</u>:</b>\r\n		    {if ($aHRA.dateTaken eq \"\") OR ($aHRA.dateTaken < $smarty.now|math:\"x - 31536000\")}<br /><a href=\"javascript://\" onclick=\"openSurvey(8);\">Available Now</a>{/if}</td>\r\n		    <td align=\"center\"><em>{$aHRA.pointsEarned}</em></td></tr>\r\n	{/if}\r\n\r\n	{if $vanity eq \"onai\" or $vanity eq \"mycompany\" or $vanity eq \"zions\" or $vanity eq \"zions2\"}\r\n	<tr><td><img class=\"icoWeights\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>Consumer Tools</u>:</b><br /><em>NEW<i>!</i></em></td>\r\n		    <td align=\"center\"><a href=\"?pg=consumer_tools\">Click Here</a></td></tr>\r\n	{/if}\r\n\r\n	{if 0 neq $totalIncentivePointAdjustments}\r\n	<br style=\"clear:left;\" />\r\n	<tr><td colspan=\"3\"><h3>Adjustments/Redemptions:</h3></td></tr>\r\n        {foreach from=$incentivePointAdjustments item=\"adjustment\" name=\"loopAdjustments\"}<tr><td nowrap>\r\n	<tr><td colspan=\"2\"><small><i>{$adjustment.dateAssigned|date_format2:\"m/d/Y\"}</i> - {$adjustment.comment}</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$adjustment.points}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Total:</em></td>\r\n		<td align=\"center\" nowrap=\"nowrap\"><span class=\"boxed\"><nobr>{$totalIncentivePointAdjustments|default:0}</nobr></span></td></tr>\r\n	{/if}\r\n\r\n	</table>\r\n\r\n</td><td valign=\"top\">\r\n	<h3>Feedback:</h3>\r\n	<table>\r\n	<tr><td>\r\n	<img class=\"icoNurse\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n	</td><td>\r\n	<ul>\r\n		<li><a href=\"javascript:viewSurveys();\">Review My Survey Taking History</a></li>\r\n		{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\r\n		<li><a href=\"?pg=HRAScoreInfo\">HRA Score Info</a></li>\r\n		{/if}\r\n	<ul>\r\n	</td></tr>\r\n	</table>\r\n	<br />\r\n\r\n	{if $aScales|@count gt 0} {* PARTICIPATION POINTS -- IF APPLICABLE *}\r\n	<table align=\"right\">\r\n	<tr><td colspan=\"3\"><h3>Participation Points:</h3></td></tr>\r\n        {foreach from=$aScales item=\"scale\" name=\"loopScales\"}<tr><td nowrap>\r\n	<tr><td>{$scale.name|niceText}</td>\r\n	    <td><small>({$scale.dateStart|date_format2:\"m/d/y\"} - {$scale.dateEnd|date_format2:\"m/d/y\"})</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$aScores[$scale.id]|number_format:\"1\"}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Participation points earned:</em></td>\r\n		<td align=\"right\"><span class=\"boxed\">{$totalParticipationPoints|default:0}</span></td></tr>\r\n	</table>\r\n	{/if}\r\n\r\n	</td></tr>\r\n</table>\r\n</blockquote>'),(4833,286,0.13,'smarty','0','Page created.',1139607409,16,'216.194.127.150','{include file=\"layouts/forceLoggedIn.tpl\"}\r\n{include_php file=\"shared_handle:company/consumerSurveyList\"}\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>Consumer Tools</h1>\r\n\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n	<img class=\"iconClipboard\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n</td><td valign=\"top\" width=\"100%\">\r\n	Welcome to \"Consumer Skills.\"  From this page you can receive points for being an economic health care consumer.  Click on the survey below or post a message in one of the consumer skills discussion boards to receive points.  Check back every chance you get so you can learn more about Consumer Directed health skills and receive points for your Consumer Skills!	\r\n</td></tr>\r\n</table>\r\n\r\n<blockquote>\r\n<table width=\"100%\"><tr>\r\n<td valign=\"top\" width=\"100%\">\r\n	<h3>Available Surveys:</h3>\r\n	<table>\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=\"ico{$item.id}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"ico{$item.id}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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</td>\r\n<td valign=\"top\" nowrap=\"nowrap\">\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>\r\n</td>\r\n</tr>\r\n</table>\r\n</blockquote>'),(4874,196,1.59,'smarty','0','Finally added table for adjustments',1140741338,16,'216.194.127.150','{if $smarty.session.company.preferences.hide_incentives eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n\r\n{* HANDLERS *}\r\n{include_php file=\"shared_handle:company/participationPoints_v2\"}\r\n{include_php file=\"shared_handle:company/surveyList\"}\r\n{include_php file=\"shared_handle:company/incentivePointAdjustments\"}\r\n\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{if $smarty.session.company.preferences.title_my_incentives}{$smarty.session.company.preferences.title_my_incentives}</h1>{else}\r\n<h1>{$page.title}</h1>{/if}\r\n\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n	<img class=\"iconPrize\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n</td><td valign=\"top\" width=\"100%\">\r\n	{$incentiveText|default:\"<em>Yearly Incentive</em><br /><br />Not Yet Determined.\"}	\r\n</td></tr>\r\n</table>\r\n<br />\r\n{assign var=\"surveyPointsEarned\" value=$surveyPointsEarned|default:\"0\"}\r\n{assign var=\"totalIncentivePointAdjustments\" value=$totalIncentivePointAdjustments|default:\"0\"}\r\n<h2 class=\"boxed\"><i>Total Points Earned</i>: <em>{$totalParticipationPoints|math:\"x+$surveyPointsEarned+$totalIncentivePointAdjustments\"}</em></h2>\r\n\r\n<blockquote>\r\n<table width=\"700\">\r\n<tr><td valign=\"top\">\r\n	\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}{else}Available Surveys:</h3></td>{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}\r\n	{assign var=\"hideCheck\" value=\"hide_survey_`$item.id`\"}\r\n	{if $smarty.session.company.preferences[$hideCheck] neq \"yes\"}\r\n		<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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	{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">>\r\n		None found.</td></tr>\r\n	{/foreach}\r\n\r\n	<tr><td>&nbsp;</td>\r\n	    <td align=\"right\"><em>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}{else}Survey points earned:{/if}</em></td>\r\n	    <td align=\"center\"><span class=\"boxed\">{$surveyPointsEarned|default:0}</span></td></tr>\r\n\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.wellnessConnection}{$smarty.session.company.preferences.wellnessConnection}<br /><a href=\"?pg=wellnessConnection\">Click Here</a>{else}</h3></td>\r\n		{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n\r\n\r\n	{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\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		<tr><td><img class=\"icoStethescope\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>HRA Score</u>:</b>\r\n		    {if ($aHRA.dateTaken eq \"\") OR ($aHRA.dateTaken < $smarty.now|math:\"x - 31536000\")}<br /><a href=\"javascript://\" onclick=\"openSurvey(8);\">Available Now</a>{/if}</td>\r\n		    <td align=\"center\"><em>{$aHRA.pointsEarned}</em></td></tr>\r\n	{/if}\r\n\r\n	{if $vanity eq \"onai\" or $vanity eq \"mycompany\" or $vanity eq \"zions\" or $vanity eq \"zions2\"}\r\n	<tr><td><img class=\"icoWeights\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>Consumer Tools</u>:</b><br /><em>NEW<i>!</i></em></td>\r\n		    <td align=\"center\"><a href=\"?pg=consumer_tools\">Click Here</a></td></tr>\r\n	{/if}\r\n\r\n	{if 0 neq $totalIncentivePointAdjustments}\r\n	<br style=\"clear:left;\" />\r\n	<tr><td colspan=\"3\"><h3>Adjustments/Redemptions:</h3></td></tr>\r\n        {foreach from=$incentivePointAdjustments item=\"adjustment\" name=\"loopAdjustments\"}<tr><td nowrap>\r\n	<tr><td colspan=\"2\"><small><i>{$adjustment.dateAssigned|date_format2:\"m/d/Y\"}</i> - {$adjustment.comment}</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$adjustment.points}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Total:</em></td>\r\n		<td align=\"center\" nowrap=\"nowrap\"><span class=\"boxed\"><nobr>{$totalIncentivePointAdjustments|default:0}</nobr></span></td></tr>\r\n	{/if}\r\n\r\n	</table>\r\n\r\n</td><td valign=\"top\">\r\n	<h3>Feedback:</h3>\r\n	<table>\r\n	<tr><td>\r\n	<img class=\"icoNurse\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n	</td><td>\r\n	<ul>\r\n		<li><a href=\"javascript:viewSurveys();\">Review My History</a></li>\r\n		{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\r\n		<li><a href=\"?pg=HRAScoreInfo\">HRA Score Info</a></li>\r\n		{/if}\r\n	<ul>\r\n	</td></tr>\r\n	</table>\r\n	<br />\r\n\r\n	{if $aScales|@count gt 0} {* PARTICIPATION POINTS -- IF APPLICABLE *}\r\n	<table align=\"right\">\r\n	<tr><td colspan=\"3\"><h3>Participation Points:</h3></td></tr>\r\n        {foreach from=$aScales item=\"scale\" name=\"loopScales\"}<tr><td nowrap>\r\n	<tr><td>{$scale.name|niceText}</td>\r\n	    <td><small>({$scale.dateStart|date_format2:\"m/d/y\"} - {$scale.dateEnd|date_format2:\"m/d/y\"})</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$aScores[$scale.id]|number_format:\"1\"}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Participation points earned:</em></td>\r\n		<td align=\"right\"><span class=\"boxed\">{$totalParticipationPoints|default:0}</span></td></tr>\r\n	</table>\r\n	{/if}\r\n\r\n	</td></tr>\r\n</table>\r\n</blockquote>'),(4878,196,1.63,'smarty','0','Finally added table for adjustments',1140741619,16,'216.194.127.150','{if $smarty.session.company.preferences.hide_incentives eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n\r\n{* HANDLERS *}\r\n{include_php file=\"shared_handle:company/participationPoints_v2\"}\r\n{include_php file=\"shared_handle:company/surveyList\"}\r\n{include_php file=\"shared_handle:company/incentivePointAdjustments\"}\r\n\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{if $smarty.session.company.preferences.title_my_incentives}{$smarty.session.company.preferences.title_my_incentives}</h1>{else}\r\n<h1>{$page.title}</h1>{/if}\r\n\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n	<img class=\"iconPrize\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n</td><td valign=\"top\" width=\"100%\">\r\n	{$incentiveText|default:\"<em>Yearly Incentive</em><br /><br />Not Yet Determined.\"}	\r\n</td></tr>\r\n</table>\r\n<br />\r\n{assign var=\"surveyPointsEarned\" value=$surveyPointsEarned|default:\"0\"}\r\n{assign var=\"totalIncentivePointAdjustments\" value=$totalIncentivePointAdjustments|default:\"0\"}\r\n<h2 class=\"boxed\"><i>Total Points Earned</i>: <em>{$totalParticipationPoints|math:\"x+$surveyPointsEarned+$totalIncentivePointAdjustments\"}</em></h2>\r\n\r\n<blockquote>\r\n<table width=\"700\">\r\n<tr><td valign=\"top\">\r\n	\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>Available {if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}{else} Surveys:</h3></td>{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}\r\n	{assign var=\"hideCheck\" value=\"hide_survey_`$item.id`\"}\r\n	{if $smarty.session.company.preferences[$hideCheck] neq \"yes\"}\r\n		<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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	{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">>\r\n		None found.</td></tr>\r\n	{/foreach}\r\n\r\n	<tr><td>&nbsp;</td>\r\n	    <td align=\"right\"><em>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}&nbsppoints earned{else}Survey points earned:{/if}</em></td>\r\n	    <td align=\"center\"><span class=\"boxed\">{$surveyPointsEarned|default:0}</span></td></tr>\r\n\r\n	<tr><td colspan=\"2\">\r\n		<h3>{if $smarty.session.company.preferences.wellnessConnection}{$smarty.session.company.preferences.wellnessConnection}<br /><a href=\"?pg=wellnessConnection\">Click Here</a>{else}</h3></td>\r\n		{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n\r\n\r\n	{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\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		<tr><td><img class=\"icoStethescope\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>HRA Score</u>:</b>\r\n		    {if ($aHRA.dateTaken eq \"\") OR ($aHRA.dateTaken < $smarty.now|math:\"x - 31536000\")}<br /><a href=\"javascript://\" onclick=\"openSurvey(8);\">Available Now</a>{/if}</td>\r\n		    <td align=\"center\"><em>{$aHRA.pointsEarned}</em></td></tr>\r\n	{/if}\r\n\r\n	{if $vanity eq \"onai\" or $vanity eq \"mycompany\" or $vanity eq \"zions\" or $vanity eq \"zions2\"}\r\n	<tr><td><img class=\"icoWeights\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>Consumer Tools</u>:</b><br /><em>NEW<i>!</i></em></td>\r\n		    <td align=\"center\"><a href=\"?pg=consumer_tools\">Click Here</a></td></tr>\r\n	{/if}\r\n\r\n	{if 0 neq $totalIncentivePointAdjustments}\r\n	<br style=\"clear:left;\" />\r\n	<tr><td colspan=\"3\"><h3>Adjustments/Redemptions:</h3></td></tr>\r\n        {foreach from=$incentivePointAdjustments item=\"adjustment\" name=\"loopAdjustments\"}<tr><td nowrap>\r\n	<tr><td colspan=\"2\"><small><i>{$adjustment.dateAssigned|date_format2:\"m/d/Y\"}</i> - {$adjustment.comment}</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$adjustment.points}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Total:</em></td>\r\n		<td align=\"center\" nowrap=\"nowrap\"><span class=\"boxed\"><nobr>{$totalIncentivePointAdjustments|default:0}</nobr></span></td></tr>\r\n	{/if}\r\n\r\n	</table>\r\n\r\n</td><td valign=\"top\">\r\n	<h3>Feedback:</h3>\r\n	<table>\r\n	<tr><td>\r\n	<img class=\"icoNurse\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n	</td><td>\r\n	<ul>\r\n		<li><a href=\"javascript:viewSurveys();\">Review My History</a></li>\r\n		{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\r\n		<li><a href=\"?pg=HRAScoreInfo\">HRA Score Info</a></li>\r\n		{/if}\r\n	<ul>\r\n	</td></tr>\r\n	</table>\r\n	<br />\r\n\r\n	{if $aScales|@count gt 0} {* PARTICIPATION POINTS -- IF APPLICABLE *}\r\n	<table align=\"right\">\r\n	<tr><td colspan=\"3\"><h3>Participation Points:</h3></td></tr>\r\n        {foreach from=$aScales item=\"scale\" name=\"loopScales\"}<tr><td nowrap>\r\n	<tr><td>{$scale.name|niceText}</td>\r\n	    <td><small>({$scale.dateStart|date_format2:\"m/d/y\"} - {$scale.dateEnd|date_format2:\"m/d/y\"})</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$aScores[$scale.id]|number_format:\"1\"}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Participation points earned:</em></td>\r\n		<td align=\"right\"><span class=\"boxed\">{$totalParticipationPoints|default:0}</span></td></tr>\r\n	</table>\r\n	{/if}\r\n\r\n	</td></tr>\r\n</table>\r\n</blockquote>'),(4879,291,0.10,'smarty','0','Page created.',1140796718,1124,'216.194.127.150',''),(4880,291,0.11,'smarty','0','Page created.',1140796922,1124,'216.194.127.150','<p><b>What You Need to Know Before Getting Started</b></p>\r\n\r\n<p>Weight loss can be achieved either by eating fewer calories or by burning more calories with physical activity, preferably both.</p>\r\n\r\n<p>A healthy weight loss program consists of: </p>\r\n<li>  A reasonable, realistic weight loss goal</li> \r\n<li> A reduced calorie, nutritionally-balanced eating plan</li> \r\n<li> Regular physical activity </li>\r\n<li> A behavior change plan to help you stay on track with your goals</li>\r\n\r\n<p>We want to help you with each of these components</p>\r\n\r\n<p><b>Keep in Mind</b></p>\r\n<li> Calories count </li>\r\n<li> Portions count </li>\r\n<li>Nutrition counts </li>\r\n<li> Even a small amount of weight loss can lead to big health benefits </li>\r\n<li>  Strive to develop good habits to last a lifetime </li>\r\n<li> Discuss weight loss with your doctor before getting started</li>\r\n\r\n<p><b>Getting Started</b></p>\r\n<li>  Check your Body Mass Index (BMI) - an indicator of body fat - and see where it fits within the BMI categories. </li>\r\n<li> Discuss weight loss with your doctor and decide on a goal. If you have a lot of weight to lose, set a realistic intermediate goal, maybe to lose 10 pounds. Remember that even a small amount of weight loss can lead to big health benefits.</li> \r\n<li> Estimate your calorie needs. Using USDA’s online Adult Energy Needs and BMI Calculator, you can determine the number of calories needed each day to maintain your current weight. To lose about 1 pound per week, subtract 500 calories each day from the daily amount. To lose about 2 pounds per week, subtract 1000 calories daily. </li>\r\n<li> Score your current food intake and physical activity level using MyPyramid Tracker. Taking a good look at your current habits will help you determine what changes you might make as well as what you are doing right.</li>\r\n\r\n<p><b>How Do I Know Which Weight Loss Plan is Right For Me?</b></p>\r\n<li> Keep in mind that you want to develop lifestyle habits that will help you maintain your weight in a healthy range. A short-term \"diet\" that you \"go on\" and then \"go off\" is not the answer to long-term weight management. </li>\r\n<li>  In choosing how to go about losing weight, keep in mind key habits of people who have lost weight and kept in off. These people are called \"Successful Losers\" by the weight control experts who have studied them.*</li>\r\n\r\n\r\n<p><b>Key Behaviors of Successful Losers</b></p>\r\n<li>Getting regular physical activity </li>\r\n<li>Reducing calorie and fat intake </li>\r\n<li>Eating regular meals, including breakfast </li>\r\n<li>Weighing themselves regularly </li>\r\n<li>Not letting small \"slips\" turn into large weight regain </li>\r\n*From The National Weight Control Registry. See \"Long-term Weight Maintenance\" in American Journal of Clinical Nutrition, Vol. 82, No. 1, 222S-225S, July 2005.\r\n<li> If you are considering a commercial weight loss program, read Selecting a Weight Loss Program or Choosing a Safe and Successful Weight-Loss Program. </li>\r\n<li> Ask your doctor if you should have a referral to a Registered Dietitian (R.D.). An R.D. can provide personalized dietary advice taking into consideration other health issues, lifestyle, and food likes and dislikes. </li>\r\n<li> You might also take a look at our Popular Diets page. </li>\r\n\r\n<p><b>Staying On Track with Your Goals</b></p>\r\n\r\n<p>Setting realistic goals and tracking your progress are key to your success. In fact, research has shown that those who keep track of their behaviors are more likely to take off weight and keep it off. A reasonable rate of weight loss is 1 to 2 pounds per week.</p>\r\n'),(4927,196,1.65,'smarty','0','Fixing healthy for life link stuff',1141110421,2,'24.2.76.126','{if $smarty.session.company.preferences.hide_incentives eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n\r\n{* HANDLERS *}\r\n{include_php file=\"shared_handle:company/participationPoints_v2\"}\r\n{include_php file=\"shared_handle:company/surveyList\"}\r\n{include_php file=\"shared_handle:company/incentivePointAdjustments\"}\r\n\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{if $smarty.session.company.preferences.title_my_incentives}{$smarty.session.company.preferences.title_my_incentives}</h1>{else}\r\n<h1>{$page.title}</h1>{/if}\r\n\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n	<img class=\"iconPrize\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n</td><td valign=\"top\" width=\"100%\">\r\n	{$incentiveText|default:\"<em>Yearly Incentive</em><br /><br />Not Yet Determined.\"}	\r\n</td></tr>\r\n</table>\r\n<br />\r\n{assign var=\"surveyPointsEarned\" value=$surveyPointsEarned|default:\"0\"}\r\n{assign var=\"totalIncentivePointAdjustments\" value=$totalIncentivePointAdjustments|default:\"0\"}\r\n<h2 class=\"boxed\"><i>Total Points Earned</i>: <em>{$totalParticipationPoints|math:\"x+$surveyPointsEarned+$totalIncentivePointAdjustments\"}</em></h2>\r\n\r\n<blockquote>\r\n<table width=\"700\">\r\n<tr><td valign=\"top\">\r\n	\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>Available {if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}{else} Surveys:</h3></td>{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}\r\n	{assign var=\"hideCheck\" value=\"hide_survey_`$item.id`\"}\r\n	{if $smarty.session.company.preferences[$hideCheck] neq \"yes\"}\r\n		<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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	{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">>\r\n		None found.</td></tr>\r\n	{/foreach}\r\n\r\n	<tr><td>&nbsp;</td>\r\n	    <td align=\"right\"><em>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}&nbsppoints earned{else}Survey points earned:{/if}</em></td>\r\n	    <td align=\"center\"><span class=\"boxed\">{$surveyPointsEarned|default:0}</span></td></tr>\r\n\r\n	{if $smarty.session.company.preferences.healthyForLifeLink}\r\n	<tr><td colspan=\"2\">\r\n		<h2><a href=\"?pg=healthyForLife\">{$smarty.session.company.preferences.healthyForLifeLink}</a></h2></td>\r\n	    <td valign=\"middle\"></td></tr>\r\n	{/if}\r\n\r\n	{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\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		<tr><td><img class=\"icoStethescope\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>HRA Score</u>:</b>\r\n		    {if ($aHRA.dateTaken eq \"\") OR ($aHRA.dateTaken < $smarty.now|math:\"x - 31536000\")}<br /><a href=\"javascript://\" onclick=\"openSurvey(8);\">Available Now</a>{/if}</td>\r\n		    <td align=\"center\"><em>{$aHRA.pointsEarned}</em></td></tr>\r\n	{/if}\r\n\r\n	{if $vanity eq \"onai\" or $vanity eq \"mycompany\" or $vanity eq \"zions\" or $vanity eq \"zions2\"}\r\n	<tr><td><img class=\"icoWeights\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>Consumer Tools</u>:</b><br /><em>NEW<i>!</i></em></td>\r\n		    <td align=\"center\"><a href=\"?pg=consumer_tools\">Click Here</a></td></tr>\r\n	{/if}\r\n\r\n	{if 0 neq $totalIncentivePointAdjustments}\r\n	<br style=\"clear:left;\" />\r\n	<tr><td colspan=\"3\"><h3>Adjustments/Redemptions:</h3></td></tr>\r\n        {foreach from=$incentivePointAdjustments item=\"adjustment\" name=\"loopAdjustments\"}<tr><td nowrap>\r\n	<tr><td colspan=\"2\"><small><i>{$adjustment.dateAssigned|date_format2:\"m/d/Y\"}</i> - {$adjustment.comment}</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$adjustment.points}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Total:</em></td>\r\n		<td align=\"center\" nowrap=\"nowrap\"><span class=\"boxed\"><nobr>{$totalIncentivePointAdjustments|default:0}</nobr></span></td></tr>\r\n	{/if}\r\n\r\n	</table>\r\n\r\n</td><td valign=\"top\">\r\n	<h3>Feedback:</h3>\r\n	<table>\r\n	<tr><td>\r\n	<img class=\"icoNurse\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n	</td><td>\r\n	<ul>\r\n		<li><a href=\"javascript:viewSurveys();\">Review My History</a></li>\r\n		{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\r\n		<li><a href=\"?pg=HRAScoreInfo\">HRA Score Info</a></li>\r\n		{/if}\r\n	<ul>\r\n	</td></tr>\r\n	</table>\r\n	<br />\r\n\r\n	{if $aScales|@count gt 0} {* PARTICIPATION POINTS -- IF APPLICABLE *}\r\n	<table align=\"right\">\r\n	<tr><td colspan=\"3\"><h3>Participation Points:</h3></td></tr>\r\n        {foreach from=$aScales item=\"scale\" name=\"loopScales\"}<tr><td nowrap>\r\n	<tr><td>{$scale.name|niceText}</td>\r\n	    <td><small>({$scale.dateStart|date_format2:\"m/d/y\"} - {$scale.dateEnd|date_format2:\"m/d/y\"})</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$aScores[$scale.id]|number_format:\"1\"}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Participation points earned:</em></td>\r\n		<td align=\"right\"><span class=\"boxed\">{$totalParticipationPoints|default:0}</span></td></tr>\r\n	</table>\r\n	{/if}\r\n\r\n	</td></tr>\r\n</table>\r\n</blockquote>'),(4688,274,0.17,'smarty','0','Page created.',1135919715,3,'24.2.76.126','{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n<br />\r\n<table width=\"100%\">\r\n<tr>\r\n  <td valign=\"top\">\r\n   <h2>Already a Member?:</h2>\r\n   Login..\r\n  </td>\r\n  <td valign=\"top\">\r\n   <h2>Create an Account:</h2>\r\n   <table>\r\n   <tr>\r\n     <td>First Name:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Last Name:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Userame:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Email:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Password:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Retype Pass:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Birth Date:</td>\r\n     <td><input type=\"text\" size=\"2\" /> <input type=\"text\" size=\"2\" /> <input type=\"text\" size=\"2\" /> </td>\r\n   </tr>\r\n   <tr>\r\n     <td>Current Weight:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Hide Weight?:</td>\r\n     <td><input type=\"radio\" checked=\"checked\" /> Yes <input type=\"radio\" /> No </td>\r\n   </tr>\r\n   <tr>\r\n     <td>Gender?:</td>\r\n     <td nowrap=\"nowrap\"><input type=\"radio\" /> Not Specified <input type=\"radio\" checked=\"checked\" /> Male <input type=\"radio\" /> Female</td>\r\n   </tr>\r\n   <tr>\r\n     <td>Terms:</td>\r\n     <td><input type=\"checkbox\" /> I have read and agree to the <a href=\"#\">Terms of Use</a>.</td>\r\n   </tr>\r\n   <tr>\r\n     <td>&nbsp;</td>\r\n     <td><input type=\"button\" value=\"Create My Account!\" /></td>\r\n   </tr>\r\n   </table>\r\n  </td>\r\n</tr>\r\n</table>'),(4689,274,0.18,'smarty','0','Page created.',1135919825,3,'24.2.76.126','{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n<br />\r\n<table width=\"100%\">\r\n<tr>\r\n  <td valign=\"top\">\r\n   <h2>Already a Member?:</h2>\r\n   Login..\r\n  </td>\r\n  <td valign=\"top\">\r\n   <h2>Create an Account:</h2>\r\n   <table>\r\n   <tr>\r\n     <td>First Name:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Last Name:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Userame:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Email:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Password:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Retype Pass:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Birth Date:</td>\r\n     <td><input type=\"text\" size=\"2\" /> <input type=\"text\" size=\"2\" /> <input type=\"text\" size=\"2\" /> </td>\r\n   </tr>\r\n   <tr>\r\n     <td>Current Weight:</td>\r\n     <td><input type=\"text\" /></td>\r\n   </tr>\r\n   <tr>\r\n     <td>Hide Weight?:</td>\r\n     <td><input type=\"radio\" checked=\"checked\" /> Yes <input type=\"radio\" /> No </td>\r\n   </tr>\r\n   <tr>\r\n     <td>Gender?:</td>\r\n     <td nowrap=\"nowrap\"><input type=\"radio\" /> Not Specified <input type=\"radio\" checked=\"checked\" /> Male <input type=\"radio\" /> Female</td>\r\n   </tr>\r\n   <tr>\r\n     <td>Terms:</td>\r\n     <td><input type=\"checkbox\" /> I have read and agree to the <a href=\"#\">Terms of Use</a>.</td>\r\n   </tr>\r\n   <tr>\r\n     <td>&nbsp;</td>\r\n     <td><input type=\"button\" value=\"Create My Account!\" onclick=\"location.replace(\'?pg=compCreate/step4\');\" /></td>\r\n   </tr>\r\n   </table>\r\n  </td>\r\n</tr>\r\n</table>'),(4690,275,0.10,'smarty','0','Page created.',1135919832,3,'24.2.76.126',''),(4929,196,1.67,'smarty','0','Fixing healthy for life link stuff',1141110616,2,'24.2.76.126','{if $smarty.session.company.preferences.hide_incentives eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n\r\n{* HANDLERS *}\r\n{include_php file=\"shared_handle:company/participationPoints_v2\"}\r\n{include_php file=\"shared_handle:company/surveyList\"}\r\n{include_php file=\"shared_handle:company/incentivePointAdjustments\"}\r\n\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{if $smarty.session.company.preferences.title_my_incentives}{$smarty.session.company.preferences.title_my_incentives}</h1>{else}\r\n<h1>{$page.title}</h1>{/if}\r\n\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n	<img class=\"iconPrize\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n</td><td valign=\"top\" width=\"100%\">\r\n	{$incentiveText|default:\"<em>Yearly Incentive</em><br /><br />Not Yet Determined.\"}	\r\n</td></tr>\r\n</table>\r\n<br />\r\n{assign var=\"surveyPointsEarned\" value=$surveyPointsEarned|default:\"0\"}\r\n{assign var=\"totalIncentivePointAdjustments\" value=$totalIncentivePointAdjustments|default:\"0\"}\r\n<h2 class=\"boxed\"><i>Total Points Earned</i>: <em>{$totalParticipationPoints|math:\"x+$surveyPointsEarned+$totalIncentivePointAdjustments\"}</em></h2>\r\n\r\n<blockquote>\r\n<table width=\"700\">\r\n<tr><td valign=\"top\">\r\n	\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>Available {if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}{else} Surveys:</h3></td>{/if}\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}\r\n	{assign var=\"hideCheck\" value=\"hide_survey_`$item.id`\"}\r\n	{if $smarty.session.company.preferences[$hideCheck] neq \"yes\"}\r\n		<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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=\"sIco ico{$item.icon}\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></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	{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">>\r\n		None found.</td></tr>\r\n	{/foreach}\r\n\r\n	<tr><td>&nbsp;</td>\r\n	    <td align=\"right\"><em>{if $smarty.session.company.preferences.change_word_survey}{$smarty.session.company.preferences.change_word_survey}&nbsppoints earned{else}Survey points earned:{/if}</em></td>\r\n	    <td align=\"center\"><span class=\"boxed\">{$surveyPointsEarned|default:0}</span></td></tr>\r\n\r\n	{if $smarty.session.company.preferences.healthyForLifeLink}\r\n	<tr><td colspan=\"2\">\r\n		<ul><li><a href=\"?pg=healthyForLife\">{$smarty.session.company.preferences.healthyForLifeLink}</a></li></ul></td>\r\n	    <td valign=\"middle\"></td></tr>\r\n	{/if}\r\n\r\n	{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\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		<tr><td><img class=\"icoStethescope\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>HRA Score</u>:</b>\r\n		    {if ($aHRA.dateTaken eq \"\") OR ($aHRA.dateTaken < $smarty.now|math:\"x - 31536000\")}<br /><a href=\"javascript://\" onclick=\"openSurvey(8);\">Available Now</a>{/if}</td>\r\n		    <td align=\"center\"><em>{$aHRA.pointsEarned}</em></td></tr>\r\n	{/if}\r\n\r\n	{if $vanity eq \"onai\" or $vanity eq \"mycompany\" or $vanity eq \"zions\" or $vanity eq \"zions2\"}\r\n	<tr><td><img class=\"icoWeights\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" /></td>\r\n		    <td><b><u>Consumer Tools</u>:</b><br /><em>NEW<i>!</i></em></td>\r\n		    <td align=\"center\"><a href=\"?pg=consumer_tools\">Click Here</a></td></tr>\r\n	{/if}\r\n\r\n	{if 0 neq $totalIncentivePointAdjustments}\r\n	<br style=\"clear:left;\" />\r\n	<tr><td colspan=\"3\"><h3>Adjustments/Redemptions:</h3></td></tr>\r\n        {foreach from=$incentivePointAdjustments item=\"adjustment\" name=\"loopAdjustments\"}<tr><td nowrap>\r\n	<tr><td colspan=\"2\"><small><i>{$adjustment.dateAssigned|date_format2:\"m/d/Y\"}</i> - {$adjustment.comment}</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$adjustment.points}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Total:</em></td>\r\n		<td align=\"center\" nowrap=\"nowrap\"><span class=\"boxed\"><nobr>{$totalIncentivePointAdjustments|default:0}</nobr></span></td></tr>\r\n	{/if}\r\n\r\n	</table>\r\n\r\n</td><td valign=\"top\">\r\n	<h3>Feedback:</h3>\r\n	<table>\r\n	<tr><td>\r\n	<img class=\"icoNurse\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" />\r\n	</td><td>\r\n	<ul>\r\n		<li><a href=\"javascript:viewSurveys();\">Review My History</a></li>\r\n		{if $smarty.session.company.preferences.hide_survey_hra neq \"yes\"}\r\n		<li><a href=\"?pg=HRAScoreInfo\">HRA Score Info</a></li>\r\n		{/if}\r\n	<ul>\r\n	</td></tr>\r\n	</table>\r\n	<br />\r\n\r\n	{if $aScales|@count gt 0} {* PARTICIPATION POINTS -- IF APPLICABLE *}\r\n	<table align=\"right\">\r\n	<tr><td colspan=\"3\"><h3>Participation Points:</h3></td></tr>\r\n        {foreach from=$aScales item=\"scale\" name=\"loopScales\"}<tr><td nowrap>\r\n	<tr><td>{$scale.name|niceText}</td>\r\n	    <td><small>({$scale.dateStart|date_format2:\"m/d/y\"} - {$scale.dateEnd|date_format2:\"m/d/y\"})</small></td>\r\n	    <td valign=\"middle\" align=\"right\"><em>{$aScores[$scale.id]|number_format:\"1\"}</em></td></tr>\r\n        {foreachelse}\r\n		<tr><td colspan=\"3\">None.</td></tr>\r\n        {/foreach}\r\n	<tr><td colspan=\"2\" align=\"right\"><em>Participation points earned:</em></td>\r\n		<td align=\"right\"><span class=\"boxed\">{$totalParticipationPoints|default:0}</span></td></tr>\r\n	</table>\r\n	{/if}\r\n\r\n	</td></tr>\r\n</table>\r\n</blockquote>'),(4695,275,0.14,'smarty','0','Page created.',1135921128,3,'24.2.76.126','{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<br />\r\n<h2>Competition Fee Payment</h2>\r\n\r\n<b>Competition title</b><br />\r\nEtc.<br />\r\netc.<br />\r\n\r\n<table width=\"100%\">\r\n<tr>\r\n  <td><b>Billing Information:</b>\r\n	<p>Enter the billing information for the credit card owner.<br />\r\n	<small>(* indicates a required field)</small></p>\r\n	\r\n	<div id=\"billInfo\" style=\"text-align:right;\">\r\n	*First Name:\r\n	<input type=\"text\" name=\"bill[firstname]\" value=\"{$smarty.request.bill.firstname|default:$userInfo.firstName}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n	*Last Name:\r\n	<input type=\"text\" name=\"bill[lastname]\" value=\"{$smarty.request.bill.lastname|default:$userInfo.lastName}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	Company:\r\n	<input type=\"text\" name=\"bill[company]\" value=\"{$smarty.request.bill.company|default:$userInfo.company}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	*Address:\r\n	<input type=\"text\" name=\"bill[address1]\" value=\"{$smarty.request.bill.address1|default:$userInfo.address1}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n	Line 2:\r\n	<input type=\"text\" name=\"bill[address2]\" value=\"{$smarty.request.bill.address2|default:$userInfo.address2}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	*City:\r\n	<input type=\"text\" name=\"bill[city]\" value=\"{$smarty.request.bill.city|default:$userInfo.city}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	*State, *Zip:\r\n	<input type=\"text\" name=\"bill[state]\" value=\"{$smarty.request.bill.state|default:$userInfo.state}\" class=\"textInput\" style=\"width:30px;\" maxlength=\"2\" />\r\n	<input type=\"text\" name=\"bill[zip]\" value=\"{$smarty.request.bill.zip|default:$userInfo.zip}\" class=\"textInput\" style=\"width:50px;\" /><br />\r\n\r\n	*Country:\r\n	<input type=\"text\" name=\"bill[country]\" value=\"{$smarty.request.bill.country|default:$userInfo.country}\" class=\"textInput\" style=\"width:200px;\" maxlength=\"30\" /><br />\r\n\r\n	*Phone:<small>(xxx-xxx-xxxx)\r\n	<input type=\"text\" name=\"bill[phone]\" value=\"{$smarty.request.bill.phone|default:$userInfo.phone}\" class=\"textInput\" style=\"width:200px;\" maxlength=\"80\" /><br />\r\n	</div>\r\n</div>\r\n</td>\r\n  <td><b>Payment Information:</b>\r\n\r\n	<script language=\"javascript\">{literal}\r\n	function verifyFormatCcnum(obj) {\r\n		if (obj.value.match(/[^\\d]/)) {\r\n			alert(\'The Credit Card Number should contain no dashes or spaces.\\n\\nI.E.  4007000000027\');\r\n			obj.value = obj.value.replace(/[^\\d]/g, \'\');\r\n			obj.focus();\r\n		}\r\n	}\r\n	function verifyFormatCcexp(obj) {\r\n		if (obj.value.match(/[^\\d]/)) {\r\n			alert(\'The format for Credit Card expiration date is MMYY with no slash.\\n\\nI.E.  0606  for June, 2006\');\r\n			obj.value = obj.value.replace(/[^\\d]/g, \'\');\r\n			obj.focus();\r\n		}\r\n	}\r\n	{/literal}</script>\r\n\r\n        <div style=\"text-align:right;\">\r\n	Payment Method:\r\n	<select name=\"bill[paymentMethod]\" size=\"1\">\r\n		<option value=\"visa\"{if $smarty.request.bill.paymentMethod eq \"visa\"} selected{/if}>Visa</option>\r\n		<option value=\"mastercard\"{if $smarty.request.bill.paymentMethod eq \"mastercard\"} selected{/if}>Mastercard</option>\r\n		<option value=\"american express\"{if $smarty.request.bill.paymentMethod eq \"american express\"} selected{/if}>American Express</option>\r\n		<option value=\"discover\"{if $smarty.request.bill.paymentMethod eq \"discover\"} selected{/if}>Discover</option>\r\n	</select><br />\r\n\r\n	Card Number:\r\n	<input type=\"text\" name=\"bill[ccnum]\" value=\"\" class=\"textInput\" style=\"width:200px;\" onchange=\"verifyFormatCcnum(this);\" onkeyup=\"verifyFormatCcnum(this);\" /><br />\r\n\r\n	Expiration Date: <small>(MMYY)</small>\r\n	<input type=\"text\" name=\"bill[ccexp]\" value=\"\" class=\"textInput\" maxlength=\"4\" style=\"width:50px;\" onchange=\"verifyFormatCcexp(this);\" onkeyup=\"verifyFormatCcexp(this);\" /><br />\r\n        </div>\r\n</td>\r\n</tr>\r\n</table>\r\n'),(4696,275,0.15,'smarty','0','Page created.',1135921280,3,'24.2.76.126','{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<br />\r\n<h2>Competition Fee Payment</h2>\r\n\r\n<b>Competition title</b><br />\r\nEtc.<br />\r\netc.<br />\r\n\r\n<table width=\"100%\">\r\n<tr>\r\n  <td valign=\"top\"><b>Billing Information:</b>\r\n	<p>Enter the billing information for the credit card owner.<br />\r\n	<small>(* indicates a required field)</small></p>\r\n	\r\n	<div id=\"billInfo\" style=\"text-align:right;\">\r\n	*First Name:\r\n	<input type=\"text\" name=\"bill[firstname]\" value=\"{$smarty.request.bill.firstname|default:$userInfo.firstName}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n	*Last Name:\r\n	<input type=\"text\" name=\"bill[lastname]\" value=\"{$smarty.request.bill.lastname|default:$userInfo.lastName}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	Company:\r\n	<input type=\"text\" name=\"bill[company]\" value=\"{$smarty.request.bill.company|default:$userInfo.company}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	*Address:\r\n	<input type=\"text\" name=\"bill[address1]\" value=\"{$smarty.request.bill.address1|default:$userInfo.address1}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n	Line 2:\r\n	<input type=\"text\" name=\"bill[address2]\" value=\"{$smarty.request.bill.address2|default:$userInfo.address2}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	*City:\r\n	<input type=\"text\" name=\"bill[city]\" value=\"{$smarty.request.bill.city|default:$userInfo.city}\" class=\"textInput\" style=\"width:200px;\" /><br />\r\n\r\n	*State, *Zip:\r\n	<input type=\"text\" name=\"bill[state]\" value=\"{$smarty.request.bill.state|default:$userInfo.state}\" class=\"textInput\" style=\"width:30px;\" maxlength=\"2\" />\r\n	<input type=\"text\" name=\"bill[zip]\" value=\"{$smarty.request.bill.zip|default:$userInfo.zip}\" class=\"textInput\" style=\"width:50px;\" /><br />\r\n\r\n	*Country:\r\n	<input type=\"text\" name=\"bill[country]\" value=\"{$smarty.request.bill.country|default:$userInfo.country}\" class=\"textInput\" style=\"width:200px;\" maxlength=\"30\" /><br />\r\n\r\n	*Phone:<small>(xxx-xxx-xxxx)\r\n	<input type=\"text\" name=\"bill[phone]\" value=\"{$smarty.request.bill.phone|default:$userInfo.phone}\" class=\"textInput\" style=\"width:200px;\" maxlength=\"80\" /><br />\r\n	</div>\r\n</div>\r\n</td>\r\n  <td valign=\"top\"><b>Payment Information:</b>\r\n\r\n	<script language=\"javascript\">{literal}\r\n	function verifyFormatCcnum(obj) {\r\n		if (obj.value.match(/[^\\d]/)) {\r\n			alert(\'The Credit Card Number should contain no dashes or spaces.\\n\\nI.E.  4007000000027\');\r\n			obj.value = obj.value.replace(/[^\\d]/g, \'\');\r\n			obj.focus();\r\n		}\r\n	}\r\n	function verifyFormatCcexp(obj) {\r\n		if (obj.value.match(/[^\\d]/)) {\r\n			alert(\'The format for Credit Card expiration date is MMYY with no slash.\\n\\nI.E.  0606  for June, 2006\');\r\n			obj.value = obj.value.replace(/[^\\d]/g, \'\');\r\n			obj.focus();\r\n		}\r\n	}\r\n	{/literal}</script>\r\n\r\n        <div style=\"text-align:right;\">\r\n	Payment Method:\r\n	<select name=\"bill[paymentMethod]\" size=\"1\">\r\n		<option value=\"visa\"{if $smarty.request.bill.paymentMethod eq \"visa\"} selected{/if}>Visa</option>\r\n		<option value=\"mastercard\"{if $smarty.request.bill.paymentMethod eq \"mastercard\"} selected{/if}>Mastercard</option>\r\n		<option value=\"american express\"{if $smarty.request.bill.paymentMethod eq \"american express\"} selected{/if}>American Express</option>\r\n		<option value=\"discover\"{if $smarty.request.bill.paymentMethod eq \"discover\"} selected{/if}>Discover</option>\r\n	</select><br />\r\n\r\n	Card Number:\r\n	<input type=\"text\" name=\"bill[ccnum]\" value=\"\" class=\"textInput\" style=\"width:200px;\" onchange=\"verifyFormatCcnum(this);\" onkeyup=\"verifyFormatCcnum(this);\" /><br />\r\n\r\n	Expiration Date: <small>(MMYY)</small>\r\n	<input type=\"text\" name=\"bill[ccexp]\" value=\"\" class=\"textInput\" maxlength=\"4\" style=\"width:50px;\" onchange=\"verifyFormatCcexp(this);\" onkeyup=\"verifyFormatCcexp(this);\" /><br />\r\n        </div>\r\n</td>\r\n</tr>\r\n</table>\r\n'),(4968,272,0.64,'smarty','0','David JS Working...',1142037239,2271,'216.194.127.150','{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<form method=\"post\" action=\"index.php\">\r\n<table width=\"100%\" border=0>\r\n <tr>\r\n  <td nowrap><h2> A. Competing for...</h2></td>\r\n  <td nowrap><h2>B. The competition name is...</h2></td>\r\n  <td nowrap><h2>C. How\'s competing...</h2></td>\r\n </tr>\r\n <tr>\r\n  <td valign=\"top\" width=\"30%\">\r\n    <small>\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"p2p\" checked> <a href=\"javascript:setCompType(\'p2p\');\">Pound for pound <i>(Weight lost)</i></a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"pctWt\"> <a href=\"javascript:setCompType(\'pctWt\');\">Percent of body weight lost</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"minEx\"> <a href=\"javascript:setCompType(\'minEx\');\">Total minutes excercised</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"disEx\"> <a href=\"javascript:setCompType(\'disEx\');\">Total distance excercised</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"veg\"> <a href=\"javascript:setCompType(\'veg\');\">Vegitable challenge</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"gain\"> <a href=\"javascript:setCompType(\'gain\');\">Weight gained</a><br />\r\n    </small>\r\n  </td>\r\n  <td valign=\"top\">\r\n    <table border=0 cellspacing=0>\r\n    <tr>\r\n      <td><h3>Name:</h3></td>\r\n      <td><input type=\"text\" name=\"comp[title]\" /></td>\r\n    </tr>\r\n    <tr>\r\n      <td valign=\"top\"><small><b>Examples:</b></small></td>\r\n      <td><small>&quot;The chubby family reunion&quot;<br />&quot;Company shape-up marathon&quot;<br />&quot;Super Summer Slimdown&quot;</small></td>\r\n    </tr>\r\n    <tr>\r\n      <td colspan=\"2\">\r\n	<br/>\r\n        <div style=\"border:solid 1px black;width:98%;height:60px;\">\r\n	  test\r\n	</div>\r\n      </td>\r\n    </tr>\r\n    </table>\r\n  </td>\r\n  <td valign=\"top\">\r\n     <table border=0 cellpaddin=0 cellspacing=0>\r\n      <tr>\r\n	<td colspan=\"2\">\r\n	  <div id=\'enterFriendNameDiv\' style=\'display:block;\'>\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	     <tr>\r\n	       <td colspan=2><li>Invate your friends</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Name:\r\n                 </small>\r\n	       </td>\r\n	       <td>\r\n	         <input type=\"text id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Email:\r\n	         </small>\r\n	       </td>\r\n	       <td>\r\n		  <input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td colspan=\"2\" align=\"right\">\r\n	         <small>\r\n		   <span onclick=\"extraCompetitors(\'open\');\" style=\"cursor:pointer;\">\r\n                     Add more\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	  <div>\r\n	  <div id=\"myEnteredFriendsDiv\" style=\"display:none;\">\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	     <tr>\r\n	       <td colspan=2><li>Invate your friends</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Name:\r\n                 </small>\r\n	       </td>\r\n	       <td>\r\n	         <input type=\"text id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Email:\r\n	         </small>\r\n	       </td>\r\n	       <td>\r\n		  <input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td colspan=\"2\" align=\"right\">\r\n	         <small>\r\n		   <span onclick=\"extraCompetitors(\'open\');\" style=\"cursor:pointer;\">\r\n                     Add more\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	  </div>\r\n	</td>\r\n      </tr>\r\n      <tr><td colspan=\"2\"><li>Let them know with an email...</li></td></tr>\r\n      <tr>\r\n        <td valign=\"top\" colspan=2>\r\n	  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	      <tr>\r\n		 <td valign=\"top\">\r\n		    <small>\r\n			<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n			  <tr><td id=\'kind\'><input type=\"radio\" value=\"kind\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'kind\');\"/> <a href=\"javascript:setInviteStyle(\'kind\');\">Kind</a></td></tr>\r\n			  <tr><td id=\'smack\'><input type=\"radio\" value=\"smack\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'smack\');\"/> <a href=\"javascript:setInviteStyle(\'smack\');\">Smack</a></td></tr>\r\n			  <tr><td id=\'challenge\'><input type=\"radio\" value=\"challenge\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'challenge\');\" /> <a href=\"javascript:setInviteStyle(\'challenge\');\">Challenge</a></td></tr>\r\n			  <tr><td id=\'custom\'><input type=\"radio\" value=\"custom\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'custom\');\"/> <a href=\"javascript:setInviteStyle(\'custom\');\">Make Your Own</a></td></tr>\r\n                        </table>\r\n		    </small>\r\n		 </td>\r\n		 <td valign=\"top\" id=\"invateHolder\">\r\n		    <div id=\"InvateW\" style=\"border-bottom:solid 1px #CCC;border-left:solid 1px #CCC;padding-right:5px;visibility:hidden;\">\r\n			<small>\r\n			   <input type=\"radio\" value=\"heavy\" name=\"comp[invite_subtype]\" /> <a href=\"javascript:setInviteWeight(\'heavy\');\">Heavy</a><br />\r\n			   <input type=\"radio\" value=\"medium\" name=\"comp[invite_subtype]\" /> <a href=\"javascript:setInviteWeight(\'medium\');\">Medium</a><br />\r\n			   <input type=\"radio\" value=\"light\" name=\"comp[invite_subtype]\" /> <a href=\"javascript:setInviteWeight(\'light\');\">Light</a><br />\r\n			</small>\r\n		    </div>\r\n		</td>\r\n	     </tr>\r\n	  </table>\r\n        </td>\r\n     </tr>\r\n     </table>\r\n  </td>\r\n</tr>\r\n</table>\r\n<br />\r\n<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n   <td align=\"right\">tab</td>\r\n </tr>\r\n <tr>\r\n   <td>\r\n      <div id=\"letterHolder\" name=\"letterHolder\" style=\"border:solid 1px black;height:410px;width:100%\">\r\n      </div>\r\n   </td>\r\n </tr>\r\n</table>\r\n{* <iframe src=\"?pg=compCreate/inviteFrame\" style=\"width:100%;height:410px;\" scrollbars=\"no\" frameborder=\"0\"></iframe> *}\r\n\r\n<div id=\"invite-div\"></div>\r\n<br />\r\n\r\n<div align=\"right\">\r\n  <a href=\"?pg=compCreate/step2\"><img src=\"{$skinFolder}images/btn_next.gif\" alt=\"Next\" border=\"0\" /></a>\r\n</div>\r\n\r\n<div id=\"myCompetitors\" style=\"width:300px;background-color:white;zIndex:100;position:absolute;display:none;top:-70px;left:300px;border:solid 1px #CCC;filter: alpha(opacity=85)\">\r\n  <center>\r\n   <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"95%\">\r\n      <tr><td align=\"right\" valign=\"top\" style=\"height:5px\"><small><span style=\"cursor:pointer;\" onclick=\"extraCompetitors(\'close\');\">close window</span><small></td></tr>\r\n      <tr><td style=\"border-bottom:solid 1px #CCC;\"><h2>More Competitors...</td></tr>\r\n      <tr>\r\n         <td align=\"center\">\r\n	    <table id=\"competitorsTable\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"90%\">\r\n                <tr>\r\n		  <td></td>\r\n		  <td align=\"center\" valign=\"bottom\">Name</td>\r\n                  <td align=\"center\" valign=\"bottom\">Email</td>\r\n                </tr>\r\n	        <tr>\r\n		  <td>2.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>3.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>4.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>5.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>6.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>7.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>8.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>9.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>10.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>11.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n		<tr>\r\n		  <td colspan=\"3\" align=\"right\"><small><span style=\"cursor:pointer;\" onclick=\'addMoreCompetitors();\'>Add More Lines</span></small></td>\r\n		</tr>\r\n            </table>\r\n         </td>\r\n      </tr>\r\n      <tr>\r\n	<td align=\"right\" style=\"border-top:solid 1px #CCC;\"><img style=\"cursor:pointer;\" onclick=\"addingCompetitors();\" src=\"{$skinFolder}images/btn_next.gif\" alt=\"Add\" border=\"0\" /></td>\r\n      </tr>\r\n   </table>\r\n  </center>\r\n</div>\r\n\r\n</form>\r\n\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/js-get-data.js\"></script>\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/AJAX.js\"></script>\r\n\r\n<script language=\"JavaScript\">\r\n	\r\n        //jsGetData(\'?pg=jsGetData\',\'invite-div\', \'madlib.form\', \'&compType=friends&inviteType=smack\');\r\n\r\n	var examples = Array();\r\n	{foreach from=$examples key=\"key\" item=\"example\"}\r\n	examples[{$key}] = \'{eval var=$example.body|addslashes|replace:\"\\r\":\"\"|replace:\"\\n\":\"\\\\n\"}\';\r\n	{/foreach}\r\n	\r\n	{literal}\r\n	function setCompType(type) {\r\n		checkValue(type, \'comp[type]\');\r\n	}\r\n\r\n	function setInviteStyle(type) {\r\n		checkValue(type, \'comp[invite_type]\');\r\n		var oInvateW = document.getElementById(\'InvateW\');\r\n		\r\n		if(type == \'custom\')\r\n		  oInvateW.style.visibility = \"hidden\";\r\n		else\r\n 		  oInvateW.style.visibility = \"visible\";\r\n\r\n		var oInvateWHolder = document.getElementById(\"invateHolder\");\r\n		switch(type)\r\n		{\r\n		   case \"kind\":\r\n			oInvateWHolder.style.paddingTop = \"0\";\r\n			break;\r\n		   case \"smack\":\r\n			oInvateWHolder.style.paddingTop = \"8px\";\r\n			break;\r\n		   case \"challenge\":\r\n			oInvateWHolder.style.paddingTop = \"15px\";\r\n			break;\r\n		}\r\n	        setTypeUnderLine(type);\r\n		return;\r\n 	}\r\n\r\n	function setInviteWeight(type) {\r\n		checkValue(type, \'comp[invite_subtype]\');\r\n	}\r\n\r\n	function checkValue(type, eName) {\r\n		var aInput=document.getElementsByName(eName);\r\n		for (i = 0; i < aInput.length; i++)\r\n		{\r\n		   aInput[i].checked = (aInput[i].value == type) ? true : false;\r\n		}\r\n	   return;\r\n	}\r\n\r\n	/*  This functions should go inside of JS file  *******/\r\n\r\n	var prevType = \"\";\r\n	function setTypeUnderLine(type)\r\n	{\r\n	    if(prevType != \"\")\r\n	    {\r\n		var oldTypeLine = eval(\"document.getElementById(\'\"+prevType+\"\')\");\r\n		oldTypeLine.style.borderBottom = \"\";\r\n            }\r\n	    var oTypeLine = eval(\"document.getElementById(\'\"+type+\"\')\");\r\n	    oTypeLine.style.borderBottom = type == \'custom\' ? \"\" : \"solid 1px #CCC\";\r\n	    prevType = type;\r\n	    return;\r\n	}\r\n\r\n	// This function adds a new row in the CompetitorsTable to add more competitors\r\n        // the current limit of competitors is 10\r\n	function addMoreCompetitors()\r\n	{\r\n	  var oTable = document.getElementById(\"competitorsTable\");\r\n	  var rowNum = oTable.rows.length - 1;\r\n          if(rowNum >= 15){\r\n		alert(\'message: No more than 15\');\r\n		return;\r\n	  }\r\n	  var w = oTable.insertRow(rowNum);\r\n	  var x = w.insertCell(0);\r\n	  var y = w.insertCell(1);\r\n	  var z = w.insertCell(2);\r\n	\r\n	  rowNum++;\r\n	  x.innerHTML = rowNum + \".\";\r\n	  y.innerHTML = \"<input type=\'text\' id=\'comp[competitor_name]\' name=\'comp[competitor_name]\' style=\'width:110px;\' />\";\r\n	  z.innerHTML = \"<input type=\'text\' id=\'comp[competitor_email]\' name=\'comp[competitor_email]\' style=\'width:110px;\' />\";\r\n	  \r\n	  return;\r\n	}\r\n\r\n	function extraCompetitors(type){\r\n	  var oDiv = document.getElementById(\"myCompetitors\");\r\n\r\n	  if(type == \"close\"){\r\n	     oDiv.style.display = \"none\";\r\n	  }else{\r\n	      var nameValidator = document.getElementsByName(\"comp[competitor_name]\");\r\n	      var emailValidator = document.getElementsByName(\"comp[competitor_email]\");\r\n	\r\n		/*alert(nameValidator[0].value);\r\n		alert(emailValidator[0].value);*/\r\n	        if(nameValidator[0].value != \"\" && emailValidator[0].value != \"\")\r\n		{\r\n		   var goOn = validateEmail(emailValidator[0].value,0);\r\n		   if(!goOn)\r\n		     return;\r\n     \r\n		   oDiv.style.display = \"block\";\r\n	        }\r\n		else\r\n		{\r\n		   if(nameValidator[0].value == \"\" && emailValidator[0].value == \"\"){\r\n			alert(\"Please enter the information of your first competitor before adding more competitors\");\r\n			return;\r\n		   }\r\n		   if(nameValidator[0].value == \"\"){\r\n		   	alert(\"Please enter the name of your first competitor before adding more competitors\");\r\n			return;\r\n		   }\r\n		   if(emailValidator[0].value == \"\"){\r\n			alert(\"Please enter the email of your first competitor before adding more competitors\");\r\n			return;\r\n		   }\r\n\r\n	        }\r\n	  }\r\n	  return;\r\n	}\r\n\r\n	function validateEmail(email,comp){\r\n	  var validated = false;\r\n	  var at = false;\r\n	  var dot = false;\r\n	  comp = comp + 1;\r\n\r\n	  if(email.indexOf(\"@\") > -1)\r\n		at = true;\r\n\r\n	  if(email.indexOf(\".\") > -1)\r\n		dot = true;\r\n\r\n\r\n	  if(dot && at)\r\n		validated = true;\r\n\r\n	  if(!dot && at)\r\n	     alert(\'Please correct the email address for competitor \'+comp+\', (.) character missing\');\r\n\r\n	  if(!at && dot)\r\n	     alert(\'Please correct the email address for competitor \'+comp+\', (@) character missing\');\r\n\r\n	  if(!validated && !at && !dot)\r\n	     alert(\'Please enter a valid email address for competitor \'+comp);\r\n	\r\n	  return validated;        \r\n	}\r\n\r\n	function addingCompetitors()\r\n        {\r\n	   var nameValidator = document.getElementsByName(\"comp[competitor_name]\");\r\n	   var emailValidator = document.getElementsByName(\"comp[competitor_email]\");\r\n	   var validator,j;\r\n	   var nameList = \"\";\r\n\r\n	   for(i=1;i<nameValidator.length;i++)\r\n	   {\r\n	      if(emailValidator[i].value != \"\" && nameValidator[i].value == \"\"){\r\n		 highLigh(\'competitorsTable\',i,1,false);\r\n		 j = i + 1;\r\n		 alert(\'Please enter a name for competitor \'+j);\r\n	         return false;\r\n	      }\r\n	      if(nameValidator[i].value != \"\"){\r\n	         validator = validateEmail(emailValidator[i].value,i);\r\n		 highLigh(\'competitorsTable\',i,2,validator);\r\n		 highLigh(\'competitorsTable\',i,1,true);\r\n		 nameList += nameValidator[i].value + \",\";\r\n		 if(!validator){\r\n		   return false;\r\n	         }\r\n	      }\r\n	   }\r\n	}\r\n\r\n	function highLigh(tableName,row,cell,validator){\r\n	   var oTable = eval(\"document.getElementById(\'\"+tableName+\"\')\");\r\n	   var highLightRow = oTable.rows[row].cells[cell];\r\n	   highLightRow.style.backgroundColor = !validator ? \"darkred\" : \"\";\r\n           return;\r\n	}\r\n\r\n	{/literal}\r\n</script>'),(4700,271,0.29,'smarty','0','Page created.',1135922602,2,'24.2.76.126','{include_php file=\"shared_handle:company_management/reports/incentives-summary\"}\r\n<h1>{$page.title}</h1>\r\n<h2>{$smarty.session.company.companyName}</h2>\r\n\r\n<hr />\r\n\r\n<div style=\"width:400px;\">\r\n<h3 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'configure\', \'\', \'showHide\');\"><img id=\"configure_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Configure</h3>\r\n\r\n<script type=\"text/javascript\">\r\n{literal}\r\nfunction changeOrder(ord) {\r\n	document.forms.configure.order.value = ord;\r\n	document.forms.configure.submit();\r\n}\r\n{/literal}\r\n</script>\r\n\r\n<div id=\"configure\" style=\"display:none; margin-left:20px;\">\r\n	<form name=\"configure\" method=\"get\" action=\"index.php\" style=\"margin:0px;\">\r\n	<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\" />\r\n	<input type=\"hidden\" name=\"order\" value=\"{$smarty.request.order}\" />\r\n\r\n	<div style=\"float:right;\"><small>&quot;Range Offset&quot; will allow each range to begin at an offset value.</small></div>\r\n\r\n	<table>\r\n	<tr>\r\n		<td>Start Date:</td>\r\n		<td><input type=\"text\" name=\"begin\" size=\"10\" value=\"{$START_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	<tr>\r\n		<td>End Date:</td>\r\n		<td><input type=\"text\" name=\"end\" size=\"10\" value=\"{$END_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	</table>\r\n\r\n	<div align=\"right\" style=\"clear:left;\"><input type=\"submit\" value=\"Submit\" /></div>\r\n	\r\n	</form>\r\n</div>\r\n</div>\r\n\r\n<hr />\r\n<i>Report for data between <b>{$START_DATE|date_format2:\"m/d/Y\"}</b> and <b>{$END_DATE|date_format2:\"m/d/Y\"}</b>.</i>\r\n<hr />\r\n\r\n<h3 class=\"withBG\">Campaigns</h3>\r\n{foreach from=$campaigns item=\"campaign\"}\r\n	<b>Campaign #{$campaign.id}</b>\r\n	<div style=\"margin-left:15px;\">\r\n		<i>eStat</i>: {$campaign.estatName}<br />\r\n		<i>Date Range</i>: {$campaign.dateStart|date_format2:\"m/d/Y\"} <small>({$campaign.dateStart|date_format2:\"h:i:s A\"})</small> to {$campaign.dateEnd|date_format2:\"m/d/Y\"} <small>({$campaign.dateEnd|date_format2:\"h:i:s A\"})</small><br />\r\n		<i>Scoring</i>: {$campaign.value} - {$campaign.type}<br />\r\n	</div>\r\n	<br />\r\n{foreachelse}\r\n	<div style=\"margin-left:15px;\">\r\n		No active campaigns in the current time period.\r\n	</div>\r\n	<br />\r\n{/foreach}\r\n\r\n<h3 class=\"withBG\">User Data</h3>\r\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" style=\"z-index:10000;\">\r\n<tr bgcolor=\"#CCCCCC\">\r\n	<td><b>No.</b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'username\');\">Username</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'lastName\');\">Last Name</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'firstName\');\">First Name</a></b></td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td><b><a href=\"javascript:changeOrder({$campaign.id});\">#{$campaign.id}</a></b></td>\r\n	{/foreach}\r\n	<td><b><a href=\"javascript:changeOrder(\'surveys\');\">Surveys</a></b></td>\r\n	<td><b><a href=\"javascript:changeOrder(\'total\');\">Total</a></b></td>\r\n</tr>\r\n{foreach name=\"userDataLoop\" from=$userData item=\"userData\"}\r\n<tr>\r\n	<td>{$smarty.foreach.userDataLoop.iteration}.</td>\r\n	<td><a href=\"mailto:{$userData.email|default:\"unknown@unknown.com\"}\">{$userData.username}</a></td>\r\n	<td>{$userData.lastName|default:\"-none-\"}</td>\r\n	<td>{$userData.firstName|default:\"-none-\"}</td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td align=\"right\">{$userData[$campaign.id]|default:0}</td>\r\n	{/foreach}\r\n	<td align=\"right\">{$userData.surveys|default:0}</td>\r\n	<td align=\"right\"><b>{$userData.total|default:0}</b></td>\r\n</tr>\r\n{/foreach}\r\n</table>\r\n'),(4970,272,0.66,'smarty','0','David JS Working...',1142040792,2271,'216.194.127.150','{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<form method=\"post\" action=\"index.php\">\r\n<table width=\"100%\" border=0>\r\n <tr>\r\n  <td nowrap><h2> A. Competing for...</h2></td>\r\n  <td nowrap><h2>B. The competition name is...</h2></td>\r\n  <td nowrap><h2>C. How\'s competing...</h2></td>\r\n </tr>\r\n <tr>\r\n  <td valign=\"top\" width=\"30%\">\r\n    <small>\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"p2p\" checked> <a href=\"javascript:setCompType(\'p2p\');\">Pound for pound <i>(Weight lost)</i></a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"pctWt\"> <a href=\"javascript:setCompType(\'pctWt\');\">Percent of body weight lost</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"minEx\"> <a href=\"javascript:setCompType(\'minEx\');\">Total minutes excercised</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"disEx\"> <a href=\"javascript:setCompType(\'disEx\');\">Total distance excercised</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"veg\"> <a href=\"javascript:setCompType(\'veg\');\">Vegitable challenge</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"gain\"> <a href=\"javascript:setCompType(\'gain\');\">Weight gained</a><br />\r\n    </small>\r\n  </td>\r\n  <td valign=\"top\">\r\n    <table border=0 cellspacing=0>\r\n    <tr>\r\n      <td><h3>Name:</h3></td>\r\n      <td><input type=\"text\" name=\"comp[title]\" /></td>\r\n    </tr>\r\n    <tr>\r\n      <td valign=\"top\"><small><b>Examples:</b></small></td>\r\n      <td><small>&quot;The chubby family reunion&quot;<br />&quot;Company shape-up marathon&quot;<br />&quot;Super Summer Slimdown&quot;</small></td>\r\n    </tr>\r\n    <tr>\r\n      <td colspan=\"2\">\r\n	<br/>\r\n        <div style=\"border:solid 1px black;width:98%;height:60px;\">\r\n	  test\r\n	</div>\r\n      </td>\r\n    </tr>\r\n    </table>\r\n  </td>\r\n  <td valign=\"top\">\r\n     <table border=0 cellpaddin=0 cellspacing=0>\r\n      <tr>\r\n	<td colspan=\"2\">\r\n	  <div id=\'enterFriendNameDiv\' style=\'display:block;\'>\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	     <tr>\r\n	       <td colspan=2><li>Invate your friends</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Name:\r\n                 </small>\r\n	       </td>\r\n	       <td>\r\n	         <input type=\"text id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Email:\r\n	         </small>\r\n	       </td>\r\n	       <td>\r\n		  <input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td colspan=\"2\" align=\"right\">\r\n	         <small>\r\n		   <span onclick=\"extraCompetitors(\'open\');\" style=\"cursor:pointer;\">\r\n                     Add more\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	  </div>\r\n	  <div id=\"myEnteredFriendsDiv\" style=\"display:none;\">\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n	     <tr>\r\n	       <td><li>My Competitors:</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"left\" id=\"competitorListHolder\" style=\"padding-left:15px\">\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   <span onclick=\"editCompetitors();\" style=\"cursor:pointer;\">\r\n                     Edit my competitors\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	  </div>\r\n	</td>\r\n      </tr>\r\n      <tr><td colspan=\"2\"><li>Let them know with an email...</li></td></tr>\r\n      <tr>\r\n        <td valign=\"top\" colspan=2>\r\n	  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	      <tr>\r\n		 <td valign=\"top\">\r\n		    <small>\r\n			<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n			  <tr><td id=\'kind\'><input type=\"radio\" value=\"kind\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'kind\');\"/> <a href=\"javascript:setInviteStyle(\'kind\');\">Kind</a></td></tr>\r\n			  <tr><td id=\'smack\'><input type=\"radio\" value=\"smack\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'smack\');\"/> <a href=\"javascript:setInviteStyle(\'smack\');\">Smack</a></td></tr>\r\n			  <tr><td id=\'challenge\'><input type=\"radio\" value=\"challenge\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'challenge\');\" /> <a href=\"javascript:setInviteStyle(\'challenge\');\">Challenge</a></td></tr>\r\n			  <tr><td id=\'custom\'><input type=\"radio\" value=\"custom\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'custom\');\"/> <a href=\"javascript:setInviteStyle(\'custom\');\">Make Your Own</a></td></tr>\r\n                        </table>\r\n		    </small>\r\n		 </td>\r\n		 <td valign=\"top\" id=\"invateHolder\">\r\n		    <div id=\"InvateW\" style=\"border-bottom:solid 1px #CCC;border-left:solid 1px #CCC;padding-right:5px;visibility:hidden;\">\r\n			<small>\r\n			   <input type=\"radio\" value=\"heavy\" name=\"comp[invite_subtype]\"  onclick=\"displayLetter()\" /> <a href=\"javascript:setInviteWeight(\'heavy\');\">Heavy</a><br />\r\n			   <input type=\"radio\" value=\"medium\" name=\"comp[invite_subtype]\" onclick=\"displayLetter()\" /> <a href=\"javascript:setInviteWeight(\'medium\');\">Medium</a><br />\r\n			   <input type=\"radio\" value=\"light\" name=\"comp[invite_subtype]\" onclick=\"displayLetter()\" /> <a href=\"javascript:setInviteWeight(\'light\');\">Light</a><br />\r\n			</small>\r\n		    </div>\r\n		</td>\r\n	     </tr>\r\n	  </table>\r\n        </td>\r\n     </tr>\r\n     </table>\r\n  </td>\r\n</tr>\r\n</table>\r\n<br />\r\n<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n   <td align=\"right\">tab</td>\r\n </tr>\r\n <tr>\r\n   <td>\r\n      <div id=\"letterHolder\" name=\"letterHolder\" style=\"border:solid 1px black;height:410px;width:100%;overflow:auto;\">\r\n      </div>\r\n   </td>\r\n </tr>\r\n</table>\r\n{* <iframe src=\"?pg=compCreate/inviteFrame\" style=\"width:100%;height:410px;\" scrollbars=\"no\" frameborder=\"0\"></iframe> *}\r\n\r\n<div id=\"invite-div\"></div>\r\n<br />\r\n\r\n<div align=\"right\">\r\n  <a href=\"?pg=compCreate/step2\"><img src=\"{$skinFolder}images/btn_next.gif\" alt=\"Next\" border=\"0\" /></a>\r\n</div>\r\n\r\n<div id=\"myCompetitors\" style=\"width:300px;background-color:white;zIndex:100;position:absolute;display:none;top:-70px;left:300px;border:solid 1px #CCC;filter: alpha(opacity=85)\">\r\n  <center>\r\n   <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"95%\">\r\n      <tr><td align=\"right\" valign=\"top\" style=\"height:5px\"><small><span style=\"cursor:pointer;\" onclick=\"extraCompetitors(\'close\');\">close window</span><small></td></tr>\r\n      <tr><td style=\"border-bottom:solid 1px #CCC;\"><h2>More Competitors...</td></tr>\r\n      <tr>\r\n         <td align=\"center\">\r\n	    <table id=\"competitorsTable\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"90%\">\r\n                <tr>\r\n		  <td></td>\r\n		  <td align=\"center\" valign=\"bottom\">Name</td>\r\n                  <td align=\"center\" valign=\"bottom\">Email</td>\r\n                </tr>\r\n	        <tr>\r\n		  <td>2.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>3.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>4.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>5.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>6.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>7.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>8.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>9.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>10.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>11.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n		<tr>\r\n		  <td colspan=\"3\" align=\"right\"><small><span style=\"cursor:pointer;\" onclick=\'addMoreCompetitors();\'>Add More Lines</span></small></td>\r\n		</tr>\r\n            </table>\r\n         </td>\r\n      </tr>\r\n      <tr>\r\n	<td align=\"right\" style=\"border-top:solid 1px #CCC;\"><img style=\"cursor:pointer;\" onclick=\"addingCompetitors();\" src=\"{$skinFolder}images/btn_next.gif\" alt=\"Add\" border=\"0\" /></td>\r\n      </tr>\r\n   </table>\r\n  </center>\r\n</div>\r\n\r\n</form>\r\n\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/js-get-data.js\"></script>\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/AJAX.js\"></script>\r\n\r\n<script language=\"JavaScript\">\r\n	\r\n        //jsGetData(\'?pg=jsGetData\',\'invite-div\', \'madlib.form\', \'&compType=friends&inviteType=smack\');\r\n\r\n	var examples = Array();\r\n	{foreach from=$examples key=\"key\" item=\"example\"}\r\n	examples[{$key}] = \'{eval var=$example.body|addslashes|replace:\"\\r\":\"\"|replace:\"\\n\":\"\\\\n\"}\';\r\n	{/foreach}\r\n	\r\n	{literal}\r\n	function setCompType(type) {\r\n		checkValue(type, \'comp[type]\');\r\n	}\r\n\r\n	function setInviteStyle(type) {\r\n		checkValue(type, \'comp[invite_type]\');\r\n		var oInvateW = document.getElementById(\'InvateW\');\r\n		\r\n		if(type == \'custom\')\r\n		  oInvateW.style.visibility = \"hidden\";\r\n		else\r\n 		  oInvateW.style.visibility = \"visible\";\r\n\r\n		var oInvateWHolder = document.getElementById(\"invateHolder\");\r\n		switch(type)\r\n		{\r\n		   case \"kind\":\r\n			oInvateWHolder.style.paddingTop = \"0\";\r\n			break;\r\n		   case \"smack\":\r\n			oInvateWHolder.style.paddingTop = \"8px\";\r\n			break;\r\n		   case \"challenge\":\r\n			oInvateWHolder.style.paddingTop = \"15px\";\r\n			break;\r\n		}\r\n	        setTypeUnderLine(type);\r\n		return;\r\n 	}\r\n\r\n	function setInviteWeight(type) {\r\n		checkValue(type, \'comp[invite_subtype]\');\r\n	        displayLetter();\r\n	        return;\r\n	}\r\n\r\n	function checkValue(type, eName) {\r\n		var aInput=document.getElementsByName(eName);\r\n		for (i = 0; i < aInput.length; i++)\r\n		{\r\n		   aInput[i].checked = (aInput[i].value == type) ? true : false;\r\n		}\r\n	   return;\r\n	}\r\n\r\n	/*  This functions should go inside of JS file  *******/\r\n\r\n	var prevType = \"\";\r\n	function setTypeUnderLine(type)\r\n	{\r\n	    if(prevType != \"\")\r\n	    {\r\n		var oldTypeLine = eval(\"document.getElementById(\'\"+prevType+\"\')\");\r\n		oldTypeLine.style.borderBottom = \"\";\r\n            }\r\n	    var oTypeLine = eval(\"document.getElementById(\'\"+type+\"\')\");\r\n	    oTypeLine.style.borderBottom = type == \'custom\' ? \"\" : \"solid 1px #CCC\";\r\n	    prevType = type;\r\n	    return;\r\n	}\r\n\r\n	// This function adds a new row in the CompetitorsTable to add more competitors\r\n        // the current limit of competitors is 10\r\n	function addMoreCompetitors()\r\n	{\r\n	  var oTable = document.getElementById(\"competitorsTable\");\r\n	  var rowNum = oTable.rows.length - 1;\r\n          if(rowNum >= 15){\r\n		alert(\'message: No more than 15\');\r\n		return;\r\n	  }\r\n	  var w = oTable.insertRow(rowNum);\r\n	  var x = w.insertCell(0);\r\n	  var y = w.insertCell(1);\r\n	  var z = w.insertCell(2);\r\n	\r\n	  rowNum++;\r\n	  x.innerHTML = rowNum + \".\";\r\n	  y.innerHTML = \"<input type=\'text\' id=\'comp[competitor_name]\' name=\'comp[competitor_name]\' style=\'width:110px;\' />\";\r\n	  z.innerHTML = \"<input type=\'text\' id=\'comp[competitor_email]\' name=\'comp[competitor_email]\' style=\'width:110px;\' />\";\r\n	  \r\n	  return;\r\n	}\r\n\r\n	function extraCompetitors(type){\r\n	  var oDiv = document.getElementById(\"myCompetitors\");\r\n\r\n	  if(type == \"close\"){\r\n	     oDiv.style.display = \"none\";\r\n	  }else{\r\n	      var nameValidator = document.getElementsByName(\"comp[competitor_name]\");\r\n	      var emailValidator = document.getElementsByName(\"comp[competitor_email]\");\r\n	\r\n		/*alert(nameValidator[0].value);\r\n		alert(emailValidator[0].value);*/\r\n	        if(nameValidator[0].value != \"\" && emailValidator[0].value != \"\")\r\n		{\r\n		   var goOn = validateEmail(emailValidator[0].value,0);\r\n		   if(!goOn)\r\n		     return;\r\n     \r\n		   oDiv.style.display = \"block\";\r\n	        }\r\n		else\r\n		{\r\n		   if(nameValidator[0].value == \"\" && emailValidator[0].value == \"\"){\r\n			alert(\"Please enter the information of your first competitor before adding more competitors\");\r\n			return;\r\n		   }\r\n		   if(nameValidator[0].value == \"\"){\r\n		   	alert(\"Please enter the name of your first competitor before adding more competitors\");\r\n			return;\r\n		   }\r\n		   if(emailValidator[0].value == \"\"){\r\n			alert(\"Please enter the email of your first competitor before adding more competitors\");\r\n			return;\r\n		   }\r\n\r\n	        }\r\n	  }\r\n	  return;\r\n	}\r\n\r\n	function validateEmail(email,comp){\r\n	  var validated = false;\r\n	  var at = false;\r\n	  var dot = false;\r\n	  comp = comp + 1;\r\n\r\n	  if(email.indexOf(\"@\") > -1)\r\n		at = true;\r\n\r\n	  if(email.indexOf(\".\") > -1)\r\n		dot = true;\r\n\r\n\r\n	  if(dot && at)\r\n		validated = true;\r\n\r\n	  if(!dot && at)\r\n	     alert(\'Please correct the email address for competitor \'+comp+\', (.) character missing\');\r\n\r\n	  if(!at && dot)\r\n	     alert(\'Please correct the email address for competitor \'+comp+\', (@) character missing\');\r\n\r\n	  if(!validated && !at && !dot)\r\n	     alert(\'Please enter a valid email address for competitor \'+comp);\r\n	\r\n	  return validated;        \r\n	}\r\n\r\n	function addingCompetitors()\r\n        {\r\n	   var nameValidator = document.getElementsByName(\"comp[competitor_name]\");\r\n	   var emailValidator = document.getElementsByName(\"comp[competitor_email]\");\r\n	   var validator,j;\r\n	   var nameList = \"\";\r\n\r\n	   for(i=0;i<nameValidator.length;i++)\r\n	   {\r\n	      j = i + 1;\r\n	      if(emailValidator[i].value != \"\" && nameValidator[i].value == \"\"){\r\n		 highLigh(\'competitorsTable\',j,1,false);\r\n		 alert(\'Please enter a name for competitor \'+j);\r\n	         return false;\r\n	      }\r\n	      if(nameValidator[i].value != \"\"){\r\n	         validator = validateEmail(emailValidator[i].value,i);\r\n		 highLigh(\'competitorsTable\',j,2,validator);\r\n		 highLigh(\'competitorsTable\',j,1,true);\r\n		 nameList += nameValidator[i].value + \",\";\r\n		 if(!validator){\r\n		   return false;\r\n	         }\r\n	      }\r\n	   }\r\n	   nameList = \"<font size=\'-1\'><b>\"+nameList.substring(0,nameList.length - 1)+\"</b></font>\";\r\n	   var oListHolder = document.getElementById(\"competitorListHolder\");\r\n	   var oEnterComp  = document.getElementById(\"enterFriendNameDiv\");\r\n	   var oEnteredComp= document.getElementById(\"myEnteredFriendsDiv\");\r\n	   var oMoreComp = document.getElementById(\"myCompetitors\");\r\n\r\n	   oListHolder.innerHTML = nameList;\r\n	   oEnterComp.style.display = \"none\";\r\n	   oMoreComp.style.visibility = \"hidden\";\r\n	   oEnteredComp.style.display = \"block\";\r\n\r\n	   return;\r\n	}\r\n\r\n	function editCompetitors(){\r\n	   var oEnterComp  = document.getElementById(\"enterFriendNameDiv\");\r\n	   var oEnteredComp= document.getElementById(\"myEnteredFriendsDiv\");\r\n	   var oMoreComp = document.getElementById(\"myCompetitors\");\r\n\r\n	   oEnterComp.style.display = \"block\";\r\n	   oMoreComp.style.visibility = \"visible\";\r\n	   oEnteredComp.style.display = \"none\";\r\n		\r\n	   return;\r\n	}\r\n\r\n	function highLigh(tableName,row,cell,validator){\r\n	   row = row - 1;\r\n	   var oTable = eval(\"document.getElementById(\'\"+tableName+\"\')\");\r\n	   var highLightRow = oTable.rows[row].cells[cell];\r\n	   highLightRow.style.backgroundColor = !validator ? \"darkred\" : \"\";\r\n           return;\r\n	}\r\n\r\n\r\n	function displayLetter()\r\n	{\r\n	   var oType = document.getElementById(\"comp[invite_type]\");\r\n	   var oSubType = document.getElementById(\"comp[invite_subtype]\");\r\n	   var args = \"&compType=\"+oSubType.value+\"&inviteType=\"+oType.value;\r\n	   var obj = \"invite-div\";\r\n	   var url = \"http://www.ehealthcompete.com/?pg=jsGetData\";\r\n	   var type = \"madlib.form\";\r\n	   var letterURL = url + \"&obj=\"+obj+\"&type=\"+type+\"&args=\"+args;\r\n	   reqLetter(letterURL)\r\n\r\n	   return;\r\n	}\r\n\r\n	/***  AJAX request functions  ***/\r\n	function reqLetter(url)\r\n	{\r\n		var oAJAX = new AJAX();\r\n		if(!oAJAX.ERROR.find)\r\n			var myRequest = oAJAX.GET(url);\r\n		if(!oAJAX.ERROR.find)\r\n			requestHandler(myRequest);\r\n		else\r\n		   alert(oAJAX.ERROR.msg);\r\n		myRequest = null;\r\n		return;\r\n	\r\n	}\r\n\r\n	function requestHandler(oReq)\r\n	{\r\n	   if(oReq.readyState != 4)\r\n		setTimeout(\"requestHandler(\"+oReq+\")\",5);\r\n	\r\n	   if(oReq.status == 200){ //HTTP status\r\n		var htmlPage = oReq.responseText;\r\n		var oLoader = document.getElementById(\"letterHolder\");\r\n		oLoader.innerHTML = htmlPage;\r\n		//alert(oLoader.innerHTML);\r\n	        var tmp = document.getElementById(\"theData\");\r\n		tmp.style.display = \"block\";\r\n	   }\r\n	   return;		\r\n	}\r\n\r\n\r\n	{/literal}\r\n</script>'),(4704,271,0.30,'smarty','1','Page created.',1135923300,2,'24.2.76.126','{include_php file=\"shared_handle:company_management/reports/incentives-summary\"}\r\n<h1>{$page.title}</h1>\r\n<h2>{$smarty.session.company.companyName}</h2>\r\n\r\n<hr />\r\n\r\n<div style=\"width:400px;\">\r\n<h3 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'configure\', \'\', \'showHide\');\"><img id=\"configure_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Configure</h3>\r\n\r\n<script type=\"text/javascript\">\r\n{literal}\r\nfunction changeOrder(ord) {\r\n	document.forms.configure.order.value = ord;\r\n	document.forms.configure.submit();\r\n}\r\n{/literal}\r\n</script>\r\n\r\n<div id=\"configure\" style=\"display:none; margin-left:20px;\">\r\n	<form name=\"configure\" method=\"get\" action=\"index.php\" style=\"margin:0px;\">\r\n	<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\" />\r\n	<input type=\"hidden\" name=\"order\" value=\"{$smarty.request.order}\" />\r\n\r\n	<div style=\"float:right;\"><small>&quot;Range Offset&quot; will allow each range to begin at an offset value.</small></div>\r\n\r\n	<table>\r\n	<tr>\r\n		<td>Start Date:</td>\r\n		<td><input type=\"text\" name=\"begin\" size=\"10\" value=\"{$START_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	<tr>\r\n		<td>End Date:</td>\r\n		<td><input type=\"text\" name=\"end\" size=\"10\" value=\"{$END_DATE|date_format2:\"m/d/Y\"}\" />\r\n	</tr>\r\n	</table>\r\n\r\n	<div align=\"right\" style=\"clear:left;\"><input type=\"submit\" value=\"Submit\" /></div>\r\n	\r\n	</form>\r\n</div>\r\n</div>\r\n\r\n<hr />\r\n<i>Report for data between <b>{$START_DATE|date_format2:\"m/d/Y\"}</b> and <b>{$END_DATE|date_format2:\"m/d/Y\"}</b>.</i>\r\n<hr />\r\n\r\n<h3 class=\"withBG\">Campaigns</h3>\r\n{foreach from=$campaigns item=\"campaign\"}\r\n	<b>Campaign #{$campaign.id}</b>\r\n	<div style=\"margin-left:15px;\">\r\n		<i>eStat</i>: {$campaign.estatName}<br />\r\n		<i>Date Range</i>: {$campaign.dateStart|date_format2:\"m/d/Y\"} <small>({$campaign.dateStart|date_format2:\"h:i:s A\"})</small> to {$campaign.dateEnd|date_format2:\"m/d/Y\"} <small>({$campaign.dateEnd|date_format2:\"h:i:s A\"})</small><br />\r\n		<i>Scoring</i>: {$campaign.value} - {$campaign.type}<br />\r\n	</div>\r\n	<br />\r\n{foreachelse}\r\n	<div style=\"margin-left:15px;\">\r\n		No active campaigns in the current time period.\r\n	</div>\r\n	<br />\r\n{/foreach}\r\n\r\n<h3 class=\"withBG\">User Data</h3>\r\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" style=\"z-index:10000;\">\r\n<tr bgcolor=\"#CCCCCC\">\r\n	<td align=\"center\"><b>No.</b></td>\r\n	<td align=\"center\"><b><a href=\"javascript:changeOrder(\'username\');\">Username</a></b></td>\r\n	<td align=\"center\"><b><a href=\"javascript:changeOrder(\'lastName\');\">Last</a></b></td>\r\n	<td align=\"center\"><b><a href=\"javascript:changeOrder(\'firstName\');\">First</a></b></td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td align=\"center\"><b><a href=\"javascript:changeOrder({$campaign.id});\">#{$campaign.id}</a></b></td>\r\n	{/foreach}\r\n	<td align=\"center\"><b><a href=\"javascript:changeOrder(\'surveys\');\">Surveys</a></b></td>\r\n	<td align=\"center\"><b><a href=\"javascript:changeOrder(\'adjustments\');\">Adj.</a></b></td>\r\n	<td align=\"center\"><b><a href=\"javascript:changeOrder(\'total\');\">Total</a></b></td>\r\n</tr>\r\n{foreach name=\"userDataLoop\" from=$userData item=\"userData\"}\r\n<tr>\r\n	<td>{$smarty.foreach.userDataLoop.iteration}.</td>\r\n	<td><a href=\"mailto:{$userData.email|default:\"unknown@unknown.com\"}\">{$userData.username}</a></td>\r\n	<td>{$userData.lastName|default:\"-none-\"}</td>\r\n	<td>{$userData.firstName|default:\"-none-\"}</td>\r\n	{foreach from=$campaigns item=\"campaign\"}\r\n		<td align=\"right\">{$userData[$campaign.id]|default:0}</td>\r\n	{/foreach}\r\n	<td align=\"right\">{$userData.surveys|default:0}</td>\r\n	<td align=\"right\">{$userData.adjustments|default:0}</td>\r\n	<td align=\"right\"><b>{$userData.total|default:0}</b></td>\r\n</tr>\r\n{/foreach}\r\n</table>\r\n'),(4971,272,0.67,'smarty','0','David JS Working...',1142172602,2271,'67.186.218.203','{include file=\"shared:layouts/comp_create_navbar.tpl\"}\r\n\r\n<form method=\"post\" action=\"index.php\">\r\n<table width=\"100%\" border=0>\r\n <tr>\r\n  <td nowrap><h2> A. Competing for...</h2></td>\r\n  <td nowrap><h2>B. The competition name is...</h2></td>\r\n  <td nowrap><h2>C. How\'s competing...</h2></td>\r\n </tr>\r\n <tr>\r\n  <td valign=\"top\" width=\"30%\">\r\n    <small>\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"p2p\" checked> <a href=\"javascript:setCompType(\'p2p\');\">Pound for pound <i>(Weight lost)</i></a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"pctWt\"> <a href=\"javascript:setCompType(\'pctWt\');\">Percent of body weight lost</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"minEx\"> <a href=\"javascript:setCompType(\'minEx\');\">Total minutes excercised</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"disEx\"> <a href=\"javascript:setCompType(\'disEx\');\">Total distance excercised</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"veg\"> <a href=\"javascript:setCompType(\'veg\');\">Vegitable challenge</a><br />\r\n      <input type=\"radio\" name=\"comp[type]\" value=\"gain\"> <a href=\"javascript:setCompType(\'gain\');\">Weight gained</a><br />\r\n    </small>\r\n  </td>\r\n  <td valign=\"top\">\r\n    <table border=0 cellspacing=0>\r\n    <tr>\r\n      <td><h3>Name:</h3></td>\r\n      <td><input type=\"text\" name=\"comp[title]\" /></td>\r\n    </tr>\r\n    <tr>\r\n      <td valign=\"top\"><small><b>Examples:</b></small></td>\r\n      <td><small>&quot;The chubby family reunion&quot;<br />&quot;Company shape-up marathon&quot;<br />&quot;Super Summer Slimdown&quot;</small></td>\r\n    </tr>\r\n    <tr>\r\n      <td colspan=\"2\">\r\n	<br/>\r\n        <div style=\"border:solid 1px black;width:98%;height:60px;\">\r\n	  test\r\n	</div>\r\n      </td>\r\n    </tr>\r\n    </table>\r\n  </td>\r\n  <td valign=\"top\">\r\n     <table border=0 cellpaddin=0 cellspacing=0>\r\n      <tr>\r\n	<td colspan=\"2\">\r\n	  <div id=\'enterFriendNameDiv\' style=\'display:block;\'>\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	     <tr>\r\n	       <td colspan=2><li>Invate your friends</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Name:\r\n                 </small>\r\n	       </td>\r\n	       <td>\r\n	         <input type=\"text id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   My friend\'s Email:\r\n	         </small>\r\n	       </td>\r\n	       <td>\r\n		  <input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" />\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td colspan=\"2\" align=\"right\">\r\n	         <small>\r\n		   <span onclick=\"extraCompetitors(\'open\');\" style=\"cursor:pointer;\">\r\n                     Add more\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	  </div>\r\n	  <div id=\"myEnteredFriendsDiv\" style=\"display:none;\">\r\n	   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n	     <tr>\r\n	       <td><li>My Competitors:</li></td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"left\" id=\"competitorListHolder\" style=\"padding-left:15px\">\r\n	       </td>\r\n             </tr>\r\n             <tr>\r\n	       <td align=\"right\">\r\n	         <small>\r\n		   <span onclick=\"editCompetitors();\" style=\"cursor:pointer;\">\r\n                     Edit my competitors\r\n                   </span>\r\n                 </small>\r\n	        </td>\r\n             </tr>\r\n	   </table>\r\n	  </div>\r\n	</td>\r\n      </tr>\r\n      <tr><td colspan=\"2\"><li>Let them know with an email...</li></td></tr>\r\n      <tr>\r\n        <td valign=\"top\" colspan=2>\r\n	  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n	      <tr>\r\n		 <td valign=\"top\">\r\n		    <small>\r\n			<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\r\n			  <tr><td id=\'kind\'><input type=\"radio\" value=\"kind\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'kind\');\"/> <a href=\"javascript:setInviteStyle(\'kind\');\">Kind</a></td></tr>\r\n			  <tr><td id=\'smack\'><input type=\"radio\" value=\"smack\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'smack\');\"/> <a href=\"javascript:setInviteStyle(\'smack\');\">Smack</a></td></tr>\r\n			  <tr><td id=\'challenge\'><input type=\"radio\" value=\"challenge\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'challenge\');\" /> <a href=\"javascript:setInviteStyle(\'challenge\');\">Challenge</a></td></tr>\r\n			  <tr><td id=\'custom\'><input type=\"radio\" value=\"custom\" name=\"comp[invite_type]\" onclick=\"setInviteStyle(\'custom\');\"/> <a href=\"javascript:setInviteStyle(\'custom\');\">Make Your Own</a></td></tr>\r\n                        </table>\r\n		    </small>\r\n		 </td>\r\n		 <td valign=\"top\" id=\"invateHolder\">\r\n		    <div id=\"InvateW\" style=\"border-bottom:solid 1px #CCC;border-left:solid 1px #CCC;padding-right:5px;visibility:hidden;\">\r\n			<small>\r\n			   <input type=\"radio\" value=\"heavy\" name=\"comp[invite_subtype]\"  onclick=\"displayLetter()\" /> <a href=\"javascript:setInviteWeight(\'heavy\');\">Heavy</a><br />\r\n			   <input type=\"radio\" value=\"medium\" name=\"comp[invite_subtype]\" onclick=\"displayLetter()\" /> <a href=\"javascript:setInviteWeight(\'medium\');\">Medium</a><br />\r\n			   <input type=\"radio\" value=\"light\" name=\"comp[invite_subtype]\" onclick=\"displayLetter()\" /> <a href=\"javascript:setInviteWeight(\'light\');\">Light</a><br />\r\n			</small>\r\n		    </div>\r\n		</td>\r\n	     </tr>\r\n	  </table>\r\n        </td>\r\n     </tr>\r\n     </table>\r\n  </td>\r\n</tr>\r\n</table>\r\n<br />\r\n<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n   <td align=\"right\">tab</td>\r\n </tr>\r\n <tr>\r\n   <td>\r\n      <div id=\"letterHolder\" name=\"letterHolder\" style=\"border:solid 1px black;height:410px;width:100%;overflow:auto;\">\r\n      </div>\r\n   </td>\r\n </tr>\r\n</table>\r\n{* <iframe src=\"?pg=compCreate/inviteFrame\" style=\"width:100%;height:410px;\" scrollbars=\"no\" frameborder=\"0\"></iframe> *}\r\n\r\n<div id=\"invite-div\"></div>\r\n<br />\r\n\r\n<div align=\"right\">\r\n  <a href=\"?pg=compCreate/step2\"><img src=\"{$skinFolder}images/btn_next.gif\" alt=\"Next\" border=\"0\" /></a>\r\n</div>\r\n\r\n<div id=\"myCompetitors\" style=\"width:300px;background-color:white;zIndex:100;position:absolute;display:none;top:-70px;left:300px;border:solid 1px #CCC;filter: alpha(opacity=85)\">\r\n  <center>\r\n   <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"95%\">\r\n      <tr><td align=\"right\" valign=\"top\" style=\"height:5px\"><small><span style=\"cursor:pointer;\" onclick=\"extraCompetitors(\'close\');\">close window</span><small></td></tr>\r\n      <tr><td style=\"border-bottom:solid 1px #CCC;\"><h2>More Competitors...</td></tr>\r\n      <tr>\r\n         <td align=\"center\">\r\n	    <table id=\"competitorsTable\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"90%\">\r\n                <tr>\r\n		  <td></td>\r\n		  <td align=\"center\" valign=\"bottom\">Name</td>\r\n                  <td align=\"center\" valign=\"bottom\">Email</td>\r\n                </tr>\r\n	        <tr>\r\n		  <td>2.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>3.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>4.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>5.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>6.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>7.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>8.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>9.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>10.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n	        <tr>\r\n		  <td>11.</td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_name]\" name=\"comp[competitor_name]\" style=\"width:110px;\" /></td>\r\n		  <td><input type=\"text\" id=\"comp[competitor_email]\" name=\"comp[competitor_email]\" style=\"width:110px;\" /></td>\r\n		</tr>\r\n		<tr>\r\n		  <td colspan=\"3\" align=\"right\"><small><span style=\"cursor:pointer;\" onclick=\'addMoreCompetitors();\'>Add More Lines</span></small></td>\r\n		</tr>\r\n            </table>\r\n         </td>\r\n      </tr>\r\n      <tr>\r\n	<td align=\"right\" style=\"border-top:solid 1px #CCC;\"><img style=\"cursor:pointer;\" onclick=\"addingCompetitors();\" src=\"{$skinFolder}images/btn_next.gif\" alt=\"Add\" border=\"0\" /></td>\r\n      </tr>\r\n   </table>\r\n  </center>\r\n</div>\r\n\r\n</form>\r\n\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/js-get-data.js\"></script>\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/AJAX.js\"></script>\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"/js/NewComp.js\"></script>\r\n\r\n<script language=\"JavaScript\">\r\n	\r\n        //jsGetData(\'?pg=jsGetData\',\'invite-div\', \'madlib.form\', \'&compType=friends&inviteType=smack\');\r\n\r\n	var examples = Array();\r\n	{foreach from=$examples key=\"key\" item=\"example\"}\r\n	examples[{$key}] = \'{eval var=$example.body|addslashes|replace:\"\\r\":\"\"|replace:\"\\n\":\"\\\\n\"}\';\r\n	{/foreach}\r\n	\r\n	{literal}\r\n\r\n\r\n	{/literal}\r\n</script>'),(4707,233,1.49,'smarty','0','Adding totalChange parameter to graph links...',1136846954,16,'216.194.127.150','{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{assign var=\"GUIDs\" value=\"\"}\r\n\r\n{select_query assign=\"managerId\" return=\"val\"}\r\n	userId FROM competitions c WHERE c.id = {$smarty.request.cid}\r\n{/select_query}\r\n\r\n{if $managerId 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/load\"}\r\n\r\n<script type=\"text/javascript\">{literal}\r\n	var GUIDs = \'0\';\r\n\r\n	function updateGUIDs() {\r\n		var checkBoxes = document.forms[\'leaderBoardForm\'][\"graphCheckbox[]\"];\r\n		if (!checkBoxes.length) {\r\n			checkBoxes[0] = checkBoxes;\r\n			checkBoxes.length = 1;\r\n		}\r\n		GUIDs = \'\';\r\n		for (var x = 0; x < checkBoxes.length; x++) {\r\n			if (checkBoxes[x].checked == true && checkBoxes[x].value) {\r\n				GUIDs += checkBoxes[x].value+\',\'; \r\n			}\r\n			\r\n		}\r\n		rewriteGraphLinks();\r\n	}\r\n\r\n\r\n	function loadGraphWindow(graphParams) {\r\n		uri = \'?pg=flashgraph-frame&compId={/literal}{$competition.id}{literal}; //&\'+graphParams+\'&userIds=\'+GUIDs;\r\n		var gFrame = window.frames[\'graphwindow\'];\r\n		// gFrame.location.replace(uri);\r\n		var gForm = document.getElementById(\'form_leaderBoard\');\r\n		gForm.gParams.value = graphParams;\r\n		gForm.userIds.value = GUIDs;\r\n		gForm.submit();\r\n		return false;\r\n	}\r\n{/literal}</script>\r\n\r\n{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n\r\n{capture name=\"scoringMethod\"}\r\n	<b>{$competition.current_parameter.name|capitalize}</b> ({$competition.current_parameter.units}) - {$competition.current_parameter.basedOn|capitalize}{* - {$competition.current_parameter.polarity|capitalize} *}\r\n{/capture}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"275\">\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		\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\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		<small>{$smarty.capture.scoringMethod}</small><br />\r\n		{if $competition.style eq \"Group-vs-Group\"}\r\n			<div align=\"center\" style=\"font-size:9px; color:#000;\">(Team Average)</div>\r\n		{elseif $competition.style eq \"Company-vs-Company\"}\r\n			<div align=\"center\" style=\"font-size:9px; color:#000;\">(Company Average)</div>\r\n		{/if}\r\n		{if $competition.parameters|@count gt 1}\r\n			<select name=\"scoringMethod\" onchange=\"if(this.value)location.replace(\'?pg={$page.name}&cid={$competition.id}&cpid=\'+this.value);\" style=\"width:200px;\">\r\n				<option value=\"\">(Choose Leaderboard)</option>\r\n			{foreach from=$competition.parameters key=\"paramId\" item=\"param\"}\r\n				{if $paramId neq $competition.current_parameter.id}\r\n				<option value=\"{$paramId}\">{$param.name|capitalize} - {$param.basedOn|capitalize}{* - {$param.polarity} *}</option>\r\n				{/if}\r\n			{/foreach}\r\n			</select>\r\n		{/if}\r\n		<form id=\"form_leaderBoard\" name=\"leaderBoardForm\" method=\"POST\" action=\"index.php?pg=flashgraph-frame&compId={$competition.id}\" target=\"graphwindow\">\r\n		<input type=\"hidden\" name=\"gParams\" value=\"\" />\r\n		<input type=\"hidden\" name=\"userIds\" value=\"\" />\r\n		<table cellpadding=\"0\" cellspacing=\"0\">\r\n		{if $competition.style eq \'Group-vs-Group\' or $competition.style eq \'Company-vs-Company\'}\r\n			<tr>\r\n			<td class=\"thinCell\">#</td>\r\n			<td class=\"thinCell\">Team</td>\r\n			<td class=\"thinCell\"><img src=\"{$skinFolder}images/trophy_ico.gif\" width=\"15\" height=\"15\" alt=\"\" /></span>\r\n			<td class=\"thinCell\">#Pl</td>\r\n			{* <td class=\"cellHeadTiny\"><img src=\"{$skinFolder}images/graph_ico.gif\" width=\"15\" height=\"15\" alt=\"Show In Graphs\" /></td> *}\r\n			</tr>\r\n			{foreach name=\"rankLoop\" from=$competition.team_data item=\"teamScore\" key=\"teamName\"}\r\n				{if $teamName ne \"Waiting to Join\"}\r\n					<tr>\r\n						<td class=\"thinCell\"><small>{$smarty.foreach.rankLoop.iteration}</small></td>\r\n						<td class=\"thinCell\"><small class=\"mini\">{$teamName|default:\"&nbsp;\"}</small></td>\r\n						<td class=\"thinCell\"><small>{$teamScore|number_format:2}</small></td>\r\n						<td class=\"thinCell\"><small>{$competition.teams.$teamName|@count|default:\"0\"}</small></td>\r\n						{* <td class=\"thinCell\"><input class=\"graphCheckbox\" name=\"graphCheckbox[]\" type=\"checkbox\" value=\"{foreach from=$teams.users item=teamUser}{$teamUser.id},{if $smarty.foreach.rankLoop.iteration lt 11}{append var=\"GUIDs\" value=\"`$teamUser.id`,\"}{/if}{/foreach}{$GUIDs}\"{if $smarty.foreach.rankLoop.iteration lt 11} checked=\"checked\"{/if} onclick=\"updateGUIDs();\" /></td> *}\r\n					</tr>\r\n				{/if}\r\n			{/foreach}\r\n		{else} \r\n			<tr>\r\n			<td class=\"thinCell\">#</td>\r\n			<td class=\"thinCell\" align=\"center\">Name</td>\r\n			<td class=\"thinCell\"><img src=\"{$skinFolder}images/trophy_ico.gif\" width=\"15\" height=\"15\" alt=\"{$smarty.capture.scoringMethod|strip_tags}\" /></td>\r\n			<td class=\"thinCell\">Update</td>\r\n			<td class=\"thinCell\" align=\"center\"><img src=\"{$skinFolder}images/graph_ico.gif\" width=\"15\" height=\"15\" alt=\"Show in Graphs\" /></td>\r\n			</tr>\r\n			{foreach from=$competition.data item=\"userData\" key=\"userId\" name=\"compData\"}\r\n			{assign var=\"curIteration\" value=$smarty.foreach.compData.iteration}\r\n			{if $curIteration eq 21}\r\n			</table>\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			<table cellpadding=\"0\" cellspacing=\"0\">\r\n			{/if}\r\n			<tr>\r\n			<td class=\"thinCell\"><small>{$curIteration}</small></td>\r\n			<td class=\"thinCell\"><small class=\"mini\">{$competition.users[$userId]}</small></td>\r\n			<td class=\"thinCell\"><small>{$userData.val|number_format:$competition.current_parameter.decimalPlaces}</small></td>\r\n			<td class=\"thinCell\"><small>{if $userData.doe}{$userData.doe|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></td>\r\n			<td class=\"thinCell\"><input class=\"graphCheckbox\" name=\"graphCheckbox[]\" type=\"checkbox\" value=\"{$userId}{if $curIteration lt 11}{append var=\"GUIDs\" value=\"`$userId`,\"}{/if}\"{if $curIteration lt 11} checked=\"checked\"{/if} onclick=\"updateGUIDs();\" /></td>\r\n			</tr>\r\n			{/foreach}\r\n		{/if}\r\n		</form>\r\n		<script type=\"text/javascript\">GUIDs = \'{$GUIDs}\';</script>\r\n		</table>\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 and $competition.style neq \'Company-vs-Company\'}\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=\"no_expire_keep_alive\" value=\"cid\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n					<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n					<span class=\"cellHead\">View Stats</span>\r\n					{* <span class=\"cellHeadSmall\">-</span> *}\r\n					<br />\r\n					{foreach from=$competition.users item=\"username\" key=\"userId\" 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=my_home&cid={$competition.id}&userId={$userId}&hideComps=1\">{$username}</a></small></span>\r\n						{* <span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span> *}\r\n						<br />\r\n					{/foreach}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Remove 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			<input type=\"hidden\" name=\"no_expire_keep_alive\" value=\"cid\">\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 $teamName ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teamName|htmlspecialchars}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teamName|htmlspecialchars}\" name=\"manageTeam[rename][{$teamName|htmlspecialchars}]\" 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		{*\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>distance 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		*}\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 being calculated. <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 a distance of <b>{$userValue}</b> {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\'}a distance of <b>{$userValue}</b>{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 a distance of <b>{$userValue}</b>{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\'}a distance of <b>{$userValue}</b>{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.graphParameters|@count}\r\n<script type=\"text/javascript\">{literal}\r\n	function rewriteGraphLinks() {\r\n		var gLinksDiv = document.getElementById(\'graphLinksDiv\');\r\n		gLinksDiv.innerHTML = \'\';\r\n		{/literal}{foreach name=\"graphTypes\" from=$competition.graphParameters item=\"cgp\"}\r\n		gLinksDiv.innerHTML += \'<a href=\"?pg=flashgraph-frame&compId={$competition.id}&type={$cgp.name|niceText|replace:\" \":\"+\"}&esId={$cgp.estatId}&basedOn={$cgp.basedOn|replace:\" \":\"+\"}&fillPrevious={if $cgp.assumeConstantValues eq \"yes\"}1{else}0{/if}&precision={$cgp.decimalPlaces}&format=wide&userIds=\'+GUIDs+\'\" target=\"graphwindow\"><small>{$cgp.name|niceText|replace:\" \":\"&nbsp;\"}&nbsp;-&nbsp;{$cgp.basedOn|niceText|replace:\" \":\"&nbsp;\"}</small></a>{if !$smarty.foreach.graphTypes.last} | {/if}\';\r\n		{/foreach}\r\n	{literal}\r\n	}\r\n{/literal}</script>\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 \"iframe_graphwindow\" name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"230\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<div id=\"graphLinksDiv\">\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></div></td>\r\n	</tr>\r\n	</table>\r\n	<script type=\"text/javascript\">\r\n		rewriteGraphLinks();\r\n	</script>\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\' or $competition.style eq \'Company-vs-Company\'}\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	<div align=\"right\" style=\"border-bottom:1px solid black; margin:2px; padding:2px;\">All stats based on: {$smarty.capture.scoringMethod}</div>\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			<input type=\"hidden\" name=\"no_expire_keep_alive\" value=\"cid\">\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.team_data name=\"teamsLoop\" item=\"teamScore\" 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			{if $teamName eq \"Waiting to Join\"}<h2>Not assigned to a team</h2>{else}<h4><span style=\"font-weight:normal;\">#{$smarty.foreach.teamsLoop.iteration}) </span>{$teamName|default:\"&nbsp;\"}{/if}</h4>\r\n			<table cellpadding=\"0\" cellspacing=\"0\" style=\"width:250px; background-color:#FFC;\">\r\n			<tr>\r\n				<td class=\"thinCell\" width=\"55%\">Name</td>\r\n				<td class=\"thinCell\" width=\"25%\"><img src=\"{$skinFolder}images/trophy_ico.gif\" width=\"15\" height=\"15\" alt=\"\" /></td>\r\n				<td class=\"thinCell\" width=\"20%\">Update</span>\r\n			</tr>\r\n			{foreach from=$competition.teams.$teamName item=\"userId\"}\r\n			<tr>\r\n				<td class=\"thinCell\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$competition.users.$userId}]\" />{/if}{$competition.users.$userId}</small></td>\r\n				{* <span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span> *}\r\n				<td class=\"thinCell\"><small>{$competition.data.$userId.val|number_format:$competition.current_parameter.decimalPlaces}</small></td>\r\n				<td class=\"thinCell\"><small>{if $competition.data.$userId.doe}{$competition.data.$userId.doe|date_format2:\"n/j/y\"}{else}Never{/if}</small></td>\r\n			</tr>\r\n			{foreachelse}\r\n			{* No players assigned to this team. *}\r\n			<tr>\r\n				<td class=\"thinCell\">No players yet.</td>\r\n			</tr>\r\n			{/foreach}\r\n\r\n			</table>\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager and $competition.style neq \'Company-vs-Company\'}\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 $newTeamName ne $teamName and $newTeamName ne \"Waiting to Join\"*}\r\n				{if $newTeamName ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeamName}\">{$newTeamName}</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>\r\n\r\n{*\r\n<script type=\"text/javascript\">{literal}\r\n	if ( window.frames != null ) {\r\n	    for ( i = 0; i< window.frames.length; i++ )\r\n	        window.alert (\"Child window \" +i+ \" is named \"+window.frames(i).name);\r\n	}\r\n{/literal}</script>\r\n*}'),(4766,233,1.59,'smarty','0','Enabling competition prizes....',1138651881,2,'63.226.108.67','{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{assign var=\"GUIDs\" value=\"\"}\r\n\r\n{select_query assign=\"managerId\" return=\"val\"}\r\n	userId FROM competitions c WHERE c.id = {$smarty.request.cid}\r\n{/select_query}\r\n\r\n{if $managerId 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/load\"}\r\n\r\n<script type=\"text/javascript\">{literal}\r\n	var GUIDs = \'0\';\r\n\r\n	function updateGUIDs() {\r\n		var checkBoxes = document.forms[\'leaderBoardForm\'][\"graphCheckbox[]\"];\r\n		if (!checkBoxes.length) {\r\n			checkBoxes[0] = checkBoxes;\r\n			checkBoxes.length = 1;\r\n		}\r\n		GUIDs = \'\';\r\n		for (var x = 0; x < checkBoxes.length; x++) {\r\n			if (checkBoxes[x].checked == true && checkBoxes[x].value) {\r\n				GUIDs += checkBoxes[x].value+\',\'; \r\n			}\r\n			\r\n		}\r\n		rewriteGraphLinks();\r\n	}\r\n\r\n\r\n	function loadGraphWindow(graphParams) {\r\n		uri = \'?pg=flashgraph-frame&compId={/literal}{$competition.id}{literal}; //&\'+graphParams+\'&userIds=\'+GUIDs;\r\n		var gFrame = window.frames[\'graphwindow\'];\r\n		// gFrame.location.replace(uri);\r\n		var gForm = document.getElementById(\'form_leaderBoard\');\r\n		gForm.gParams.value = graphParams;\r\n		gForm.userIds.value = GUIDs;\r\n		gForm.submit();\r\n		return false;\r\n	}\r\n{/literal}</script>\r\n\r\n{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n\r\n{capture name=\"scoringMethod\"}\r\n	<b>{$competition.current_parameter.name|capitalize}</b> ({$competition.current_parameter.units}) - {$competition.current_parameter.basedOn|capitalize}{* - {$competition.current_parameter.polarity|capitalize} *}\r\n{/capture}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"275\">\r\n\r\n		{if $competition.prizes|@count}\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'winners\', \'\', \'showHide\');\"><img id=\"winners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Winners\r\n		</h2>\r\n\r\n		<div id=\"winners\" style=\"display:block;\">\r\n		{foreach from=$competition.prizes item=\"prize\" key=\"prizeId\"}\r\n			<a href=\"javascript://\" onclick=\"window.open(\'?pg=competition/winners&cid={$competition.id}&prizeId={$prizeId}\', \'\', \'height=425,width=300,menubar=no,status=no,scrollbars=yes,titlebar=no,resizable=yes\');\">{$prize.title}</a><br />\r\n		{/foreach}\r\n		</div>\r\n		{/if}\r\n		\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		\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\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		<small>{$smarty.capture.scoringMethod}</small><br />\r\n		{if $competition.style eq \"Group-vs-Group\"}\r\n			<div align=\"center\" style=\"font-size:9px; color:#000;\">(Team Average)</div>\r\n		{elseif $competition.style eq \"Company-vs-Company\"}\r\n			<div align=\"center\" style=\"font-size:9px; color:#000;\">(Company Average)</div>\r\n		{/if}\r\n		{if $competition.parameters|@count gt 1}\r\n			<select name=\"scoringMethod\" onchange=\"if(this.value)location.replace(\'?pg={$page.name}&cid={$competition.id}&cpid=\'+this.value);\" style=\"width:200px;\">\r\n				<option value=\"\">(Choose Leaderboard)</option>\r\n			{foreach from=$competition.parameters key=\"paramId\" item=\"param\"}\r\n				{if $paramId neq $competition.current_parameter.id}\r\n				<option value=\"{$paramId}\">{$param.name|capitalize} - {$param.basedOn|capitalize}{* - {$param.polarity} *}</option>\r\n				{/if}\r\n			{/foreach}\r\n			</select>\r\n		{/if}\r\n		<form id=\"form_leaderBoard\" name=\"leaderBoardForm\" method=\"POST\" action=\"index.php?pg=flashgraph-frame&compId={$competition.id}\" target=\"graphwindow\">\r\n		<input type=\"hidden\" name=\"gParams\" value=\"\" />\r\n		<input type=\"hidden\" name=\"userIds\" value=\"\" />\r\n		<table cellpadding=\"0\" cellspacing=\"0\">\r\n		{if $competition.style eq \'Group-vs-Group\' or $competition.style eq \'Company-vs-Company\'}\r\n			<tr>\r\n			<td class=\"thinCell\">#</td>\r\n			<td class=\"thinCell\">Team</td>\r\n			<td class=\"thinCell\"><img src=\"{$skinFolder}images/trophy_ico.gif\" width=\"15\" height=\"15\" alt=\"\" /></span>\r\n			<td class=\"thinCell\">#Pl</td>\r\n			{* <td class=\"cellHeadTiny\"><img src=\"{$skinFolder}images/graph_ico.gif\" width=\"15\" height=\"15\" alt=\"Show In Graphs\" /></td> *}\r\n			</tr>\r\n			{foreach name=\"rankLoop\" from=$competition.team_data item=\"teamScore\" key=\"teamName\"}\r\n				{if $teamName ne \"Waiting to Join\"}\r\n					<tr>\r\n						<td class=\"thinCell\"><small>{$smarty.foreach.rankLoop.iteration}</small></td>\r\n						<td class=\"thinCell\"><small class=\"mini\">{$teamName|default:\"&nbsp;\"}</small></td>\r\n						<td class=\"thinCell\"><small>{$teamScore|number_format:2}</small></td>\r\n						<td class=\"thinCell\"><small>{$competition.teams.$teamName|@count|default:\"0\"}</small></td>\r\n						{* <td class=\"thinCell\"><input class=\"graphCheckbox\" name=\"graphCheckbox[]\" type=\"checkbox\" value=\"{foreach from=$teams.users item=teamUser}{$teamUser.id},{if $smarty.foreach.rankLoop.iteration lt 11}{append var=\"GUIDs\" value=\"`$teamUser.id`,\"}{/if}{/foreach}{$GUIDs}\"{if $smarty.foreach.rankLoop.iteration lt 11} checked=\"checked\"{/if} onclick=\"updateGUIDs();\" /></td> *}\r\n					</tr>\r\n				{/if}\r\n			{/foreach}\r\n		{else} \r\n			<tr>\r\n			<td class=\"thinCell\">#</td>\r\n			<td class=\"thinCell\" align=\"center\">Name</td>\r\n			<td class=\"thinCell\"><img src=\"{$skinFolder}images/trophy_ico.gif\" width=\"15\" height=\"15\" alt=\"{$smarty.capture.scoringMethod|strip_tags}\" /></td>\r\n			<td class=\"thinCell\">Update</td>\r\n			<td class=\"thinCell\" align=\"center\"><img src=\"{$skinFolder}images/graph_ico.gif\" width=\"15\" height=\"15\" alt=\"Show in Graphs\" /></td>\r\n			</tr>\r\n			{foreach from=$competition.data item=\"userData\" key=\"userId\" name=\"compData\"}\r\n			{assign var=\"curIteration\" value=$smarty.foreach.compData.iteration}\r\n			{if $curIteration eq 21}\r\n			</table>\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			<table cellpadding=\"0\" cellspacing=\"0\">\r\n			{/if}\r\n			<tr>\r\n			<td class=\"thinCell\"><small>{$curIteration}</small></td>\r\n			<td class=\"thinCell\"><small class=\"mini\">{$competition.users[$userId]}</small></td>\r\n			<td class=\"thinCell\"><small>{$userData.val|number_format:$competition.current_parameter.decimalPlaces}</small></td>\r\n			<td class=\"thinCell\"><small>{if $userData.doe}{$userData.doe|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></td>\r\n			<td class=\"thinCell\"><input class=\"graphCheckbox\" name=\"graphCheckbox[]\" type=\"checkbox\" value=\"{$userId}{if $curIteration lt 11}{append var=\"GUIDs\" value=\"`$userId`,\"}{/if}\"{if $curIteration lt 11} checked=\"checked\"{/if} onclick=\"updateGUIDs();\" /></td>\r\n			</tr>\r\n			{/foreach}\r\n		{/if}\r\n		</form>\r\n		<script type=\"text/javascript\">GUIDs = \'{$GUIDs}\';</script>\r\n		</table>\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 and $competition.style neq \'Company-vs-Company\'}\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=\"no_expire_keep_alive\" value=\"cid\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n					<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n					<span class=\"cellHead\">View Stats</span>\r\n					{* <span class=\"cellHeadSmall\">-</span> *}\r\n					<br />\r\n					{foreach from=$competition.users item=\"username\" key=\"userId\" 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=my_home&cid={$competition.id}&userId={$userId}&hideComps=1\">{$username}</a></small></span>\r\n						{* <span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span> *}\r\n						<br />\r\n					{/foreach}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Remove 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			<input type=\"hidden\" name=\"no_expire_keep_alive\" value=\"cid\">\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 $teamName ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teamName|htmlspecialchars}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teamName|htmlspecialchars}\" name=\"manageTeam[rename][{$teamName|htmlspecialchars}]\" 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		{*\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>distance 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		*}\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 being calculated. <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 a distance of <b>{$userValue}</b> {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\'}a distance of <b>{$userValue}</b>{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 a distance of <b>{$userValue}</b>{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\'}a distance of <b>{$userValue}</b>{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.graphParameters|@count}\r\n<script type=\"text/javascript\">{literal}\r\n	function rewriteGraphLinks() {\r\n		var gLinksDiv = document.getElementById(\'graphLinksDiv\');\r\n		gLinksDiv.innerHTML = \'\';\r\n		{/literal}{foreach name=\"graphTypes\" from=$competition.graphParameters item=\"cgp\"}\r\n		gLinksDiv.innerHTML += \'<a href=\"?pg=flashgraph-frame&compId={$competition.id}&type={$cgp.name|niceText|replace:\" \":\"+\"}&esId={$cgp.estatId}&basedOn={$cgp.basedOn|replace:\" \":\"+\"}&fillPrevious={if $cgp.assumeConstantValues eq \"yes\"}1{else}0{/if}&precision={$cgp.decimalPlaces}&format=wide&userIds=\'+GUIDs+\'\" target=\"graphwindow\"><small>{$cgp.name|niceText|replace:\" \":\"&nbsp;\"}&nbsp;-&nbsp;{$cgp.basedOn|niceText|replace:\" \":\"&nbsp;\"}</small></a>{if !$smarty.foreach.graphTypes.last} | {/if}\';\r\n		{/foreach}\r\n	{literal}\r\n	}\r\n{/literal}</script>\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 \"iframe_graphwindow\" name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"230\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<div id=\"graphLinksDiv\">\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></div></td>\r\n	</tr>\r\n	</table>\r\n	<script type=\"text/javascript\">\r\n		rewriteGraphLinks();\r\n	</script>\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\' or $competition.style eq \'Company-vs-Company\'}\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	<div align=\"right\" style=\"border-bottom:1px solid black; margin:2px; padding:2px;\">All stats based on: {$smarty.capture.scoringMethod}</div>\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			<input type=\"hidden\" name=\"no_expire_keep_alive\" value=\"cid\">\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.team_data name=\"teamsLoop\" item=\"teamScore\" 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			{if $teamName eq \"Waiting to Join\"}<h2>Not assigned to a team</h2>{else}<h4><span style=\"font-weight:normal;\">#{$smarty.foreach.teamsLoop.iteration}) </span>{$teamName|default:\"&nbsp;\"}{/if}</h4>\r\n			<table cellpadding=\"0\" cellspacing=\"0\" style=\"width:250px; background-color:#FFC;\">\r\n			<tr>\r\n				<td class=\"thinCell\" width=\"55%\">Name</td>\r\n				<td class=\"thinCell\" width=\"25%\"><img src=\"{$skinFolder}images/trophy_ico.gif\" width=\"15\" height=\"15\" alt=\"\" /></td>\r\n				<td class=\"thinCell\" width=\"20%\">Update</span>\r\n			</tr>\r\n			{foreach from=$competition.teams.$teamName item=\"userId\"}\r\n			<tr>\r\n				<td class=\"thinCell\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$competition.users.$userId}]\" />{/if}{$competition.users.$userId}</small></td>\r\n				{* <span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span> *}\r\n				<td class=\"thinCell\"><small>{$competition.data.$userId.val|number_format:$competition.current_parameter.decimalPlaces}</small></td>\r\n				<td class=\"thinCell\"><small>{if $competition.data.$userId.doe}{$competition.data.$userId.doe|date_format2:\"n/j/y\"}{else}Never{/if}</small></td>\r\n			</tr>\r\n			{foreachelse}\r\n			{* No players assigned to this team. *}\r\n			<tr>\r\n				<td class=\"thinCell\">No players yet.</td>\r\n			</tr>\r\n			{/foreach}\r\n\r\n			</table>\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager and $competition.style neq \'Company-vs-Company\'}\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 $newTeamName ne $teamName and $newTeamName ne \"Waiting to Join\"*}\r\n				{if $newTeamName ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeamName}\">{$newTeamName}</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>\r\n\r\n{*\r\n<script type=\"text/javascript\">{literal}\r\n	if ( window.frames != null ) {\r\n	    for ( i = 0; i< window.frames.length; i++ )\r\n	        window.alert (\"Child window \" +i+ \" is named \"+window.frames(i).name);\r\n	}\r\n{/literal}</script>\r\n*}'),(4768,278,0.10,'smarty','0','Page created.',1139333997,1124,'38.118.190.94',''),(4769,279,0.10,'smarty','0','Page created.',1139334283,1124,'38.118.190.94',''),(4770,278,0.11,'smarty','0','Page created.',1139335917,1124,'38.118.190.94','<hl>Overweight and Obesity</hl>\r\n\r\n<p>During the past 20 years, obesity among adults has risen significantly in the United States. The latest data from the National Center for Health Statistics show that 30 percent of U.S. adults 20 years of age and older—over 60 million people—are obese. \r\nThis increase is not limited to adults. The percentage of young people who are overweight has more than tripled since 1980. Among children and teens aged 6–19 years, 16 percent (over 9 million young people) are considered overweight.</p>\r\n<p>These increasing rates raise concern because of their implications for Americans’ health. Being overweight or obese increases the risk of many diseases and health conditions, including the following:</p>\r\n<p>Hypertension</p> \r\n<p>Dyslipidemia (for example, high total cholesterol or high levels of triglycerides)</p> \r\n<p>Type 2 diabetes </p>\r\n<p>Coronary heart disease </p>\r\n<p>Stroke </p>\r\n<p>Gallbladder disease </p>\r\n<p>Osteoarthritis </p>\r\n<p>Sleep apnea and respiratory problems </p>\r\n<p>Some cancers (endometrial, breast, and colon) </p>\r\n<p>Although one of the national health objectives for the year 2010 is to reduce the prevalence of obesity among adults to less than 15%, current data indicate that the situation is worsening rather than improving. This site provides a variety of information designed to help people understand this serious health issue and the efforts being made to address it.</p>\r\n<img src=\"http://www.cdc.gov/nccdphp/dnpa/obesity/images/obesity_graphic.jpg\" border=\"0\"></img>'),(4771,278,0.12,'smarty','0','Page created.',1139335959,1124,'38.118.190.94','{include file=\"layouts/forceLoggedIn.tpl\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n\r\n<hl>Overweight and Obesity</hl>\r\n\r\n<p>During the past 20 years, obesity among adults has risen significantly in the United States. The latest data from the National Center for Health Statistics show that 30 percent of U.S. adults 20 years of age and older—over 60 million people—are obese. \r\nThis increase is not limited to adults. The percentage of young people who are overweight has more than tripled since 1980. Among children and teens aged 6–19 years, 16 percent (over 9 million young people) are considered overweight.</p>\r\n<p>These increasing rates raise concern because of their implications for Americans’ health. Being overweight or obese increases the risk of many diseases and health conditions, including the following:</p>\r\n<p>Hypertension</p> \r\n<p>Dyslipidemia (for example, high total cholesterol or high levels of triglycerides)</p> \r\n<p>Type 2 diabetes </p>\r\n<p>Coronary heart disease </p>\r\n<p>Stroke </p>\r\n<p>Gallbladder disease </p>\r\n<p>Osteoarthritis </p>\r\n<p>Sleep apnea and respiratory problems </p>\r\n<p>Some cancers (endometrial, breast, and colon) </p>\r\n<p>Although one of the national health objectives for the year 2010 is to reduce the prevalence of obesity among adults to less than 15%, current data indicate that the situation is worsening rather than improving. This site provides a variety of information designed to help people understand this serious health issue and the efforts being made to address it.</p>\r\n<img src=\"http://www.cdc.gov/nccdphp/dnpa/obesity/images/obesity_graphic.jpg\" border=\"0\"></img>'),(4795,285,0.13,'php','0','Copied the page over from dev site... now testing.',1139550774,2,'24.2.76.126','<?php\r\n\r\n// USE THE PRODUCTION SYSTEM NOW!\r\n\r\n\r\n$SPADE[\'template\']->assign(\'pgLayout\', \'none\');\r\n\r\ndefine(\'EHC_SESSION_KEY\', \'Mr.Blodgett and Mr.Gwynn\');\r\n\r\n\r\n$fp = fopen (\'webservices.log\', \'a\');\r\nfwrite($fp, date(\'Ymd-His\') . \':::Request from:\' . $_SERVER[\'REMOTE_ADDR\'] . \':::\' . $HTTP_RAW_POST_DATA.\"\\n\");\r\nfclose($fp);\r\n\r\n\r\nfunction authenticateCompany( $username, $password, $companyId ) {\r\n	global $SPADE;\r\n\r\n	$ipAddress = $_SERVER[\'REMOTE_ADDR\'];		// This should be the IP of the connecting host\r\n\r\n	$Q = \"SELECT ci.*, c.userId, c.companyName, c.companyVanity\r\n		FROM company_integrations ci\r\n		INNER JOIN companies c ON (ci.companyId = c.id)\r\n		WHERE ci.companyId = \" . (int)$companyId . \"\r\n		AND ci.username = \'\" . $username . \"\'\r\n		AND ci.password = \'\" . md5($password) . \"\'\r\n		AND ci.ipAddress = \'\" . $ipAddress . \"\'\r\n		AND ci.isActive = \'yes\'\";\r\n\r\n	return $SPADE[\'db\']->query($Q, DB_ROW);\r\n}\r\n\r\n\r\nclass EhcIntegrationService { \r\n	//private $quotes = array(\"ibm\" => 98.42);   \r\n	\r\n	function createSession($objSession) { \r\n		global $SPADE;\r\n\r\n		$objResponse = new stdClass();\r\n\r\n		$username = $objSession->username;\r\n		$password = $objSession->password;\r\n		$companyId = $objSession->company_id;\r\n		$foreignId = $objSession->foreign_id;\r\n		$emailAddress = $objSession->email_address;  // email address of end user\r\n\r\n		$company = authenticateCompany($username, $password, $companyId);\r\n\r\n		if (TRUE || !$emailAddress || !$company) {\r\n\r\n			$objResponse->user_id = \'0\';\r\n			$objResponse->session_id = \'ERROR\';\r\n			//$objResponse->detail = \'Unauthorized, unregistered, bad login, or no email address specified.\';\r\n			$objResponse->detail = \'This response came from the old server. Please clear WSDL cache.\';\r\n			$objResponse->company_vanity = \'unknown\';\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		$ipAddress = $objSession->ip_address;  // IP address of the end-user\r\n		$firstName = $objSession->first_name;\r\n		$lastName = $objSession->last_name;\r\n		$address = $objSession->address;\r\n		$city = $objSession->city;\r\n		$state = $objSession->state;\r\n		$phone = $objSession->phone;\r\n\r\n		/*// Optional section to delete entries that are expired\r\n		$Q = \"DELETE FROM user_sessions WHERE expirationDate < \" . time();\r\n		$SPADE[\'db\']->query($Q);\r\n		//*/\r\n\r\n		/*// Optional section to delete existing entries for this email address\r\n		$Q = \"DELETE FROM user_sessions WHERE emailAddress = \'\" . $emailAddress . \"\'\";\r\n		$SPADE[\'db\']->query($Q);\r\n		//*/\r\n\r\n		$Q = \"SELECT *\r\n			FROM _users\r\n			WHERE foreignId = \'\" . $foreignId . \"\'\";\r\n			//WHERE email = \'\" . $emailAddress . \"\'\";   // Old method\r\n\r\n		$userCheck = $SPADE[\'db\']->query($Q);\r\n\r\n		if (!is_array($userCheck)) {\r\n			$objResponse->user_id = 0;\r\n			$objResponse->detail = \'New user. Ready to be created.\';\r\n			$objResponse->company_vanity = serialize($company); //$company[\'companyVanity\'];\r\n			\r\n			$temp = array(\'email\' => $emailAddress,\r\n					\'firstName\' => $firstName,\r\n					\'lastName\' => $lastName,\r\n					\'address\' => $address,\r\n					\'city\' => $city,\r\n					\'state\' => $state,\r\n					\'phone\' => $phone\r\n				);\r\n\r\n			// serialize user details to be stored in notes for session	\r\n			$sessionNotes = serialize($temp);\r\n\r\n		} elseif ( count($userCheck) > 1) {\r\n			$objResponse->user_id = 0;\r\n			$objResponse->session_id = \'ERROR\';\r\n			$objResponse->detail = \'Duplicate e-mail address. Contact us for help.\';\r\n			$objResponse->company_vanity = \'unknown\';\r\n\r\n			return $objResponse;\r\n\r\n		} elseif ( count($userCheck) == 1) {\r\n			// good things...\r\n			$userCheck = $userCheck[0];\r\n\r\n			$objResponse->user_id = $userCheck[\'id\'];\r\n			$objResponse->detail = \'Existing user, ready to authenticate.\';\r\n			$objResponse->company_vanity = $company[\'companyVanity\'];\r\n\r\n			$sessionNotes = $objResponse->detail;\r\n			\r\n		} else {\r\n			return \'FATAL ERROR\';\r\n		}\r\n\r\n		$objResponse->session_id = ($objResponse->session_id)\r\n						? $objResponse->session_id\r\n						: md5($username . $password . $emailAddress . microtime() . EHC_SESSION_KEY);\r\n\r\n		$Q = \"INSERT INTO user_sessions (userId, companyId, foreignId, emailAddress, ipAddress, referer, sessionId, expirationDate, notes)\r\n			VALUES (\" . (int)$objResponse->user_id . \",\r\n				\" . (int)$companyId . \",\r\n				\'\" . $foreignId . \"\',\r\n				\'\" . $emailAddress . \"\',\r\n				\'\" . $ipAddress . \"\',\r\n				\'\" . $company[\'domain\'] . \"\',\r\n				\'\" . $objResponse->session_id . \"\',\r\n				\" . (time() + 3600) . \",\r\n				\'\" . $sessionNotes . \"\')\";\r\n\r\n		if (!$SPADE[\'db\']->query($Q)) {\r\n			$objResponse->session_id = \'XXXXXX\';\r\n			$objResponse->detail = \'Unable to create session.\';\r\n		}\r\n\r\n		return $objResponse; \r\n	}\r\n\r\n	function sendEstatEntries($objEstatEntries) {\r\n		global $SPADE;\r\n\r\n		$username = $objEstatEntries->username;\r\n		$password = $objEstatEntries->password;\r\n		$companyId = $objEstatEntries->company_id;\r\n\r\n		$objResponse = new stdClass();\r\n		$objResponse->estat_entry = array();\r\n\r\n		if (!is_array($objEstatEntries->estat_entry)) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'estat entry not an array.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n			\r\n		if (!count($objEstatEntries->estat_entry)) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'estat entries count failed.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		if (!($company = authenticateCompany($username, $password, $companyId))) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'unable to authenticate company.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n		\r\n		if (!is_array($objEstatEntries->estat_entry)\r\n			|| !count($objEstatEntries->estat_entry) \r\n			|| !($company = authenticateCompany($username, $password, $companyId))) {\r\n\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'Unauthorized, unregistered, bad login, or no estat entries specified.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		\r\n		$users = array();\r\n\r\n		foreach ($objEstatEntries->estat_entry as $entry) {\r\n			// get user info for this user, if we don\'t already have it loaded\r\n\r\n			if (!$users[$entry->foreign_id][\'id\']) {\r\n				//$Q = \"SELECT * FROM _users WHERE email = \'\" . $entry->email_address . \"\'\";\r\n				$Q = \"SELECT * FROM _users WHERE foreignId = \'\" . $entry->foreign_id . \"\'\";\r\n				\r\n				$users[$entry->foreign_id] = $SPADE[\'db\']->query($Q, DB_ROW);\r\n\r\n				if (!$users[$entry->foreign_id]) {\r\n					// couldn\'t find user by foreign ID\r\n					$objResponse->estat_entry[] = array(\r\n						\'id\' => 0,\r\n						\'confirmation\' => \'Could not find user with foreign ID \"\' . $entry->foreign_id . \'\".\'\r\n					);\r\n\r\n					continue;\r\n				}\r\n			}\r\n\r\n			/*//\r\n			$objResponse = new stdClass();\r\n			$objResponse->estat_entry[] = array(\'id\' => 0,\'confirmation\' => \'Query:\' . $Q);\r\n			return $objResponse;\r\n			//*/\r\n\r\n			$Q = \"REPLACE INTO estat_entries (userId, estatId, value, dateOfEntry, createdByUserId, dateCreated)\r\n				VALUES (\r\n					\" . (int)$users[$entry->foreign_id][\'id\'] . \",	\r\n					\" . (int)$entry->estat_id . \",\r\n					\'\" . $entry->value . \"\',\r\n					\'\" . strtotime($entry->date_of_entry) . \"\',\r\n					\" . (int)$company[\'userId\'] . \",\r\n					\" . time() . \"\r\n				)\";\r\n\r\n			if ($newId = $SPADE[\'db\']->query($Q)) {\r\n				$objResponse->estat_entry[] = array(\r\n					\'id\' => $newId,\r\n					\'confirmation\' => \'eStat entry recorded successfully.\'\r\n				);\r\n			} else {\r\n				$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'An error occurred while attempting to record this estat entry.\'\r\n				);\r\n			}\r\n		}\r\n\r\n		return $objResponse;\r\n	}\r\n}\r\n\r\nclass EhcIntegrationServiceRpcEnc extends EhcIntegrationService {\r\n	function createSession($username, $password, $company_id, $foreign_id, $email_address, $ip_address, $first_name, $last_name, $address, $city, $state, $phone) {\r\n		$objSession = new stdClass();\r\n\r\n		$objSession->username = $username;\r\n		$objSession->password = $password;\r\n		$objSession->company_id = $company_id;\r\n		$objSession->foreign_id = $foreign_id;\r\n		$objSession->email_address = $email_address;\r\n		$objSession->ip_address = $ip_address;\r\n		$objSession->first_name = $first_name;\r\n		$objSession->last_name = $last_name;\r\n		$objSession->address = $address;\r\n		$objSession->city = $city;\r\n		$objSession->state = $state;\r\n		$objSession->phone = $phone;\r\n\r\n		$objResponse = parent::createSession($objSession);\r\n		$strResponse = $objResponse->user_id . \'::\' . $objResponse->session_id . \'::\' . $objResponse->detail . \'::\' . $objResponse->company_vanity;\r\n\r\n		return $strResponse;\r\n	}\r\n\r\n	function sendEstatEntries($username, $password, $company_id, $estat_entries) {\r\n		$objEstatEntries = new stdClass();\r\n\r\n		$objEstatEntries->username = $username;\r\n		$objEstatEntries->password = $password;\r\n		$objEstatEntries->company_id = $company_id;\r\n\r\n		$arrRawEntries = split(\'%%\', $estat_entries);\r\n\r\n		foreach ($arrRawEntries as $strRawEntry) {\r\n			$arrEntryElements = split(\'::\', $strRawEntry);\r\n\r\n			$objEntry = new stdClass();\r\n			$objEntry->foreign_id = $arrEntryElements[0];\r\n			$objEntry->estat_id = $arrEntryElements[1];\r\n			$objEntry->date_of_entry = $arrEntryElements[2];\r\n			$objEntry->value = $arrEntryElements[3];\r\n\r\n			$objEstatEntries->estat_entry[] = $objEntry; \r\n		}\r\n\r\n		$objResponse = parent::sendEstatEntries($objEstatEntries);\r\n\r\n		$strResponse = \'\';\r\n\r\n		foreach ($objResponse->estat_entry as $arrEstatEntry) {\r\n			$strResponse .= $arrEstatEntry[\'id\'] . \'::\' . $arrEstatEntry[\'confirmation\'] . \'%%\';\r\n		}\r\n\r\n		$strResponse = substr($strResponse, 0, -2);\r\n\r\n		return $strResponse;\r\n	}\r\n}\r\n\r\nif ($_REQUEST[\'style\'] == \'rpcenc\') {\r\n	$server = new SoapServer(\"webservices/eis-rpcenc.wsdl\"); \r\n	$server->setClass(\"EhcIntegrationServiceRpcEnc\");\r\n	$server->handle(); \r\n} else {\r\n	$server = new SoapServer(\"webservices/eis-doclit.wsdl\"); \r\n	$server->setClass(\"EhcIntegrationService\");\r\n	$server->handle(); \r\n}\r\n\r\n?>'),(4762,251,0.41,'smarty','0','',1138605416,889,'63.228.198.11','{if $smarty.request.submit_send neq \"\" && $smarty.request.fromEmail neq \"\"}{include_php file=\"shared_handle:adminMultiMailTemplate\"}{/if}\r\n{assign var=\"hideWidgets\" value=\"true\"}\r\n{assign var=\"wideFormat\" value=\"true\"}\r\n\r\n{select_query assign=\"aGroups\" return=\"array\"}\r\n	name, description from _groups\r\n{/select_query}\r\n\r\n{select_query assign=\"aCompanies\" return=\"array\"}\r\n	id, companyName AS name FROM companies\r\n{/select_query}\r\n \r\n<h1 class=\"underline\">Broadcast an Email</h1>\r\n<br />\r\n\r\n<form name=\"emailForm\" method=\"post\" action=\"index.php\">\r\n<input type=\"hidden\" name=\"pg\" value=\"sendTemplatedEmail\"> \r\n<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n\r\n<div>{assign var=\"userName\" value=\"`$user->firstName` `$user->lastName`\"}\r\n<b>From Name:&nbsp;</b><input type=\"text\" name=\"fromName\" value=\"{$smarty.request.fromName|stripslashes|default:$userName}\" /> &nbsp; \r\n<b>From Email:&nbsp;</b><input type=\"text\" name=\"fromEmail\" value=\"{$smarty.request.fromEmail|default:$user->email}\" /><br />\r\n<b>Subject Line:&nbsp;</b><input type=\"text\" name=\"mailSubject\" value=\"{$smarty.request.mailSubject|stripslashes}\" style=\"width:380px;\" /><br /><br />\r\n\r\n<b><input type=\"checkbox\" name=\"toNewsletterSubscribers\" value=\"1\" /> Send to All Newsletter Subscribers?</b>\r\n<br/><br />\r\n\r\n<b>Select each Company:</b> <small>(hold <b>CTRL</b> key)</small><br />\r\n<select name=\"toCompanies[]\" multiple>{foreach from=$aCompanies item=\"row\"}\r\n	<option value=\"{$row.id}\">{$row.name} - {$row.description}</option>{/foreach}\r\n</select><br />\r\n<small><em>* Will not send message to addresses in the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Select the Email Groups:</b> <small>(hold <b>CTRL</b> key)</small><br />\r\n<select name=\"toGroups[]\" multiple>{foreach from=$aGroups item=\"row\"}\r\n	<option value=\"{$row.name}\">{$row.name} - {$row.description}</option>{/foreach}\r\n</select><br />\r\n<small><em>* Will not send message to addresses in the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Enter Additional Email Addresses: <small>(comma delimited)</small></b>\r\n<textarea style=\"width:500px;display:block;\" name=\"toAddresses\"></textarea>\r\n<small><em>* These addresses are not checked against the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Title:</b> <small>(to be shown in offline email clients)</small><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"offlinetitle\" value=\"{$smarty.request.offlinetitle|stripslashes|default:\'eHealthComplete Newsletter\'}\" /><br />\r\n\r\n<br />\r\n<input type=\"checkbox\" name=\"hidestorelink\" /> <b>Hide Store Link?</b><br />\r\n<input type=\"checkbox\" name=\"hidebannerad\" /> <b>Hide Banner Ad?</b> <small>(not necessary if no ad image is entered)</small><br />\r\n<input type=\"checkbox\" name=\"hidesponsorads\" /> <b>Hide Sponsor Images</b> <small>(not necessary if no sponsor images are entered)</small><br />\r\n<br />\r\n<b>Main Banner Image:</b><br/>\r\n<script>{literal}\r\nfunction setMainBannerImage(str) {\r\ndocument.getElementById(\'mainbannerimage\').src=\"/systems/wlw/layouts/newsletter/\" + str;\r\n}\r\n{/literal}</script>\r\n<img id=\"mainbannerimage\" src=\"/systems/wlw/layouts/newsletter/{$smarty.request.mainbannerimage|stripslashes|default:\"banner_shoes.jpg\"}\" style=\"border:2px solid #000000; margin:5px 0px;\"><br/>\r\n{php}\r\nglobal $SPADE;\r\n$bannerimages = array(\r\narray(\"name\" => \"banner_apples.jpg\", \"title\" => \"Apples\"),\r\narray(\"name\" => \"banner_autumn.jpg\", \"title\" => \"Autumn Trees\"),\r\narray(\"name\" => \"banner_basketball.jpg\", \"title\" => \"Basketball\"),\r\narray(\"name\" => \"banner_beach.jpg\", \"title\" => \"Beach\"),\r\narray(\"name\" => \"banner_fruit.jpg\", \"title\" => \"Fruit Splashing\"),\r\narray(\"name\" => \"banner_grass.jpg\", \"title\" => \"Grass & Sky\"),\r\narray(\"name\" => \"banner_jogging.jpg\", \"title\" => \"Jogging People\"),\r\narray(\"name\" => \"banner_jumping.jpg\", \"title\" => \"Jumping Girl\"),\r\narray(\"name\" => \"banner_kiwi.jpg\", \"title\" => \"Kiwis\"),\r\narray(\"name\" => \"banner_palmtrees.jpg\", \"title\" => \"Palm Trees & Ocean\"),\r\narray(\"name\" => \"banner_pond.jpg\", \"title\" => \"Pond\"),\r\narray(\"name\" => \"banner_pumpkins1.jpg\", \"title\" => \"Pumpkins #1\"),\r\narray(\"name\" => \"banner_pumpkins2.jpg\", \"title\" => \"Pumpkins #2\"),\r\narray(\"name\" => \"banner_rose.jpg\", \"title\" => \"Rose\"),\r\narray(\"name\" => \"banner_runner.jpg\", \"title\" => \"Runner\"),\r\narray(\"name\" => \"banner_scale.jpg\", \"title\" => \"Weight Scale\"),\r\narray(\"name\" => \"banner_shoes.jpg\", \"title\" => \"Running Shoes\"),\r\narray(\"name\" => \"banner_snowman.jpg\", \"title\" => \"Snowman\"),\r\narray(\"name\" => \"banner_springtime.jpg\", \"title\" => \"Girl Smiling\"),\r\narray(\"name\" => \"banner_thanksgiving1.jpg\", \"title\" => \"Thanksgiving #1\"),\r\narray(\"name\" => \"banner_thanksgiving2.jpg\", \"title\" => \"Thanksgiving #2\"),\r\narray(\"name\" => \"banner_tulips.jpg\", \"title\" => \"Tulips\"),\r\narray(\"name\" => \"banner_vegetables.jpg\", \"title\" => \"Vegetables\"),\r\narray(\"name\" => \"banner_weights.jpg\", \"title\" => \"Weights\"),\r\narray(\"name\" => \"banner_wheat.jpg\", \"title\" => \"Wheat\"),\r\narray(\"name\" => \"banner_winter.jpg\", \"title\" => \"Winter\")\r\n);\r\n$SPADE[\'template\']->assign(\"bannerimages\", $bannerimages);\r\n{/php}\r\n<table border=\"0\">\r\n<tr>\r\n{foreach name=banners item=b from=$bannerimages}\r\n<td><input type=\"radio\" name=\"mainbannerimage\" value=\"{$b.name}\" {if $smarty.request.mainbannerimage == $b.name}checked{/if} onclick=\"setMainBannerImage(this.value);\"/> {$b.title}</td>\r\n{if $smarty.foreach.banners.iteration % 3 == 0 && !$smarty.foreach.banners.last}</tr><tr>{/if}\r\n{/foreach}\r\n</tr>\r\n</table>\r\n\r\n<table border=\"0\">\r\n<tr><td colspan=\"4\"><b>Banner Ad:</b></td></tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"bannerimage\" value=\"{$smarty.request.bannerimage|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"bannerurl\" value=\"{$smarty.request.bannerurl|stripslashes}\" /></td>\r\n</tr>\r\n<tr><td colspan=\"4\"><b>Sponsor Ads:</b></td></tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor1image\" value=\"{$smarty.request.sponsor1image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor1url\" value=\"{$smarty.request.sponsor1url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor2image\" value=\"{$smarty.request.sponsor2image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor2url\" value=\"{$smarty.request.sponsor2url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor3image\" value=\"{$smarty.request.sponsor3image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor3url\" value=\"{$smarty.request.sponsor3url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor4image\" value=\"{$smarty.request.sponsor4image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor4url\" value=\"{$smarty.request.sponsor4url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor5image\" value=\"{$smarty.request.sponsor5image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor5url\" value=\"{$smarty.request.sponsor5url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor6image\" value=\"{$smarty.request.sponsor6image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor6url\" value=\"{$smarty.request.sponsor6url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor7image\" value=\"{$smarty.request.sponsor7image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor7url\" value=\"{$smarty.request.sponsor7url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor8image\" value=\"{$smarty.request.sponsor8image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor8url\" value=\"{$smarty.request.sponsor8url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor9image\" value=\"{$smarty.request.sponsor9image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor9url\" value=\"{$smarty.request.sponsor9url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor10image\" value=\"{$smarty.request.sponsor10image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor10url\" value=\"{$smarty.request.sponsor10url|stripslashes}\" /></td>\r\n</tr>\r\n\r\n</table>\r\n<small><em>* image urls MUST be absolute (e.g. \"http://...\").</em></small><br />\r\n\r\n<br />\r\n<b>Feature Image URL:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"featureimage\" value=\"{$smarty.request.featureimage|stripslashes}\" /><br />\r\n<small><em>* image urls MUST be absolute (e.g. \"http://...\").</em></small><br />\r\n<b>Feature Title:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"featuretitle\" value=\"{$smarty.request.featuretitle|stripslashes}\" /><br />\r\n<b>Feature Content:</b><br />\r\n<textarea style=\"width:500px;height:200px;\" name=\"featurebody\">{$smarty.request.featurebody|stripslashes}</textarea><br />\r\n\r\n\r\n<br />\r\n<b>Recipe of the Week Title:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"recipetitle\" value=\"{$smarty.request.recipetitle|stripslashes}\" /><br />\r\n<b>Recipe of the Week Content:</b><br />\r\n<textarea style=\"width:500px;height:140px;\" name=\"recipebody\">{$smarty.request.recipebody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Tip of the Week:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"tipbody\">{$smarty.request.tipbody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Hero Highlight:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"herobody\">{$smarty.request.herobody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Quote:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"quotebody\">{$smarty.request.quotebody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n\r\n<div style=\"text-align:right;\">\r\n<input type=\"button\" value=\"Preview HTML\" onclick=\"previewHTML()\">\r\n<input type=\"submit\" name=\"submit_send\" onclick=\"prepareToSend();\" value=\"Send Now\" />\r\n</div>\r\n</div>\r\n\r\n</form>\r\n\r\n<script language=\"javascript\">{literal}\r\nfunction prepareToSend() {\r\n	dF = document.emailForm;\r\n	dF.pg.value = \"sendTemplatedEmail\";	\r\n	dF.target = \'_self\';\r\n\r\n}\r\nfunction previewHTML() {\r\n	dF = document.emailForm;\r\n	dF.pg.value = \"newsletterpreview\";	\r\n\r\n	webPreview = parent.window.open(\"index.php?pg=newsletterpreview\", \"webPreview\", \"fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=800,height=600,left=10,top=10\");\r\n	dF.target = \'webPreview\';\r\n	dF.submit();\r\n	webPreview.focus();\r\n}\r\n{/literal}</script>'),(4763,251,0.42,'smarty','0','',1138605565,889,'63.228.198.11','{if $smarty.request.submit_send neq \"\" && $smarty.request.fromEmail neq \"\"}{include_php file=\"shared_handle:adminMultiMailTemplate\"}{/if}\r\n{assign var=\"hideWidgets\" value=\"true\"}\r\n{assign var=\"wideFormat\" value=\"true\"}\r\n\r\n{select_query assign=\"aGroups\" return=\"array\"}\r\n	name, description from _groups\r\n{/select_query}\r\n\r\n{select_query assign=\"aCompanies\" return=\"array\"}\r\n	id, companyName AS name FROM companies\r\n{/select_query}\r\n \r\n<h1 class=\"underline\">Broadcast an Email</h1>\r\n<br />\r\n\r\n<form name=\"emailForm\" method=\"post\" action=\"index.php\">\r\n<input type=\"hidden\" name=\"pg\" value=\"sendTemplatedEmail\"> \r\n<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n\r\n<div>{assign var=\"userName\" value=\"`$user->firstName` `$user->lastName`\"}\r\n<b>From Name:&nbsp;</b><input type=\"text\" name=\"fromName\" value=\"{$smarty.request.fromName|stripslashes|default:$userName}\" /> &nbsp; \r\n<b>From Email:&nbsp;</b><input type=\"text\" name=\"fromEmail\" value=\"{$smarty.request.fromEmail|default:$user->email}\" /><br />\r\n<b>Subject Line:&nbsp;</b><input type=\"text\" name=\"mailSubject\" value=\"{$smarty.request.mailSubject|stripslashes}\" style=\"width:380px;\" /><br /><br />\r\n\r\n<b><input type=\"checkbox\" name=\"toNewsletterSubscribers\" value=\"1\" /> Send to All Newsletter Subscribers?</b>\r\n<br/><br />\r\n\r\n<b>Select each Company:</b> <small>(hold <b>CTRL</b> key)</small><br />\r\n<select name=\"toCompanies[]\" multiple>{foreach from=$aCompanies item=\"row\"}\r\n	<option value=\"{$row.id}\">{$row.name} - {$row.description}</option>{/foreach}\r\n</select><br />\r\n<small><em>* Will not send message to addresses in the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Select the Email Groups:</b> <small>(hold <b>CTRL</b> key)</small><br />\r\n<select name=\"toGroups[]\" multiple>{foreach from=$aGroups item=\"row\"}\r\n	<option value=\"{$row.name}\">{$row.name} - {$row.description}</option>{/foreach}\r\n</select><br />\r\n<small><em>* Will not send message to addresses in the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Enter Additional Email Addresses: <small>(comma delimited)</small></b>\r\n<textarea style=\"width:500px;display:block;\" name=\"toAddresses\"></textarea>\r\n<small><em>* These addresses are not checked against the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Title:</b> <small>(to be shown in offline email clients)</small><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"offlinetitle\" value=\"{$smarty.request.offlinetitle|stripslashes|default:\'eHealthComplete Newsletter\'}\" /><br />\r\n\r\n<br />\r\n<input type=\"checkbox\" name=\"hidestorelink\" /> <b>Hide Store Link?</b><br />\r\n<input type=\"checkbox\" name=\"hidebannerad\" /> <b>Hide Banner Ad?</b> <small>(not necessary if no ad image is entered)</small><br />\r\n<input type=\"checkbox\" name=\"hidesponsorads\" /> <b>Hide Sponsor Images</b> <small>(not necessary if no sponsor images are entered)</small><br />\r\n<br />\r\n<b>Main Banner Image:</b><br/>\r\n* Note: this will not change the image until a caching error is resolved.\r\n<script>{literal}\r\nfunction setMainBannerImage(str) {\r\ndocument.getElementById(\'mainbannerimage\').src=\"/systems/wlw/layouts/newsletter/\" + str;\r\n}\r\n{/literal}</script>\r\n<img id=\"mainbannerimage\" src=\"/systems/wlw/layouts/newsletter/{$smarty.request.mainbannerimage|stripslashes|default:\"banner_shoes.jpg\"}\" style=\"border:2px solid #000000; margin:5px 0px;\"><br/>\r\n{php}\r\nglobal $SPADE;\r\n$bannerimages = array(\r\narray(\"name\" => \"banner_apples.jpg\", \"title\" => \"Apples\"),\r\narray(\"name\" => \"banner_autumn.jpg\", \"title\" => \"Autumn Trees\"),\r\narray(\"name\" => \"banner_basketball.jpg\", \"title\" => \"Basketball\"),\r\narray(\"name\" => \"banner_beach.jpg\", \"title\" => \"Beach\"),\r\narray(\"name\" => \"banner_fruit.jpg\", \"title\" => \"Fruit Splashing\"),\r\narray(\"name\" => \"banner_grass.jpg\", \"title\" => \"Grass & Sky\"),\r\narray(\"name\" => \"banner_jogging.jpg\", \"title\" => \"Jogging People\"),\r\narray(\"name\" => \"banner_jumping.jpg\", \"title\" => \"Jumping Girl\"),\r\narray(\"name\" => \"banner_kiwi.jpg\", \"title\" => \"Kiwis\"),\r\narray(\"name\" => \"banner_palmtrees.jpg\", \"title\" => \"Palm Trees & Ocean\"),\r\narray(\"name\" => \"banner_pond.jpg\", \"title\" => \"Pond\"),\r\narray(\"name\" => \"banner_pumpkins1.jpg\", \"title\" => \"Pumpkins #1\"),\r\narray(\"name\" => \"banner_pumpkins2.jpg\", \"title\" => \"Pumpkins #2\"),\r\narray(\"name\" => \"banner_rose.jpg\", \"title\" => \"Rose\"),\r\narray(\"name\" => \"banner_runner.jpg\", \"title\" => \"Runner\"),\r\narray(\"name\" => \"banner_scale.jpg\", \"title\" => \"Weight Scale\"),\r\narray(\"name\" => \"banner_shoes.jpg\", \"title\" => \"Running Shoes\"),\r\narray(\"name\" => \"banner_snowman.jpg\", \"title\" => \"Snowman\"),\r\narray(\"name\" => \"banner_springtime.jpg\", \"title\" => \"Girl Smiling\"),\r\narray(\"name\" => \"banner_thanksgiving1.jpg\", \"title\" => \"Thanksgiving #1\"),\r\narray(\"name\" => \"banner_thanksgiving2.jpg\", \"title\" => \"Thanksgiving #2\"),\r\narray(\"name\" => \"banner_tulips.jpg\", \"title\" => \"Tulips\"),\r\narray(\"name\" => \"banner_vegetables.jpg\", \"title\" => \"Vegetables\"),\r\narray(\"name\" => \"banner_weights.jpg\", \"title\" => \"Weights\"),\r\narray(\"name\" => \"banner_wheat.jpg\", \"title\" => \"Wheat\"),\r\narray(\"name\" => \"banner_winter.jpg\", \"title\" => \"Winter\")\r\n);\r\n$SPADE[\'template\']->assign(\"bannerimages\", $bannerimages);\r\n{/php}\r\n<table border=\"0\">\r\n<tr>\r\n{foreach name=banners item=b from=$bannerimages}\r\n<td><input type=\"radio\" name=\"mainbannerimage\" value=\"{$b.name}\" {if $smarty.request.mainbannerimage == $b.name}checked{/if} onclick=\"setMainBannerImage(this.value);\"/> {$b.title}</td>\r\n{if $smarty.foreach.banners.iteration % 3 == 0 && !$smarty.foreach.banners.last}</tr><tr>{/if}\r\n{/foreach}\r\n</tr>\r\n</table>\r\n\r\n<table border=\"0\">\r\n<tr><td colspan=\"4\"><b>Banner Ad:</b></td></tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"bannerimage\" value=\"{$smarty.request.bannerimage|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"bannerurl\" value=\"{$smarty.request.bannerurl|stripslashes}\" /></td>\r\n</tr>\r\n<tr><td colspan=\"4\"><b>Sponsor Ads:</b></td></tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor1image\" value=\"{$smarty.request.sponsor1image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor1url\" value=\"{$smarty.request.sponsor1url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor2image\" value=\"{$smarty.request.sponsor2image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor2url\" value=\"{$smarty.request.sponsor2url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor3image\" value=\"{$smarty.request.sponsor3image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor3url\" value=\"{$smarty.request.sponsor3url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor4image\" value=\"{$smarty.request.sponsor4image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor4url\" value=\"{$smarty.request.sponsor4url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor5image\" value=\"{$smarty.request.sponsor5image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor5url\" value=\"{$smarty.request.sponsor5url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor6image\" value=\"{$smarty.request.sponsor6image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor6url\" value=\"{$smarty.request.sponsor6url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor7image\" value=\"{$smarty.request.sponsor7image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor7url\" value=\"{$smarty.request.sponsor7url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor8image\" value=\"{$smarty.request.sponsor8image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor8url\" value=\"{$smarty.request.sponsor8url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor9image\" value=\"{$smarty.request.sponsor9image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor9url\" value=\"{$smarty.request.sponsor9url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor10image\" value=\"{$smarty.request.sponsor10image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor10url\" value=\"{$smarty.request.sponsor10url|stripslashes}\" /></td>\r\n</tr>\r\n\r\n</table>\r\n<small><em>* image urls MUST be absolute (e.g. \"http://...\").</em></small><br />\r\n\r\n<br />\r\n<b>Feature Image URL:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"featureimage\" value=\"{$smarty.request.featureimage|stripslashes}\" /><br />\r\n<small><em>* image urls MUST be absolute (e.g. \"http://...\").</em></small><br />\r\n<b>Feature Title:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"featuretitle\" value=\"{$smarty.request.featuretitle|stripslashes}\" /><br />\r\n<b>Feature Content:</b><br />\r\n<textarea style=\"width:500px;height:200px;\" name=\"featurebody\">{$smarty.request.featurebody|stripslashes}</textarea><br />\r\n\r\n\r\n<br />\r\n<b>Recipe of the Week Title:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"recipetitle\" value=\"{$smarty.request.recipetitle|stripslashes}\" /><br />\r\n<b>Recipe of the Week Content:</b><br />\r\n<textarea style=\"width:500px;height:140px;\" name=\"recipebody\">{$smarty.request.recipebody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Tip of the Week:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"tipbody\">{$smarty.request.tipbody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Hero Highlight:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"herobody\">{$smarty.request.herobody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Quote:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"quotebody\">{$smarty.request.quotebody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n\r\n<div style=\"text-align:right;\">\r\n<input type=\"button\" value=\"Preview HTML\" onclick=\"previewHTML()\">\r\n<input type=\"submit\" name=\"submit_send\" onclick=\"prepareToSend();\" value=\"Send Now\" />\r\n</div>\r\n</div>\r\n\r\n</form>\r\n\r\n<script language=\"javascript\">{literal}\r\nfunction prepareToSend() {\r\n	dF = document.emailForm;\r\n	dF.pg.value = \"sendTemplatedEmail\";	\r\n	dF.target = \'_self\';\r\n\r\n}\r\nfunction previewHTML() {\r\n	dF = document.emailForm;\r\n	dF.pg.value = \"newsletterpreview\";	\r\n\r\n	webPreview = parent.window.open(\"index.php?pg=newsletterpreview\", \"webPreview\", \"fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=800,height=600,left=10,top=10\");\r\n	dF.target = \'webPreview\';\r\n	dF.submit();\r\n	webPreview.focus();\r\n}\r\n{/literal}</script>'),(4764,251,0.43,'smarty','0','',1138605591,889,'63.228.198.11','{if $smarty.request.submit_send neq \"\" && $smarty.request.fromEmail neq \"\"}{include_php file=\"shared_handle:adminMultiMailTemplate\"}{/if}\r\n{assign var=\"hideWidgets\" value=\"true\"}\r\n{assign var=\"wideFormat\" value=\"true\"}\r\n\r\n{select_query assign=\"aGroups\" return=\"array\"}\r\n	name, description from _groups\r\n{/select_query}\r\n\r\n{select_query assign=\"aCompanies\" return=\"array\"}\r\n	id, companyName AS name FROM companies\r\n{/select_query}\r\n \r\n<h1 class=\"underline\">Broadcast an Email</h1>\r\n<br />\r\n\r\n<form name=\"emailForm\" method=\"post\" action=\"index.php\">\r\n<input type=\"hidden\" name=\"pg\" value=\"sendTemplatedEmail\"> \r\n<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n\r\n<div>{assign var=\"userName\" value=\"`$user->firstName` `$user->lastName`\"}\r\n<b>From Name:&nbsp;</b><input type=\"text\" name=\"fromName\" value=\"{$smarty.request.fromName|stripslashes|default:$userName}\" /> &nbsp; \r\n<b>From Email:&nbsp;</b><input type=\"text\" name=\"fromEmail\" value=\"{$smarty.request.fromEmail|default:$user->email}\" /><br />\r\n<b>Subject Line:&nbsp;</b><input type=\"text\" name=\"mailSubject\" value=\"{$smarty.request.mailSubject|stripslashes}\" style=\"width:380px;\" /><br /><br />\r\n\r\n<b><input type=\"checkbox\" name=\"toNewsletterSubscribers\" value=\"1\" /> Send to All Newsletter Subscribers?</b>\r\n<br/><br />\r\n\r\n<b>Select each Company:</b> <small>(hold <b>CTRL</b> key)</small><br />\r\n<select name=\"toCompanies[]\" multiple>{foreach from=$aCompanies item=\"row\"}\r\n	<option value=\"{$row.id}\">{$row.name} - {$row.description}</option>{/foreach}\r\n</select><br />\r\n<small><em>* Will not send message to addresses in the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Select the Email Groups:</b> <small>(hold <b>CTRL</b> key)</small><br />\r\n<select name=\"toGroups[]\" multiple>{foreach from=$aGroups item=\"row\"}\r\n	<option value=\"{$row.name}\">{$row.name} - {$row.description}</option>{/foreach}\r\n</select><br />\r\n<small><em>* Will not send message to addresses in the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Enter Additional Email Addresses: <small>(comma delimited)</small></b>\r\n<textarea style=\"width:500px;display:block;\" name=\"toAddresses\"></textarea>\r\n<small><em>* These addresses are not checked against the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Title:</b> <small>(to be shown in offline email clients)</small><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"offlinetitle\" value=\"{$smarty.request.offlinetitle|stripslashes|default:\'eHealthComplete Newsletter\'}\" /><br />\r\n\r\n<br />\r\n<input type=\"checkbox\" name=\"hidestorelink\" /> <b>Hide Store Link?</b><br />\r\n<input type=\"checkbox\" name=\"hidebannerad\" /> <b>Hide Banner Ad?</b> <small>(not necessary if no ad image is entered)</small><br />\r\n<input type=\"checkbox\" name=\"hidesponsorads\" /> <b>Hide Sponsor Images</b> <small>(not necessary if no sponsor images are entered)</small><br />\r\n<br />\r\n<b>Main Banner Image:</b><br/>\r\n* Note: this will not change the image until a caching error is resolved.<br/>\r\n<script>{literal}\r\nfunction setMainBannerImage(str) {\r\ndocument.getElementById(\'mainbannerimage\').src=\"/systems/wlw/layouts/newsletter/\" + str;\r\n}\r\n{/literal}</script>\r\n<img id=\"mainbannerimage\" src=\"/systems/wlw/layouts/newsletter/{$smarty.request.mainbannerimage|stripslashes|default:\"banner_shoes.jpg\"}\" style=\"border:2px solid #000000; margin:5px 0px;\"><br/>\r\n{php}\r\nglobal $SPADE;\r\n$bannerimages = array(\r\narray(\"name\" => \"banner_apples.jpg\", \"title\" => \"Apples\"),\r\narray(\"name\" => \"banner_autumn.jpg\", \"title\" => \"Autumn Trees\"),\r\narray(\"name\" => \"banner_basketball.jpg\", \"title\" => \"Basketball\"),\r\narray(\"name\" => \"banner_beach.jpg\", \"title\" => \"Beach\"),\r\narray(\"name\" => \"banner_fruit.jpg\", \"title\" => \"Fruit Splashing\"),\r\narray(\"name\" => \"banner_grass.jpg\", \"title\" => \"Grass & Sky\"),\r\narray(\"name\" => \"banner_jogging.jpg\", \"title\" => \"Jogging People\"),\r\narray(\"name\" => \"banner_jumping.jpg\", \"title\" => \"Jumping Girl\"),\r\narray(\"name\" => \"banner_kiwi.jpg\", \"title\" => \"Kiwis\"),\r\narray(\"name\" => \"banner_palmtrees.jpg\", \"title\" => \"Palm Trees & Ocean\"),\r\narray(\"name\" => \"banner_pond.jpg\", \"title\" => \"Pond\"),\r\narray(\"name\" => \"banner_pumpkins1.jpg\", \"title\" => \"Pumpkins #1\"),\r\narray(\"name\" => \"banner_pumpkins2.jpg\", \"title\" => \"Pumpkins #2\"),\r\narray(\"name\" => \"banner_rose.jpg\", \"title\" => \"Rose\"),\r\narray(\"name\" => \"banner_runner.jpg\", \"title\" => \"Runner\"),\r\narray(\"name\" => \"banner_scale.jpg\", \"title\" => \"Weight Scale\"),\r\narray(\"name\" => \"banner_shoes.jpg\", \"title\" => \"Running Shoes\"),\r\narray(\"name\" => \"banner_snowman.jpg\", \"title\" => \"Snowman\"),\r\narray(\"name\" => \"banner_springtime.jpg\", \"title\" => \"Girl Smiling\"),\r\narray(\"name\" => \"banner_thanksgiving1.jpg\", \"title\" => \"Thanksgiving #1\"),\r\narray(\"name\" => \"banner_thanksgiving2.jpg\", \"title\" => \"Thanksgiving #2\"),\r\narray(\"name\" => \"banner_tulips.jpg\", \"title\" => \"Tulips\"),\r\narray(\"name\" => \"banner_vegetables.jpg\", \"title\" => \"Vegetables\"),\r\narray(\"name\" => \"banner_weights.jpg\", \"title\" => \"Weights\"),\r\narray(\"name\" => \"banner_wheat.jpg\", \"title\" => \"Wheat\"),\r\narray(\"name\" => \"banner_winter.jpg\", \"title\" => \"Winter\")\r\n);\r\n$SPADE[\'template\']->assign(\"bannerimages\", $bannerimages);\r\n{/php}\r\n<table border=\"0\">\r\n<tr>\r\n{foreach name=banners item=b from=$bannerimages}\r\n<td><input type=\"radio\" name=\"mainbannerimage\" value=\"{$b.name}\" {if $smarty.request.mainbannerimage == $b.name}checked{/if} onclick=\"setMainBannerImage(this.value);\"/> {$b.title}</td>\r\n{if $smarty.foreach.banners.iteration % 3 == 0 && !$smarty.foreach.banners.last}</tr><tr>{/if}\r\n{/foreach}\r\n</tr>\r\n</table>\r\n\r\n<table border=\"0\">\r\n<tr><td colspan=\"4\"><b>Banner Ad:</b></td></tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"bannerimage\" value=\"{$smarty.request.bannerimage|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"bannerurl\" value=\"{$smarty.request.bannerurl|stripslashes}\" /></td>\r\n</tr>\r\n<tr><td colspan=\"4\"><b>Sponsor Ads:</b></td></tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor1image\" value=\"{$smarty.request.sponsor1image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor1url\" value=\"{$smarty.request.sponsor1url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor2image\" value=\"{$smarty.request.sponsor2image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor2url\" value=\"{$smarty.request.sponsor2url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor3image\" value=\"{$smarty.request.sponsor3image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor3url\" value=\"{$smarty.request.sponsor3url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor4image\" value=\"{$smarty.request.sponsor4image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor4url\" value=\"{$smarty.request.sponsor4url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor5image\" value=\"{$smarty.request.sponsor5image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor5url\" value=\"{$smarty.request.sponsor5url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor6image\" value=\"{$smarty.request.sponsor6image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor6url\" value=\"{$smarty.request.sponsor6url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor7image\" value=\"{$smarty.request.sponsor7image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor7url\" value=\"{$smarty.request.sponsor7url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor8image\" value=\"{$smarty.request.sponsor8image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor8url\" value=\"{$smarty.request.sponsor8url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor9image\" value=\"{$smarty.request.sponsor9image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor9url\" value=\"{$smarty.request.sponsor9url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor10image\" value=\"{$smarty.request.sponsor10image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor10url\" value=\"{$smarty.request.sponsor10url|stripslashes}\" /></td>\r\n</tr>\r\n\r\n</table>\r\n<small><em>* image urls MUST be absolute (e.g. \"http://...\").</em></small><br />\r\n\r\n<br />\r\n<b>Feature Image URL:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"featureimage\" value=\"{$smarty.request.featureimage|stripslashes}\" /><br />\r\n<small><em>* image urls MUST be absolute (e.g. \"http://...\").</em></small><br />\r\n<b>Feature Title:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"featuretitle\" value=\"{$smarty.request.featuretitle|stripslashes}\" /><br />\r\n<b>Feature Content:</b><br />\r\n<textarea style=\"width:500px;height:200px;\" name=\"featurebody\">{$smarty.request.featurebody|stripslashes}</textarea><br />\r\n\r\n\r\n<br />\r\n<b>Recipe of the Week Title:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"recipetitle\" value=\"{$smarty.request.recipetitle|stripslashes}\" /><br />\r\n<b>Recipe of the Week Content:</b><br />\r\n<textarea style=\"width:500px;height:140px;\" name=\"recipebody\">{$smarty.request.recipebody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Tip of the Week:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"tipbody\">{$smarty.request.tipbody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Hero Highlight:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"herobody\">{$smarty.request.herobody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Quote:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"quotebody\">{$smarty.request.quotebody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n\r\n<div style=\"text-align:right;\">\r\n<input type=\"button\" value=\"Preview HTML\" onclick=\"previewHTML()\">\r\n<input type=\"submit\" name=\"submit_send\" onclick=\"prepareToSend();\" value=\"Send Now\" />\r\n</div>\r\n</div>\r\n\r\n</form>\r\n\r\n<script language=\"javascript\">{literal}\r\nfunction prepareToSend() {\r\n	dF = document.emailForm;\r\n	dF.pg.value = \"sendTemplatedEmail\";	\r\n	dF.target = \'_self\';\r\n\r\n}\r\nfunction previewHTML() {\r\n	dF = document.emailForm;\r\n	dF.pg.value = \"newsletterpreview\";	\r\n\r\n	webPreview = parent.window.open(\"index.php?pg=newsletterpreview\", \"webPreview\", \"fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=800,height=600,left=10,top=10\");\r\n	dF.target = \'webPreview\';\r\n	dF.submit();\r\n	webPreview.focus();\r\n}\r\n{/literal}</script>'),(4765,251,0.44,'smarty','0','',1138605621,889,'63.228.198.11','{if $smarty.request.submit_send neq \"\" && $smarty.request.fromEmail neq \"\"}{include_php file=\"shared_handle:adminMultiMailTemplate\"}{/if}\r\n{assign var=\"hideWidgets\" value=\"true\"}\r\n{assign var=\"wideFormat\" value=\"true\"}\r\n\r\n{select_query assign=\"aGroups\" return=\"array\"}\r\n	name, description from _groups\r\n{/select_query}\r\n\r\n{select_query assign=\"aCompanies\" return=\"array\"}\r\n	id, companyName AS name FROM companies\r\n{/select_query}\r\n \r\n<h1 class=\"underline\">Broadcast an Email</h1>\r\n<br />\r\n\r\n<form name=\"emailForm\" method=\"post\" action=\"index.php\">\r\n<input type=\"hidden\" name=\"pg\" value=\"sendTemplatedEmail\"> \r\n<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n\r\n<div>{assign var=\"userName\" value=\"`$user->firstName` `$user->lastName`\"}\r\n<b>From Name:&nbsp;</b><input type=\"text\" name=\"fromName\" value=\"{$smarty.request.fromName|stripslashes|default:$userName}\" /> &nbsp; \r\n<b>From Email:&nbsp;</b><input type=\"text\" name=\"fromEmail\" value=\"{$smarty.request.fromEmail|default:$user->email}\" /><br />\r\n<b>Subject Line:&nbsp;</b><input type=\"text\" name=\"mailSubject\" value=\"{$smarty.request.mailSubject|stripslashes}\" style=\"width:380px;\" /><br /><br />\r\n\r\n<b><input type=\"checkbox\" name=\"toNewsletterSubscribers\" value=\"1\" /> Send to All Newsletter Subscribers?</b>\r\n<br/><br />\r\n\r\n<b>Select each Company:</b> <small>(hold <b>CTRL</b> key)</small><br />\r\n<select name=\"toCompanies[]\" multiple>{foreach from=$aCompanies item=\"row\"}\r\n	<option value=\"{$row.id}\">{$row.name} - {$row.description}</option>{/foreach}\r\n</select><br />\r\n<small><em>* Will not send message to addresses in the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Select the Email Groups:</b> <small>(hold <b>CTRL</b> key)</small><br />\r\n<select name=\"toGroups[]\" multiple>{foreach from=$aGroups item=\"row\"}\r\n	<option value=\"{$row.name}\">{$row.name} - {$row.description}</option>{/foreach}\r\n</select><br />\r\n<small><em>* Will not send message to addresses in the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Enter Additional Email Addresses: <small>(comma delimited)</small></b>\r\n<textarea style=\"width:500px;display:block;\" name=\"toAddresses\"></textarea>\r\n<small><em>* These addresses are not checked against the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Title:</b> <small>(to be shown in offline email clients)</small><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"offlinetitle\" value=\"{$smarty.request.offlinetitle|stripslashes|default:\'eHealthComplete Newsletter\'}\" /><br />\r\n\r\n<br />\r\n<input type=\"checkbox\" name=\"hidestorelink\" /> <b>Hide Store Link?</b><br />\r\n<input type=\"checkbox\" name=\"hidebannerad\" /> <b>Hide Banner Ad?</b> <small>(not necessary if no ad image is entered)</small><br />\r\n<input type=\"checkbox\" name=\"hidesponsorads\" /> <b>Hide Sponsor Images</b> <small>(not necessary if no sponsor images are entered)</small><br />\r\n<br />\r\n<b>Main Banner Image:</b><br/>\r\n* Note: this will not change the image until a caching error is resolved.<br/>\r\n<script>{literal}\r\nfunction setMainBannerImage(str) {\r\ndocument.getElementById(\'mainbannerimage\').src=\"/systems/wlw/layouts/newsletter/\" + str;\r\n}\r\n{/literal}</script>\r\n<img id=\"mainbannerimage\" src=\"/systems/wlw/layouts/newsletter/{$smarty.request.mainbannerimage|stripslashes|default:\"banner_shoes.jpg\"}\" style=\"border:2px solid #000000; margin:5px 0px;\"><br/>\r\n{php}\r\nglobal $SPADE;\r\n$bannerimages = array(\r\narray(\"name\" => \"banner_apples.jpg\", \"title\" => \"Apples\"),\r\narray(\"name\" => \"banner_autumn.jpg\", \"title\" => \"Autumn Trees\"),\r\narray(\"name\" => \"banner_basketball.jpg\", \"title\" => \"Basketball\"),\r\narray(\"name\" => \"banner_beach.jpg\", \"title\" => \"Beach\"),\r\narray(\"name\" => \"banner_fruit.jpg\", \"title\" => \"Fruit Splashing\"),\r\narray(\"name\" => \"banner_grass.jpg\", \"title\" => \"Grass & Sky\"),\r\narray(\"name\" => \"banner_jogging.jpg\", \"title\" => \"Jogging People\"),\r\narray(\"name\" => \"banner_jumping.jpg\", \"title\" => \"Jumping Girl\"),\r\narray(\"name\" => \"banner_kiwi.jpg\", \"title\" => \"Kiwis\"),\r\narray(\"name\" => \"banner_palmtrees.jpg\", \"title\" => \"Palm Trees & Ocean\"),\r\narray(\"name\" => \"banner_pond.jpg\", \"title\" => \"Pond\"),\r\narray(\"name\" => \"banner_pumpkins1.jpg\", \"title\" => \"Pumpkins #1\"),\r\narray(\"name\" => \"banner_pumpkins2.jpg\", \"title\" => \"Pumpkins #2\"),\r\narray(\"name\" => \"banner_rose.jpg\", \"title\" => \"Rose\"),\r\narray(\"name\" => \"banner_runner.jpg\", \"title\" => \"Runner\"),\r\narray(\"name\" => \"banner_scale.jpg\", \"title\" => \"Weight Scale\"),\r\narray(\"name\" => \"banner_shoes.jpg\", \"title\" => \"Running Shoes\"),\r\narray(\"name\" => \"banner_snowman.jpg\", \"title\" => \"Snowman\"),\r\narray(\"name\" => \"banner_springtime.jpg\", \"title\" => \"Girl Smiling\"),\r\narray(\"name\" => \"banner_thanksgiving1.jpg\", \"title\" => \"Thanksgiving #1\"),\r\narray(\"name\" => \"banner_thanksgiving2.jpg\", \"title\" => \"Thanksgiving #2\"),\r\narray(\"name\" => \"banner_tulips.jpg\", \"title\" => \"Tulips\"),\r\narray(\"name\" => \"banner_vegetables.jpg\", \"title\" => \"Vegetables\"),\r\narray(\"name\" => \"banner_weights.jpg\", \"title\" => \"Weights\"),\r\narray(\"name\" => \"banner_wheat.jpg\", \"title\" => \"Wheat\"),\r\narray(\"name\" => \"banner_winter.jpg\", \"title\" => \"Winter\")\r\n);\r\n$SPADE[\'template\']->assign(\"bannerimages\", $bannerimages);\r\n{/php}\r\n<table border=\"0\">\r\n<tr>\r\n{foreach name=banners item=b from=$bannerimages}\r\n<td><input type=\"radio\" name=\"mainbannerimage\" value=\"{$b.name}\" {if $smarty.request.mainbannerimage == $b.name}checked{/if} onclick=\"setMainBannerImage(this.value);\"/> {$b.title}</td>\r\n{if $smarty.foreach.banners.iteration % 3 == 0 && !$smarty.foreach.banners.last}</tr><tr>{/if}\r\n{/foreach}\r\n</tr>\r\n</table>\r\n<br/>\r\n<table border=\"0\">\r\n<tr><td colspan=\"4\"><b>Banner Ad:</b></td></tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"bannerimage\" value=\"{$smarty.request.bannerimage|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"bannerurl\" value=\"{$smarty.request.bannerurl|stripslashes}\" /></td>\r\n</tr>\r\n<tr><td colspan=\"4\"><b>Sponsor Ads:</b></td></tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor1image\" value=\"{$smarty.request.sponsor1image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor1url\" value=\"{$smarty.request.sponsor1url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor2image\" value=\"{$smarty.request.sponsor2image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor2url\" value=\"{$smarty.request.sponsor2url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor3image\" value=\"{$smarty.request.sponsor3image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor3url\" value=\"{$smarty.request.sponsor3url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor4image\" value=\"{$smarty.request.sponsor4image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor4url\" value=\"{$smarty.request.sponsor4url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor5image\" value=\"{$smarty.request.sponsor5image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor5url\" value=\"{$smarty.request.sponsor5url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor6image\" value=\"{$smarty.request.sponsor6image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor6url\" value=\"{$smarty.request.sponsor6url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor7image\" value=\"{$smarty.request.sponsor7image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor7url\" value=\"{$smarty.request.sponsor7url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor8image\" value=\"{$smarty.request.sponsor8image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor8url\" value=\"{$smarty.request.sponsor8url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor9image\" value=\"{$smarty.request.sponsor9image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor9url\" value=\"{$smarty.request.sponsor9url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor10image\" value=\"{$smarty.request.sponsor10image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor10url\" value=\"{$smarty.request.sponsor10url|stripslashes}\" /></td>\r\n</tr>\r\n\r\n</table>\r\n<small><em>* image urls MUST be absolute (e.g. \"http://...\").</em></small><br />\r\n\r\n<br />\r\n<b>Feature Image URL:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"featureimage\" value=\"{$smarty.request.featureimage|stripslashes}\" /><br />\r\n<small><em>* image urls MUST be absolute (e.g. \"http://...\").</em></small><br />\r\n<b>Feature Title:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"featuretitle\" value=\"{$smarty.request.featuretitle|stripslashes}\" /><br />\r\n<b>Feature Content:</b><br />\r\n<textarea style=\"width:500px;height:200px;\" name=\"featurebody\">{$smarty.request.featurebody|stripslashes}</textarea><br />\r\n\r\n\r\n<br />\r\n<b>Recipe of the Week Title:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"recipetitle\" value=\"{$smarty.request.recipetitle|stripslashes}\" /><br />\r\n<b>Recipe of the Week Content:</b><br />\r\n<textarea style=\"width:500px;height:140px;\" name=\"recipebody\">{$smarty.request.recipebody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Tip of the Week:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"tipbody\">{$smarty.request.tipbody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Hero Highlight:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"herobody\">{$smarty.request.herobody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Quote:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"quotebody\">{$smarty.request.quotebody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n\r\n<div style=\"text-align:right;\">\r\n<input type=\"button\" value=\"Preview HTML\" onclick=\"previewHTML()\">\r\n<input type=\"submit\" name=\"submit_send\" onclick=\"prepareToSend();\" value=\"Send Now\" />\r\n</div>\r\n</div>\r\n\r\n</form>\r\n\r\n<script language=\"javascript\">{literal}\r\nfunction prepareToSend() {\r\n	dF = document.emailForm;\r\n	dF.pg.value = \"sendTemplatedEmail\";	\r\n	dF.target = \'_self\';\r\n\r\n}\r\nfunction previewHTML() {\r\n	dF = document.emailForm;\r\n	dF.pg.value = \"newsletterpreview\";	\r\n\r\n	webPreview = parent.window.open(\"index.php?pg=newsletterpreview\", \"webPreview\", \"fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=800,height=600,left=10,top=10\");\r\n	dF.target = \'webPreview\';\r\n	dF.submit();\r\n	webPreview.focus();\r\n}\r\n{/literal}</script>'),(4787,282,0.12,'smarty','1','Page created.',1139338456,1124,'38.118.190.94','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n\r\n<hl><b>Why Uncle Sam Won\'t Tell You What Not to Eat</b></hl>\r\n<p>By Michele Simon. Originally published in the San Francisco Chronicle, January 19, 2005</p>\r\n<p>In January, the federal government released its Dietary Guidelines for Americans 2005. Updated once every five years based on the latest science, the 70-page document purports to tell us which foods are best to eat to stay healthy.</p>\r\n<p>While touted as the strongest nutrition recommendations yet, what went unsaid speaks volumes about why Americans continue to be left in the dark when it comes to eating right. Most media reports focused on the guidelines\' emphasis on weight loss, especially the recommendation to exercise daily. But why is a document that\'s supposed to be about food talking about exercise? Yes, exercise is important to good health, but so are a number of other lifestyle factors, such as sufficient sleep and not smoking, yet those aren\'t mentioned.</p>\r\n<p>Emphasizing weight loss conveniently puts the onus for dietary change on the individual and avoids talk of reining in the food industry\'s multibillion-dollar marketing budget for unhealthy foods. \"It\'s just common sense,\" explained outgoing Health and Human Services Secretary Tommy Thompson. \"Eat less, exercise more,\" he cheerfully instructed Americans.</p>\r\n<p>Stressing weight loss also avoids the much harder job of telling Americans the truth about specifically what not to eat. The government\'s recommendations only tell part of the story; the politically expedient part.</p>\r\n<p>Under the heading of \"Food Groups to Encourage,\" are fruits, vegetables and whole grains, foods that most Americans desperately need to increase. Trouble is, many of those same Americans don\'t even know what a whole grain is or where to find one. You can\'t go to the supermarket and ask for the whole- grain aisle. (Sadly, though, you can ask for the potato-chip aisle or the cookie aisle or the soda aisle.)</p>\r\n<p>Americans have become accustomed to eating highly processed foods that come in a package -- the antithesis of whole foods that come from nature. The very definition of food has been transformed by industry, yet the dietary guidelines don\'t reflect that. If they did, it would be a major threat to a $500 billion-a-year processed foods industry whose voice is heard loud and clear in Washington.</p>\r\n<p>Responding to that threat, companies such as General Mills are already jumping on the \"healthy food\" bandwagon, announcing that their products will be reformulated to include whole grains. But \"processed whole foods\" is an oxymoron. Real whole grains come from nature, such as brown rice instead of Uncle Ben\'s white rice or plain oatmeal instead of Cheerios with added sugar and salt. Don\'t let the food industry fool you into thinking it can manufacture healthy foods. That\'s nature\'s job.</p>\r\n<p>Another processed-food secret the federal government won\'t tell you is how to avoid trans fats. In a teleconference last week, Dr. Carlos Camargo of Harvard Medical School and a member of the dietary guidelines committee said he was \"disappointed\" that the experts\' unanimous recommendation to limit trans fats to 1 percent of calories was completely omitted from the final document. Instead, we are told to simply \"limit intake\" of trans fat.</p>\r\n<p>Why the change? \"Food Politics\" author and New York University professor Marion Nestle explained in an interview with me: \"Trans fat was left vague because otherwise they would have to say where trans fats are – in processed foods.\" In wording that Nestle calls \"incomprehensible,\" the consumer-friendly guidelines brochure recommends that you \"look for foods low in saturated fats and trans fats\" -- the two most common artery-clogging fats in the supermarket.</p>\r\n<p>Why would the government tell you to \"look for\" foods that you really should avoid altogether? Because Uncle Sam cannot say: Don\'t eat too many of the major sources of saturated fats: meats, cheese, milk and eggs. Nor could they tell us to avoid the main sources of trans fats: baked goods such as chips, cakes and cookies. That would ruffle too many industry feathers. Keeping the wording as vague as possible is good for big business.</p>\r\n<p>Some nutritionists were understandably pleased with the government\'s sugar recommendation this time around. That the sugar industry has been complaining so loudly is certainly a good sign. Yet, part of the advice is simply to choose beverages with \"little added sugars\" -- still pretty fuzzy language.</p>\r\n<p>Americans need is to be told outright: Stop drinking so much Coke. People don\'t think in terms of ingredients. Most consumers don\'t even buy ingredients anymore because they don\'t cook. We think in terms of packaged-food brand names and fast-food menu items. Imagine dietary guidelines that said: Stop eating Big Macs, Doritos and Oreos. Those are recommendations most Americans could understand, but not ones we are likely to hear. Until people are told the entire truth, instead of meaningless messages such as \"eat less,\" the nation\'s health will continue to suffer.</p>\r\n'),(4836,280,0.14,'smarty','1','Page created.',1139939329,1124,'216.194.127.150','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n<hl><b> Barriers to Physical Activity</b></hl>\r\n<p><b>Environmental Barriers</b></p>\r\n<p>Social environments such as school, work, family and friends can significantly influence an individual\'s level of physical activity. However, characteristics of our communities such as the accessibility and location of parks, trails, sidewalks, and recreational centers as well as street design, density of housing, and availability of public transit may play and even greater role in promoting or discouraging an individual or family\'s level of physical activity. There are also significant environmental barriers from water and air pollution to crime and dangerous automobile traffic.</p>\r\n<p>To address this, the Centers for Disease Control and Prevention has initiated the ACES: Active Community Environments Initiative project to promote and support the awareness and development of places where people of all ages and abilities can easily enjoy walking, bicycling, and other forms of recreation. </p>\r\n<p>There are many opportunities within our environment that support physical activities from parks, trails, and sidewalks to recreation and fitness centers. Even malls provide opportunities for fitness walking. Understanding environmental opportunities and barriers that we face in our pursuit for a healthy lifestyle may provide some of the knowledge necessary to promote healthy living. This information may also provide ideas for advocacy and civic participation.</p> \r\n<p>For more information on the Active Community Environments Initiative and how you can support a positive environment for physical activity in your community, please visit ACES: Active Community Environments Initiative. </p>\r\n\r\n<p><b>Personal Barriers</b></p>\r\n<p>Aside from the many technological advances and conveniences that have made our lives easier and less active, many personal variables, including physiological, behavioral, and psychological factors, may affect our plans to become more physically active. In fact, the 10 most common reasons adults cite for not adopting more physically active lifestyles are (Sallis and Hovell, 1990; Sallis et al., 1992)</p>\r\n<p> <li>Do not have enough time to exercise</li> </p>\r\n<p> <li>Find it inconvenient to exercise</li> </p>\r\n<p> <li>Lack self-motivation </li></p>\r\n<p> <li>Do not find exercise enjoyable</li> </p>\r\n<p> <li>Find exercise boring</li> </p>\r\n<p> <li>Lack confidence in their ability to be physically active (low self-efficacy) </li></p>\r\n<p> <li>Fear being injured or have been injured recently </li></p>\r\n<p> <li>Lack self-management skills, such as the ability to set personal goals, monitor progress, or reward progress toward such goals </li></p>\r\n<p> <li>Lack encouragement, support, or companionship from family and friends, and </li></p>\r\n<p> <li>Do not have parks, sidewalks, bicycle trails, or safe and pleasant walking paths convenient to their homes or offices. </li> </p>\r\n\r\n'),(4789,284,0.10,'smarty','0','Page created.',1139383217,2,'24.2.76.126',''),(4790,284,0.11,'smarty','1','Page created.',1139383256,2,'24.2.76.126','<h1>EHC WebServices Home</h1>'),(4791,285,0.10,'smarty','0','Page created.',1139383261,2,'24.2.76.126',''),(4792,285,0.11,'php','0','Page created.',1139383320,2,'24.2.76.126','<?php\r\n\r\n$SPADE[\'template\']->assign(\'pgLayout\', \'none\');\r\n\r\ndefine(\'EHC_SESSION_KEY\', \'Mr.Blodgett and Mr.Gwynn\');\r\n\r\n\r\n$fp = fopen (\'webservices.log\', \'a\');\r\nfwrite($fp, date(\'Ymd-His\') . \':::Request from:\' . $_SERVER[\'REMOTE_ADDR\'] . \':::\' . $HTTP_RAW_POST_DATA.\"\\n\");\r\nfclose($fp);\r\n\r\n\r\nfunction authenticateCompany( $username, $password, $companyId ) {\r\n	global $SPADE;\r\n\r\n	$ipAddress = $_SERVER[\'REMOTE_ADDR\'];		// This should be the IP of the connecting host\r\n\r\n	$Q = \"SELECT ci.*, c.userId, c.companyName, c.companyVanity\r\n		FROM company_integrations ci\r\n		INNER JOIN companies c ON (ci.companyId = c.id)\r\n		WHERE ci.companyId = \" . (int)$companyId . \"\r\n		AND ci.username = \'\" . $username . \"\'\r\n		AND ci.password = \'\" . md5($password) . \"\'\r\n		AND ci.ipAddress = \'\" . $ipAddress . \"\'\r\n		AND ci.isActive = \'yes\'\";\r\n\r\n	return $SPADE[\'db\']->query($Q, DB_ROW);\r\n}\r\n\r\n\r\nclass EhcIntegrationService { \r\n	//private $quotes = array(\"ibm\" => 98.42);   \r\n	\r\n	function createSession($objSession) { \r\n		global $SPADE;\r\n\r\n		$objResponse = new stdClass();\r\n\r\n		$username = $objSession->username;\r\n		$password = $objSession->password;\r\n		$companyId = $objSession->company_id;\r\n		$foreignId = $objSession->foreign_id;\r\n		$emailAddress = $objSession->email_address;  // email address of end user\r\n\r\n		$company = authenticateCompany($username, $password, $companyId);\r\n\r\n		if (!$emailAddress || !$company) {\r\n\r\n			$objResponse->user_id = \'0\';\r\n			$objResponse->session_id = \'ERROR\';\r\n			$objResponse->detail = \'Unauthorized, unregistered, bad login, or no email address specified.\';\r\n			$objResponse->company_vanity = \'unknown\';\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		$ipAddress = $objSession->ip_address;  // IP address of the end-user\r\n		$firstName = $objSession->first_name;\r\n		$lastName = $objSession->last_name;\r\n		$address = $objSession->address;\r\n		$city = $objSession->city;\r\n		$state = $objSession->state;\r\n		$phone = $objSession->phone;\r\n\r\n		/*// Optional section to delete entries that are expired\r\n		$Q = \"DELETE FROM user_sessions WHERE expirationDate < \" . time();\r\n		$SPADE[\'db\']->query($Q);\r\n		//*/\r\n\r\n		/*// Optional section to delete existing entries for this email address\r\n		$Q = \"DELETE FROM user_sessions WHERE emailAddress = \'\" . $emailAddress . \"\'\";\r\n		$SPADE[\'db\']->query($Q);\r\n		//*/\r\n\r\n		$Q = \"SELECT *\r\n			FROM _users\r\n			WHERE foreignId = \'\" . $foreignId . \"\'\";\r\n			//WHERE email = \'\" . $emailAddress . \"\'\";   // Old method\r\n\r\n		$userCheck = $SPADE[\'db\']->query($Q);\r\n\r\n		if (!is_array($userCheck)) {\r\n			$objResponse->user_id = 0;\r\n			$objResponse->detail = \'New user. Ready to be created.\';\r\n			$objResponse->company_vanity = serialize($company); //$company[\'companyVanity\'];\r\n			\r\n			$temp = array(\'email\' => $emailAddress,\r\n					\'firstName\' => $firstName,\r\n					\'lastName\' => $lastName,\r\n					\'address\' => $address,\r\n					\'city\' => $city,\r\n					\'state\' => $state,\r\n					\'phone\' => $phone\r\n				);\r\n\r\n			// serialize user details to be stored in notes for session	\r\n			$sessionNotes = serialize($temp);\r\n\r\n		} elseif ( count($userCheck) > 1) {\r\n			$objResponse->user_id = 0;\r\n			$objResponse->session_id = \'ERROR\';\r\n			$objResponse->detail = \'Duplicate e-mail address. Contact us for help.\';\r\n			$objResponse->company_vanity = \'unknown\';\r\n\r\n			return $objResponse;\r\n\r\n		} elseif ( count($userCheck) == 1) {\r\n			// good things...\r\n			$userCheck = $userCheck[0];\r\n\r\n			$objResponse->user_id = $userCheck[\'id\'];\r\n			$objResponse->detail = \'Existing user, ready to authenticate.\';\r\n			$objResponse->company_vanity = $company[\'companyVanity\'];\r\n\r\n			$sessionNotes = $objResponse->detail;\r\n			\r\n		} else {\r\n			return \'FATAL ERROR\';\r\n		}\r\n\r\n		$objResponse->session_id = ($objResponse->session_id)\r\n						? $objResponse->session_id\r\n						: md5($username . $password . $emailAddress . microtime() . EHC_SESSION_KEY);\r\n\r\n		$Q = \"INSERT INTO user_sessions (userId, companyId, foreignId, emailAddress, ipAddress, referer, sessionId, expirationDate, notes)\r\n			VALUES (\" . (int)$objResponse->user_id . \",\r\n				\" . (int)$companyId . \",\r\n				\'\" . $foreignId . \"\',\r\n				\'\" . $emailAddress . \"\',\r\n				\'\" . $ipAddress . \"\',\r\n				\'\" . $company[\'domain\'] . \"\',\r\n				\'\" . $objResponse->session_id . \"\',\r\n				\" . (time() + 3600) . \",\r\n				\'\" . $sessionNotes . \"\')\";\r\n\r\n		if (!$SPADE[\'db\']->query($Q)) {\r\n			$objResponse->session_id = \'XXXXXX\';\r\n			$objResponse->detail = \'Unable to create session.\';\r\n		}\r\n\r\n		return $objResponse; \r\n	}\r\n\r\n	function sendEstatEntries($objEstatEntries) {\r\n		global $SPADE;\r\n\r\n		$username = $objEstatEntries->username;\r\n		$password = $objEstatEntries->password;\r\n		$companyId = $objEstatEntries->company_id;\r\n\r\n		$objResponse = new stdClass();\r\n		$objResponse->estat_entry = array();\r\n\r\n		if (!is_array($objEstatEntries->estat_entry)) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'estat entry not an array.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n			\r\n		if (!count($objEstatEntries->estat_entry)) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'estat entries count failed.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		if (!($company = authenticateCompany($username, $password, $companyId))) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'unable to authenticate company.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n		\r\n		if (!is_array($objEstatEntries->estat_entry)\r\n			|| !count($objEstatEntries->estat_entry) \r\n			|| !($company = authenticateCompany($username, $password, $companyId))) {\r\n\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'Unauthorized, unregistered, bad login, or no estat entries specified.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		\r\n		$users = array();\r\n\r\n		foreach ($objEstatEntries->estat_entry as $entry) {\r\n			// get user info for this user, if we don\'t already have it loaded\r\n\r\n			if (!$users[$entry->foreign_id][\'id\']) {\r\n				//$Q = \"SELECT * FROM _users WHERE email = \'\" . $entry->email_address . \"\'\";\r\n				$Q = \"SELECT * FROM _users WHERE foreignId = \'\" . $entry->foreign_id . \"\'\";\r\n				\r\n				$users[$entry->foreign_id] = $SPADE[\'db\']->query($Q, DB_ROW);\r\n\r\n				if (!$users[$entry->foreign_id]) {\r\n					// couldn\'t find user by foreign ID\r\n					$objResponse->estat_entry[] = array(\r\n						\'id\' => 0,\r\n						\'confirmation\' => \'Could not find user with foreign ID \"\' . $entry->foreign_id . \'\".\'\r\n					);\r\n\r\n					continue;\r\n				}\r\n			}\r\n\r\n			/*//\r\n			$objResponse = new stdClass();\r\n			$objResponse->estat_entry[] = array(\'id\' => 0,\'confirmation\' => \'Query:\' . $Q);\r\n			return $objResponse;\r\n			//*/\r\n\r\n			$Q = \"REPLACE INTO estat_entries (userId, estatId, value, dateOfEntry, createdByUserId, dateCreated)\r\n				VALUES (\r\n					\" . (int)$users[$entry->foreign_id][\'id\'] . \",	\r\n					\" . (int)$entry->estat_id . \",\r\n					\'\" . $entry->value . \"\',\r\n					\'\" . strtotime($entry->date_of_entry) . \"\',\r\n					\" . (int)$company[\'userId\'] . \",\r\n					\" . time() . \"\r\n				)\";\r\n\r\n			if ($newId = $SPADE[\'db\']->query($Q)) {\r\n				$objResponse->estat_entry[] = array(\r\n					\'id\' => $newId,\r\n					\'confirmation\' => \'eStat entry recorded successfully.\'\r\n				);\r\n			} else {\r\n				$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'An error occurred while attempting to record this estat entry.\'\r\n				);\r\n			}\r\n		}\r\n\r\n		return $objResponse;\r\n	}\r\n}\r\n\r\nclass EhcIntegrationServiceRpcEnc extends EhcIntegrationService {\r\n	function createSession($username, $password, $company_id, $foreign_id, $email_address, $ip_address, $first_name, $last_name, $address, $city, $state, $phone) {\r\n		$objSession = new stdClass();\r\n\r\n		$objSession->username = $username;\r\n		$objSession->password = $password;\r\n		$objSession->company_id = $company_id;\r\n		$objSession->foreign_id = $foreign_id;\r\n		$objSession->email_address = $email_address;\r\n		$objSession->ip_address = $ip_address;\r\n		$objSession->first_name = $first_name;\r\n		$objSession->last_name = $last_name;\r\n		$objSession->address = $address;\r\n		$objSession->city = $city;\r\n		$objSession->state = $state;\r\n		$objSession->phone = $phone;\r\n\r\n		$objResponse = parent::createSession($objSession);\r\n		$strResponse = $objResponse->user_id . \'::\' . $objResponse->session_id . \'::\' . $objResponse->detail . \'::\' . $objResponse->company_vanity;\r\n\r\n		return $strResponse;\r\n	}\r\n\r\n	function sendEstatEntries($username, $password, $company_id, $estat_entries) {\r\n		$objEstatEntries = new stdClass();\r\n\r\n		$objEstatEntries->username = $username;\r\n		$objEstatEntries->password = $password;\r\n		$objEstatEntries->company_id = $company_id;\r\n\r\n		$arrRawEntries = split(\'%%\', $estat_entries);\r\n\r\n		foreach ($arrRawEntries as $strRawEntry) {\r\n			$arrEntryElements = split(\'::\', $strRawEntry);\r\n\r\n			$objEntry = new stdClass();\r\n			$objEntry->foreign_id = $arrEntryElements[0];\r\n			$objEntry->estat_id = $arrEntryElements[1];\r\n			$objEntry->date_of_entry = $arrEntryElements[2];\r\n			$objEntry->value = $arrEntryElements[3];\r\n\r\n			$objEstatEntries->estat_entry[] = $objEntry; \r\n		}\r\n\r\n		$objResponse = parent::sendEstatEntries($objEstatEntries);\r\n\r\n		$strResponse = \'\';\r\n\r\n		foreach ($objResponse->estat_entry as $arrEstatEntry) {\r\n			$strResponse .= $arrEstatEntry[\'id\'] . \'::\' . $arrEstatEntry[\'confirmation\'] . \'%%\';\r\n		}\r\n\r\n		$strResponse = substr($strResponse, 0, -2);\r\n\r\n		return $strResponse;\r\n	}\r\n}\r\n\r\nif ($_REQUEST[\'style\'] == \'rpcenc\') {\r\n	$server = new SoapServer(\"webservices/eis-rpcenc.wsdl\"); \r\n	$server->setClass(\"EhcIntegrationServiceRpcEnc\");\r\n	$server->handle(); \r\n} else {\r\n	$server = new SoapServer(\"webservices/eis-doclit.wsdl\"); \r\n	$server->setClass(\"EhcIntegrationService\");\r\n	$server->handle(); \r\n}\r\n\r\n?>'),(4793,285,0.12,'php','0','Copied the page over from dev site... now testing.',1139383446,2,'24.2.76.126','<?php\r\n\r\n$SPADE[\'template\']->assign(\'pgLayout\', \'none\');\r\n\r\ndefine(\'EHC_SESSION_KEY\', \'Mr.Blodgett and Mr.Gwynn\');\r\n\r\n\r\n$fp = fopen (\'webservices.log\', \'a\');\r\nfwrite($fp, date(\'Ymd-His\') . \':::Request from:\' . $_SERVER[\'REMOTE_ADDR\'] . \':::\' . $HTTP_RAW_POST_DATA.\"\\n\");\r\nfclose($fp);\r\n\r\n\r\nfunction authenticateCompany( $username, $password, $companyId ) {\r\n	global $SPADE;\r\n\r\n	$ipAddress = $_SERVER[\'REMOTE_ADDR\'];		// This should be the IP of the connecting host\r\n\r\n	$Q = \"SELECT ci.*, c.userId, c.companyName, c.companyVanity\r\n		FROM company_integrations ci\r\n		INNER JOIN companies c ON (ci.companyId = c.id)\r\n		WHERE ci.companyId = \" . (int)$companyId . \"\r\n		AND ci.username = \'\" . $username . \"\'\r\n		AND ci.password = \'\" . md5($password) . \"\'\r\n		AND ci.ipAddress = \'\" . $ipAddress . \"\'\r\n		AND ci.isActive = \'yes\'\";\r\n\r\n	return $SPADE[\'db\']->query($Q, DB_ROW);\r\n}\r\n\r\n\r\nclass EhcIntegrationService { \r\n	//private $quotes = array(\"ibm\" => 98.42);   \r\n	\r\n	function createSession($objSession) { \r\n		global $SPADE;\r\n\r\n		$objResponse = new stdClass();\r\n\r\n		$username = $objSession->username;\r\n		$password = $objSession->password;\r\n		$companyId = $objSession->company_id;\r\n		$foreignId = $objSession->foreign_id;\r\n		$emailAddress = $objSession->email_address;  // email address of end user\r\n\r\n		$company = authenticateCompany($username, $password, $companyId);\r\n\r\n		if (TRUE || !$emailAddress || !$company) {\r\n\r\n			$objResponse->user_id = \'0\';\r\n			$objResponse->session_id = \'ERROR\';\r\n			//$objResponse->detail = \'Unauthorized, unregistered, bad login, or no email address specified.\';\r\n			$objResponse->detail = \'Testing. Notice sent from new site.\';\r\n			$objResponse->company_vanity = \'unknown\';\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		$ipAddress = $objSession->ip_address;  // IP address of the end-user\r\n		$firstName = $objSession->first_name;\r\n		$lastName = $objSession->last_name;\r\n		$address = $objSession->address;\r\n		$city = $objSession->city;\r\n		$state = $objSession->state;\r\n		$phone = $objSession->phone;\r\n\r\n		/*// Optional section to delete entries that are expired\r\n		$Q = \"DELETE FROM user_sessions WHERE expirationDate < \" . time();\r\n		$SPADE[\'db\']->query($Q);\r\n		//*/\r\n\r\n		/*// Optional section to delete existing entries for this email address\r\n		$Q = \"DELETE FROM user_sessions WHERE emailAddress = \'\" . $emailAddress . \"\'\";\r\n		$SPADE[\'db\']->query($Q);\r\n		//*/\r\n\r\n		$Q = \"SELECT *\r\n			FROM _users\r\n			WHERE foreignId = \'\" . $foreignId . \"\'\";\r\n			//WHERE email = \'\" . $emailAddress . \"\'\";   // Old method\r\n\r\n		$userCheck = $SPADE[\'db\']->query($Q);\r\n\r\n		if (!is_array($userCheck)) {\r\n			$objResponse->user_id = 0;\r\n			$objResponse->detail = \'New user. Ready to be created.\';\r\n			$objResponse->company_vanity = serialize($company); //$company[\'companyVanity\'];\r\n			\r\n			$temp = array(\'email\' => $emailAddress,\r\n					\'firstName\' => $firstName,\r\n					\'lastName\' => $lastName,\r\n					\'address\' => $address,\r\n					\'city\' => $city,\r\n					\'state\' => $state,\r\n					\'phone\' => $phone\r\n				);\r\n\r\n			// serialize user details to be stored in notes for session	\r\n			$sessionNotes = serialize($temp);\r\n\r\n		} elseif ( count($userCheck) > 1) {\r\n			$objResponse->user_id = 0;\r\n			$objResponse->session_id = \'ERROR\';\r\n			$objResponse->detail = \'Duplicate e-mail address. Contact us for help.\';\r\n			$objResponse->company_vanity = \'unknown\';\r\n\r\n			return $objResponse;\r\n\r\n		} elseif ( count($userCheck) == 1) {\r\n			// good things...\r\n			$userCheck = $userCheck[0];\r\n\r\n			$objResponse->user_id = $userCheck[\'id\'];\r\n			$objResponse->detail = \'Existing user, ready to authenticate.\';\r\n			$objResponse->company_vanity = $company[\'companyVanity\'];\r\n\r\n			$sessionNotes = $objResponse->detail;\r\n			\r\n		} else {\r\n			return \'FATAL ERROR\';\r\n		}\r\n\r\n		$objResponse->session_id = ($objResponse->session_id)\r\n						? $objResponse->session_id\r\n						: md5($username . $password . $emailAddress . microtime() . EHC_SESSION_KEY);\r\n\r\n		$Q = \"INSERT INTO user_sessions (userId, companyId, foreignId, emailAddress, ipAddress, referer, sessionId, expirationDate, notes)\r\n			VALUES (\" . (int)$objResponse->user_id . \",\r\n				\" . (int)$companyId . \",\r\n				\'\" . $foreignId . \"\',\r\n				\'\" . $emailAddress . \"\',\r\n				\'\" . $ipAddress . \"\',\r\n				\'\" . $company[\'domain\'] . \"\',\r\n				\'\" . $objResponse->session_id . \"\',\r\n				\" . (time() + 3600) . \",\r\n				\'\" . $sessionNotes . \"\')\";\r\n\r\n		if (!$SPADE[\'db\']->query($Q)) {\r\n			$objResponse->session_id = \'XXXXXX\';\r\n			$objResponse->detail = \'Unable to create session.\';\r\n		}\r\n\r\n		return $objResponse; \r\n	}\r\n\r\n	function sendEstatEntries($objEstatEntries) {\r\n		global $SPADE;\r\n\r\n		$username = $objEstatEntries->username;\r\n		$password = $objEstatEntries->password;\r\n		$companyId = $objEstatEntries->company_id;\r\n\r\n		$objResponse = new stdClass();\r\n		$objResponse->estat_entry = array();\r\n\r\n		if (!is_array($objEstatEntries->estat_entry)) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'estat entry not an array.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n			\r\n		if (!count($objEstatEntries->estat_entry)) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'estat entries count failed.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		if (!($company = authenticateCompany($username, $password, $companyId))) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'unable to authenticate company.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n		\r\n		if (!is_array($objEstatEntries->estat_entry)\r\n			|| !count($objEstatEntries->estat_entry) \r\n			|| !($company = authenticateCompany($username, $password, $companyId))) {\r\n\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'Unauthorized, unregistered, bad login, or no estat entries specified.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		\r\n		$users = array();\r\n\r\n		foreach ($objEstatEntries->estat_entry as $entry) {\r\n			// get user info for this user, if we don\'t already have it loaded\r\n\r\n			if (!$users[$entry->foreign_id][\'id\']) {\r\n				//$Q = \"SELECT * FROM _users WHERE email = \'\" . $entry->email_address . \"\'\";\r\n				$Q = \"SELECT * FROM _users WHERE foreignId = \'\" . $entry->foreign_id . \"\'\";\r\n				\r\n				$users[$entry->foreign_id] = $SPADE[\'db\']->query($Q, DB_ROW);\r\n\r\n				if (!$users[$entry->foreign_id]) {\r\n					// couldn\'t find user by foreign ID\r\n					$objResponse->estat_entry[] = array(\r\n						\'id\' => 0,\r\n						\'confirmation\' => \'Could not find user with foreign ID \"\' . $entry->foreign_id . \'\".\'\r\n					);\r\n\r\n					continue;\r\n				}\r\n			}\r\n\r\n			/*//\r\n			$objResponse = new stdClass();\r\n			$objResponse->estat_entry[] = array(\'id\' => 0,\'confirmation\' => \'Query:\' . $Q);\r\n			return $objResponse;\r\n			//*/\r\n\r\n			$Q = \"REPLACE INTO estat_entries (userId, estatId, value, dateOfEntry, createdByUserId, dateCreated)\r\n				VALUES (\r\n					\" . (int)$users[$entry->foreign_id][\'id\'] . \",	\r\n					\" . (int)$entry->estat_id . \",\r\n					\'\" . $entry->value . \"\',\r\n					\'\" . strtotime($entry->date_of_entry) . \"\',\r\n					\" . (int)$company[\'userId\'] . \",\r\n					\" . time() . \"\r\n				)\";\r\n\r\n			if ($newId = $SPADE[\'db\']->query($Q)) {\r\n				$objResponse->estat_entry[] = array(\r\n					\'id\' => $newId,\r\n					\'confirmation\' => \'eStat entry recorded successfully.\'\r\n				);\r\n			} else {\r\n				$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'An error occurred while attempting to record this estat entry.\'\r\n				);\r\n			}\r\n		}\r\n\r\n		return $objResponse;\r\n	}\r\n}\r\n\r\nclass EhcIntegrationServiceRpcEnc extends EhcIntegrationService {\r\n	function createSession($username, $password, $company_id, $foreign_id, $email_address, $ip_address, $first_name, $last_name, $address, $city, $state, $phone) {\r\n		$objSession = new stdClass();\r\n\r\n		$objSession->username = $username;\r\n		$objSession->password = $password;\r\n		$objSession->company_id = $company_id;\r\n		$objSession->foreign_id = $foreign_id;\r\n		$objSession->email_address = $email_address;\r\n		$objSession->ip_address = $ip_address;\r\n		$objSession->first_name = $first_name;\r\n		$objSession->last_name = $last_name;\r\n		$objSession->address = $address;\r\n		$objSession->city = $city;\r\n		$objSession->state = $state;\r\n		$objSession->phone = $phone;\r\n\r\n		$objResponse = parent::createSession($objSession);\r\n		$strResponse = $objResponse->user_id . \'::\' . $objResponse->session_id . \'::\' . $objResponse->detail . \'::\' . $objResponse->company_vanity;\r\n\r\n		return $strResponse;\r\n	}\r\n\r\n	function sendEstatEntries($username, $password, $company_id, $estat_entries) {\r\n		$objEstatEntries = new stdClass();\r\n\r\n		$objEstatEntries->username = $username;\r\n		$objEstatEntries->password = $password;\r\n		$objEstatEntries->company_id = $company_id;\r\n\r\n		$arrRawEntries = split(\'%%\', $estat_entries);\r\n\r\n		foreach ($arrRawEntries as $strRawEntry) {\r\n			$arrEntryElements = split(\'::\', $strRawEntry);\r\n\r\n			$objEntry = new stdClass();\r\n			$objEntry->foreign_id = $arrEntryElements[0];\r\n			$objEntry->estat_id = $arrEntryElements[1];\r\n			$objEntry->date_of_entry = $arrEntryElements[2];\r\n			$objEntry->value = $arrEntryElements[3];\r\n\r\n			$objEstatEntries->estat_entry[] = $objEntry; \r\n		}\r\n\r\n		$objResponse = parent::sendEstatEntries($objEstatEntries);\r\n\r\n		$strResponse = \'\';\r\n\r\n		foreach ($objResponse->estat_entry as $arrEstatEntry) {\r\n			$strResponse .= $arrEstatEntry[\'id\'] . \'::\' . $arrEstatEntry[\'confirmation\'] . \'%%\';\r\n		}\r\n\r\n		$strResponse = substr($strResponse, 0, -2);\r\n\r\n		return $strResponse;\r\n	}\r\n}\r\n\r\nif ($_REQUEST[\'style\'] == \'rpcenc\') {\r\n	$server = new SoapServer(\"webservices/eis-rpcenc.wsdl\"); \r\n	$server->setClass(\"EhcIntegrationServiceRpcEnc\");\r\n	$server->handle(); \r\n} else {\r\n	$server = new SoapServer(\"webservices/eis-doclit.wsdl\"); \r\n	$server->setClass(\"EhcIntegrationService\");\r\n	$server->handle(); \r\n}\r\n\r\n?>'),(4794,251,0.46,'smarty','0','',1139523146,16,'216.194.127.150','{if $smarty.request.submit_send neq \"\" && $smarty.request.fromEmail neq \"\"}{include_php file=\"shared_handle:adminMultiMailTemplate\"}{/if}\r\n{assign var=\"hideWidgets\" value=\"true\"}\r\n{assign var=\"wideFormat\" value=\"true\"}\r\n\r\n{select_query assign=\"aGroups\" return=\"array\"}\r\n	name, description from _groups\r\n{/select_query}\r\n\r\n{select_query assign=\"aCompanies\" return=\"array\"}\r\n	id, companyName AS name FROM companies\r\n{/select_query}\r\n \r\n<h1 class=\"underline\">Broadcast an Email</h1>\r\n<br />\r\n\r\n<form name=\"emailForm\" method=\"post\" action=\"index.php\">\r\n<input type=\"hidden\" name=\"pg\" value=\"sendTemplatedEmail\"> \r\n<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n\r\n<div>{assign var=\"userName\" value=\"`$user->firstName` `$user->lastName`\"}\r\n<b>From Name:&nbsp;</b><input type=\"text\" name=\"fromName\" value=\"{$smarty.request.fromName|stripslashes|default:$userName}\" /> &nbsp; \r\n<b>From Email:&nbsp;</b><input type=\"text\" name=\"fromEmail\" value=\"{$smarty.request.fromEmail|default:$user->email}\" /><br />\r\n<b>Subject Line:&nbsp;</b><input type=\"text\" name=\"mailSubject\" value=\"{$smarty.request.mailSubject|stripslashes}\" style=\"width:380px;\" /><br /><br />\r\n\r\n<b><input type=\"checkbox\" name=\"toNewsletterSubscribers\" value=\"1\" /> Send to All Newsletter Subscribers?</b>\r\n<br/><br />\r\n\r\n<b>Select each Company:</b> <small>(hold <b>CTRL</b> key)</small><br />\r\n<select name=\"toCompanies[]\" multiple>{foreach from=$aCompanies item=\"row\"}\r\n	<option value=\"{$row.id}\">{$row.name} - {$row.description}</option>{/foreach}\r\n</select><br />\r\n<small><em>* Will not send message to addresses in the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Select the Email Groups:</b> <small>(hold <b>CTRL</b> key)</small><br />\r\n<select name=\"toGroups[]\" multiple>{foreach from=$aGroups item=\"row\"}\r\n	<option value=\"{$row.name}\">{$row.name} - {$row.description}</option>{/foreach}\r\n</select><br />\r\n<small><em>* Will not send message to addresses in the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Enter Additional Email Addresses: <small>(comma delimited)</small></b>\r\n<textarea style=\"width:500px;display:block;\" name=\"toAddresses\"></textarea>\r\n<small><em>* These addresses are not checked against the OPT-OUT database table.</em></small><br /><br />\r\n\r\n<b>Title:</b> <small>(to be shown in offline email clients)</small><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"offlinetitle\" value=\"{$smarty.request.offlinetitle|stripslashes|default:\'eHealthComplete Newsletter\'}\" /><br />\r\n\r\n<br />\r\n<input type=\"checkbox\" name=\"hidestorelink\" /> <b>Hide Store Link?</b><br />\r\n<input type=\"checkbox\" name=\"hidebannerad\" /> <b>Hide Banner Ad?</b> <small>(not necessary if no ad image is entered)</small><br />\r\n<input type=\"checkbox\" name=\"hidesponsorads\" /> <b>Hide Sponsor Images</b> <small>(not necessary if no sponsor images are entered)</small><br />\r\n<br />\r\n<b>Main Banner Image:</b><br/>\r\n* Note: this will not change the image until a caching error is resolved.<br/>\r\n<script>{literal}\r\nfunction setMainBannerImage(str) {\r\ndocument.getElementById(\'mainbannerimage\').src=\"/systems/wlw/layouts/newsletter/\" + str;\r\n}\r\n{/literal}</script>\r\n<img id=\"mainbannerimage\" src=\"/systems/wlw/layouts/newsletter/{$smarty.request.mainbannerimage|stripslashes|default:\"banner_shoes.jpg\"}\" style=\"border:2px solid #000000; margin:5px 0px;\"><br/>\r\n{php}\r\nglobal $SPADE;\r\n$bannerimages = array(\r\narray(\"name\" => \"banner_apples.jpg\", \"title\" => \"Apples\"),\r\narray(\"name\" => \"banner_autumn.jpg\", \"title\" => \"Autumn Trees\"),\r\narray(\"name\" => \"banner_basketball.jpg\", \"title\" => \"Basketball\"),\r\narray(\"name\" => \"banner_beach.jpg\", \"title\" => \"Beach\"),\r\narray(\"name\" => \"banner_fruit.jpg\", \"title\" => \"Fruit Splashing\"),\r\narray(\"name\" => \"banner_grass.jpg\", \"title\" => \"Grass & Sky\"),\r\narray(\"name\" => \"banner_jogging.jpg\", \"title\" => \"Jogging People\"),\r\narray(\"name\" => \"banner_jumping.jpg\", \"title\" => \"Jumping Girl\"),\r\narray(\"name\" => \"banner_kiwi.jpg\", \"title\" => \"Kiwis\"),\r\narray(\"name\" => \"banner_palmtrees.jpg\", \"title\" => \"Palm Trees & Ocean\"),\r\narray(\"name\" => \"banner_pond.jpg\", \"title\" => \"Pond\"),\r\narray(\"name\" => \"banner_pumpkins1.jpg\", \"title\" => \"Pumpkins #1\"),\r\narray(\"name\" => \"banner_pumpkins2.jpg\", \"title\" => \"Pumpkins #2\"),\r\narray(\"name\" => \"banner_rose.jpg\", \"title\" => \"Rose\"),\r\narray(\"name\" => \"banner_runner.jpg\", \"title\" => \"Runner\"),\r\narray(\"name\" => \"banner_scale.jpg\", \"title\" => \"Weight Scale\"),\r\narray(\"name\" => \"banner_shoes.jpg\", \"title\" => \"Running Shoes\"),\r\narray(\"name\" => \"banner_snowman.jpg\", \"title\" => \"Snowman\"),\r\narray(\"name\" => \"banner_springtime.jpg\", \"title\" => \"Girl Smiling\"),\r\narray(\"name\" => \"banner_thanksgiving1.jpg\", \"title\" => \"Thanksgiving #1\"),\r\narray(\"name\" => \"banner_thanksgiving2.jpg\", \"title\" => \"Thanksgiving #2\"),\r\narray(\"name\" => \"banner_tulips.jpg\", \"title\" => \"Tulips\"),\r\narray(\"name\" => \"banner_vegetables.jpg\", \"title\" => \"Vegetables\"),\r\narray(\"name\" => \"banner_weights.jpg\", \"title\" => \"Weights\"),\r\narray(\"name\" => \"banner_wheat.jpg\", \"title\" => \"Wheat\"),\r\narray(\"name\" => \"banner_winter.jpg\", \"title\" => \"Winter\")\r\n);\r\n$SPADE[\'template\']->assign(\"bannerimages\", $bannerimages);\r\n{/php}\r\n<table border=\"0\">\r\n<tr>\r\n{foreach name=banners item=b from=$bannerimages}\r\n<td><input type=\"radio\" name=\"mainbannerimage\" value=\"{$b.name}\" {if $smarty.request.mainbannerimage == $b.name}checked{/if} onclick=\"setMainBannerImage(this.value);\"/> {$b.title}</td>\r\n{if $smarty.foreach.banners.iteration % 3 == 0 && !$smarty.foreach.banners.last}</tr><tr>{/if}\r\n{/foreach}\r\n</tr>\r\n</table>\r\n<br/>\r\n<table border=\"0\">\r\n<tr><td colspan=\"4\"><b>Banner Ad:</b></td></tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"bannerimage\" value=\"{$smarty.request.bannerimage|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"bannerurl\" value=\"{$smarty.request.bannerurl|stripslashes}\" /></td>\r\n</tr>\r\n<tr><td colspan=\"4\"><b>Sponsor Ads:</b></td></tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor1image\" value=\"{$smarty.request.sponsor1image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor1url\" value=\"{$smarty.request.sponsor1url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor2image\" value=\"{$smarty.request.sponsor2image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor2url\" value=\"{$smarty.request.sponsor2url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor3image\" value=\"{$smarty.request.sponsor3image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor3url\" value=\"{$smarty.request.sponsor3url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor4image\" value=\"{$smarty.request.sponsor4image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor4url\" value=\"{$smarty.request.sponsor4url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor5image\" value=\"{$smarty.request.sponsor5image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor5url\" value=\"{$smarty.request.sponsor5url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor6image\" value=\"{$smarty.request.sponsor6image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor6url\" value=\"{$smarty.request.sponsor6url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor7image\" value=\"{$smarty.request.sponsor7image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor7url\" value=\"{$smarty.request.sponsor7url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor8image\" value=\"{$smarty.request.sponsor8image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor8url\" value=\"{$smarty.request.sponsor8url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor9image\" value=\"{$smarty.request.sponsor9image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor9url\" value=\"{$smarty.request.sponsor9url|stripslashes}\" /></td>\r\n</tr>\r\n<tr>\r\n<td><small>Image URL:</small></td><td><input type=\"text\" name=\"sponsor10image\" value=\"{$smarty.request.sponsor10image|stripslashes}\" /></td>\r\n<td><small>Link URL:</small></td><td><input type=\"text\" name=\"sponsor10url\" value=\"{$smarty.request.sponsor10url|stripslashes}\" /></td>\r\n</tr>\r\n\r\n</table>\r\n<small><em>* image urls MUST be absolute (e.g. \"http://...\").</em></small><br />\r\n\r\n<br />\r\n<b>Custom Logo URL:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"logo\" value=\"{$smarty.request.logo|stripslashes}\" /><br />\r\n<small><em>* image urls MUST be absolute (e.g. \"http://...\"). Default is eHealthCompete logo.</em></small><br />\r\n<small>**The Apple Programs URL is http://www.ehealthcompete.com/systems/v2_ehc/images/ehc/logos/appleprogram_logo.jpg</small><br />\r\n<br/>\r\n<b>Feature Image URL:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"featureimage\" value=\"{$smarty.request.featureimage|stripslashes}\" /><br />\r\n<small><em>* image urls MUST be absolute (e.g. \"http://...\").</em></small><br />\r\n<b>Feature Title:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"featuretitle\" value=\"{$smarty.request.featuretitle|stripslashes}\" /><br />\r\n<b>Feature Content:</b><br />\r\n<textarea style=\"width:500px;height:200px;\" name=\"featurebody\">{$smarty.request.featurebody|stripslashes}</textarea><br />\r\n\r\n\r\n<br />\r\n<b>Recipe of the Week Title:</b><br />\r\n<input style=\"width:300px;\" type=\"text\" name=\"recipetitle\" value=\"{$smarty.request.recipetitle|stripslashes}\" /><br />\r\n<b>Recipe of the Week Content:</b><br />\r\n<textarea style=\"width:500px;height:140px;\" name=\"recipebody\">{$smarty.request.recipebody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Tip of the Week:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"tipbody\">{$smarty.request.tipbody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Hero Highlight:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"herobody\">{$smarty.request.herobody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n<b>Quote:</b><br />\r\n<textarea style=\"width:500px;height:100px;\" name=\"quotebody\">{$smarty.request.quotebody|stripslashes}</textarea><br />\r\n\r\n<br />\r\n\r\n<div style=\"text-align:right;\">\r\n<input type=\"button\" value=\"Preview HTML\" onclick=\"previewHTML()\">\r\n<input type=\"submit\" name=\"submit_send\" onclick=\"prepareToSend();\" value=\"Send Now\" />\r\n</div>\r\n</div>\r\n\r\n</form>\r\n\r\n<script language=\"javascript\">{literal}\r\nfunction prepareToSend() {\r\n	dF = document.emailForm;\r\n	dF.pg.value = \"sendTemplatedEmail\";	\r\n	dF.target = \'_self\';\r\n\r\n}\r\nfunction previewHTML() {\r\n	dF = document.emailForm;\r\n	dF.pg.value = \"newsletterpreview\";	\r\n\r\n	webPreview = parent.window.open(\"index.php?pg=newsletterpreview\", \"webPreview\", \"fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=800,height=600,left=10,top=10\");\r\n	dF.target = \'webPreview\';\r\n	dF.submit();\r\n	webPreview.focus();\r\n}\r\n{/literal}</script>'),(4797,285,0.15,'php','0','Copied the page over from dev site... now testing.',1139551214,2,'24.2.76.126','<?php\r\n\r\n// USE THE PRODUCTION SYSTEM NOW!\r\n\r\n\r\n$SPADE[\'template\']->assign(\'pgLayout\', \'none\');\r\n\r\ndefine(\'EHC_SESSION_KEY\', \'Mr.Blodgett and Mr.Gwynn\');\r\n\r\n\r\n$fp = fopen (\'webservices.log\', \'a\');\r\nfwrite($fp, date(\'Ymd-His\') . \':::Request from:\' . $_SERVER[\'REMOTE_ADDR\'] . \':::\' . $HTTP_RAW_POST_DATA.\"\\n\");\r\nfclose($fp);\r\n\r\necho \"Allo allo\";\r\nexit();\r\n\r\nfunction authenticateCompany( $username, $password, $companyId ) {\r\n	global $SPADE;\r\n\r\n	$ipAddress = $_SERVER[\'REMOTE_ADDR\'];		// This should be the IP of the connecting host\r\n\r\n	$Q = \"SELECT ci.*, c.userId, c.companyName, c.companyVanity\r\n		FROM company_integrations ci\r\n		INNER JOIN companies c ON (ci.companyId = c.id)\r\n		WHERE ci.companyId = \" . (int)$companyId . \"\r\n		AND ci.username = \'\" . $username . \"\'\r\n		AND ci.password = \'\" . md5($password) . \"\'\r\n		AND ci.ipAddress = \'\" . $ipAddress . \"\'\r\n		AND ci.isActive = \'yes\'\";\r\n\r\n	return $SPADE[\'db\']->query($Q, DB_ROW);\r\n}\r\n\r\n\r\nclass EhcIntegrationService { \r\n	//private $quotes = array(\"ibm\" => 98.42);   \r\n	\r\n	function createSession($objSession) { \r\n		global $SPADE;\r\n\r\n		$objResponse = new stdClass();\r\n\r\n		$username = $objSession->username;\r\n		$password = $objSession->password;\r\n		$companyId = $objSession->company_id;\r\n		$foreignId = $objSession->foreign_id;\r\n		$emailAddress = $objSession->email_address;  // email address of end user\r\n\r\n		$company = authenticateCompany($username, $password, $companyId);\r\n\r\n		if (TRUE || !$emailAddress || !$company) {\r\n\r\n			$objResponse->user_id = \'0\';\r\n			$objResponse->session_id = \'ERROR\';\r\n			//$objResponse->detail = \'Unauthorized, unregistered, bad login, or no email address specified.\';\r\n			$objResponse->detail = \'This response came from the NEW server. Please clear WSDL cache.\';\r\n			$objResponse->company_vanity = \'unknown\';\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		$ipAddress = $objSession->ip_address;  // IP address of the end-user\r\n		$firstName = $objSession->first_name;\r\n		$lastName = $objSession->last_name;\r\n		$address = $objSession->address;\r\n		$city = $objSession->city;\r\n		$state = $objSession->state;\r\n		$phone = $objSession->phone;\r\n\r\n		/*// Optional section to delete entries that are expired\r\n		$Q = \"DELETE FROM user_sessions WHERE expirationDate < \" . time();\r\n		$SPADE[\'db\']->query($Q);\r\n		//*/\r\n\r\n		/*// Optional section to delete existing entries for this email address\r\n		$Q = \"DELETE FROM user_sessions WHERE emailAddress = \'\" . $emailAddress . \"\'\";\r\n		$SPADE[\'db\']->query($Q);\r\n		//*/\r\n\r\n		$Q = \"SELECT *\r\n			FROM _users\r\n			WHERE foreignId = \'\" . $foreignId . \"\'\";\r\n			//WHERE email = \'\" . $emailAddress . \"\'\";   // Old method\r\n\r\n		$userCheck = $SPADE[\'db\']->query($Q);\r\n\r\n		if (!is_array($userCheck)) {\r\n			$objResponse->user_id = 0;\r\n			$objResponse->detail = \'New user. Ready to be created.\';\r\n			$objResponse->company_vanity = serialize($company); //$company[\'companyVanity\'];\r\n			\r\n			$temp = array(\'email\' => $emailAddress,\r\n					\'firstName\' => $firstName,\r\n					\'lastName\' => $lastName,\r\n					\'address\' => $address,\r\n					\'city\' => $city,\r\n					\'state\' => $state,\r\n					\'phone\' => $phone\r\n				);\r\n\r\n			// serialize user details to be stored in notes for session	\r\n			$sessionNotes = serialize($temp);\r\n\r\n		} elseif ( count($userCheck) > 1) {\r\n			$objResponse->user_id = 0;\r\n			$objResponse->session_id = \'ERROR\';\r\n			$objResponse->detail = \'Duplicate e-mail address. Contact us for help.\';\r\n			$objResponse->company_vanity = \'unknown\';\r\n\r\n			return $objResponse;\r\n\r\n		} elseif ( count($userCheck) == 1) {\r\n			// good things...\r\n			$userCheck = $userCheck[0];\r\n\r\n			$objResponse->user_id = $userCheck[\'id\'];\r\n			$objResponse->detail = \'Existing user, ready to authenticate.\';\r\n			$objResponse->company_vanity = $company[\'companyVanity\'];\r\n\r\n			$sessionNotes = $objResponse->detail;\r\n			\r\n		} else {\r\n			return \'FATAL ERROR\';\r\n		}\r\n\r\n		$objResponse->session_id = ($objResponse->session_id)\r\n						? $objResponse->session_id\r\n						: md5($username . $password . $emailAddress . microtime() . EHC_SESSION_KEY);\r\n\r\n		$Q = \"INSERT INTO user_sessions (userId, companyId, foreignId, emailAddress, ipAddress, referer, sessionId, expirationDate, notes)\r\n			VALUES (\" . (int)$objResponse->user_id . \",\r\n				\" . (int)$companyId . \",\r\n				\'\" . $foreignId . \"\',\r\n				\'\" . $emailAddress . \"\',\r\n				\'\" . $ipAddress . \"\',\r\n				\'\" . $company[\'domain\'] . \"\',\r\n				\'\" . $objResponse->session_id . \"\',\r\n				\" . (time() + 3600) . \",\r\n				\'\" . $sessionNotes . \"\')\";\r\n\r\n		if (!$SPADE[\'db\']->query($Q)) {\r\n			$objResponse->session_id = \'XXXXXX\';\r\n			$objResponse->detail = \'Unable to create session.\';\r\n		}\r\n\r\n		return $objResponse; \r\n	}\r\n\r\n	function sendEstatEntries($objEstatEntries) {\r\n		global $SPADE;\r\n\r\n		$username = $objEstatEntries->username;\r\n		$password = $objEstatEntries->password;\r\n		$companyId = $objEstatEntries->company_id;\r\n\r\n		$objResponse = new stdClass();\r\n		$objResponse->estat_entry = array();\r\n\r\n		if (!is_array($objEstatEntries->estat_entry)) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'estat entry not an array.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n			\r\n		if (!count($objEstatEntries->estat_entry)) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'estat entries count failed.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		if (!($company = authenticateCompany($username, $password, $companyId))) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'unable to authenticate company.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n		\r\n		if (!is_array($objEstatEntries->estat_entry)\r\n			|| !count($objEstatEntries->estat_entry) \r\n			|| !($company = authenticateCompany($username, $password, $companyId))) {\r\n\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'Unauthorized, unregistered, bad login, or no estat entries specified.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		\r\n		$users = array();\r\n\r\n		foreach ($objEstatEntries->estat_entry as $entry) {\r\n			// get user info for this user, if we don\'t already have it loaded\r\n\r\n			if (!$users[$entry->foreign_id][\'id\']) {\r\n				//$Q = \"SELECT * FROM _users WHERE email = \'\" . $entry->email_address . \"\'\";\r\n				$Q = \"SELECT * FROM _users WHERE foreignId = \'\" . $entry->foreign_id . \"\'\";\r\n				\r\n				$users[$entry->foreign_id] = $SPADE[\'db\']->query($Q, DB_ROW);\r\n\r\n				if (!$users[$entry->foreign_id]) {\r\n					// couldn\'t find user by foreign ID\r\n					$objResponse->estat_entry[] = array(\r\n						\'id\' => 0,\r\n						\'confirmation\' => \'Could not find user with foreign ID \"\' . $entry->foreign_id . \'\".\'\r\n					);\r\n\r\n					continue;\r\n				}\r\n			}\r\n\r\n			/*//\r\n			$objResponse = new stdClass();\r\n			$objResponse->estat_entry[] = array(\'id\' => 0,\'confirmation\' => \'Query:\' . $Q);\r\n			return $objResponse;\r\n			//*/\r\n\r\n			$Q = \"REPLACE INTO estat_entries (userId, estatId, value, dateOfEntry, createdByUserId, dateCreated)\r\n				VALUES (\r\n					\" . (int)$users[$entry->foreign_id][\'id\'] . \",	\r\n					\" . (int)$entry->estat_id . \",\r\n					\'\" . $entry->value . \"\',\r\n					\'\" . strtotime($entry->date_of_entry) . \"\',\r\n					\" . (int)$company[\'userId\'] . \",\r\n					\" . time() . \"\r\n				)\";\r\n\r\n			if ($newId = $SPADE[\'db\']->query($Q)) {\r\n				$objResponse->estat_entry[] = array(\r\n					\'id\' => $newId,\r\n					\'confirmation\' => \'eStat entry recorded successfully.\'\r\n				);\r\n			} else {\r\n				$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'An error occurred while attempting to record this estat entry.\'\r\n				);\r\n			}\r\n		}\r\n\r\n		return $objResponse;\r\n	}\r\n}\r\n\r\nclass EhcIntegrationServiceRpcEnc extends EhcIntegrationService {\r\n	function createSession($username, $password, $company_id, $foreign_id, $email_address, $ip_address, $first_name, $last_name, $address, $city, $state, $phone) {\r\n		$objSession = new stdClass();\r\n\r\n		$objSession->username = $username;\r\n		$objSession->password = $password;\r\n		$objSession->company_id = $company_id;\r\n		$objSession->foreign_id = $foreign_id;\r\n		$objSession->email_address = $email_address;\r\n		$objSession->ip_address = $ip_address;\r\n		$objSession->first_name = $first_name;\r\n		$objSession->last_name = $last_name;\r\n		$objSession->address = $address;\r\n		$objSession->city = $city;\r\n		$objSession->state = $state;\r\n		$objSession->phone = $phone;\r\n\r\n		$objResponse = parent::createSession($objSession);\r\n		$strResponse = $objResponse->user_id . \'::\' . $objResponse->session_id . \'::\' . $objResponse->detail . \'::\' . $objResponse->company_vanity;\r\n\r\n		return $strResponse;\r\n	}\r\n\r\n	function sendEstatEntries($username, $password, $company_id, $estat_entries) {\r\n		$objEstatEntries = new stdClass();\r\n\r\n		$objEstatEntries->username = $username;\r\n		$objEstatEntries->password = $password;\r\n		$objEstatEntries->company_id = $company_id;\r\n\r\n		$arrRawEntries = split(\'%%\', $estat_entries);\r\n\r\n		foreach ($arrRawEntries as $strRawEntry) {\r\n			$arrEntryElements = split(\'::\', $strRawEntry);\r\n\r\n			$objEntry = new stdClass();\r\n			$objEntry->foreign_id = $arrEntryElements[0];\r\n			$objEntry->estat_id = $arrEntryElements[1];\r\n			$objEntry->date_of_entry = $arrEntryElements[2];\r\n			$objEntry->value = $arrEntryElements[3];\r\n\r\n			$objEstatEntries->estat_entry[] = $objEntry; \r\n		}\r\n\r\n		$objResponse = parent::sendEstatEntries($objEstatEntries);\r\n\r\n		$strResponse = \'\';\r\n\r\n		foreach ($objResponse->estat_entry as $arrEstatEntry) {\r\n			$strResponse .= $arrEstatEntry[\'id\'] . \'::\' . $arrEstatEntry[\'confirmation\'] . \'%%\';\r\n		}\r\n\r\n		$strResponse = substr($strResponse, 0, -2);\r\n\r\n		return $strResponse;\r\n	}\r\n}\r\n\r\nif ($_REQUEST[\'style\'] == \'rpcenc\') {\r\n	$server = new SoapServer(\"webservices/eis-rpcenc.wsdl\"); \r\n	$server->setClass(\"EhcIntegrationServiceRpcEnc\");\r\n	$server->handle(); \r\n} else {\r\n	$server = new SoapServer(\"webservices/eis-doclit.wsdl\"); \r\n	$server->setClass(\"EhcIntegrationService\");\r\n	$server->handle(); \r\n}\r\n\r\n?>'),(4798,285,0.16,'php','0','Copied the page over from dev site... now testing.',1139551476,2,'24.2.76.126','<?php\r\n\r\n// USE THE PRODUCTION SYSTEM NOW!\r\n\r\n\r\n$SPADE[\'template\']->assign(\'pgLayout\', \'none\');\r\n\r\ndefine(\'EHC_SESSION_KEY\', \'Mr.Blodgett and Mr.Gwynn\');\r\n\r\n\r\n$fp = fopen (\'webservices.log.php\', \'a\');\r\nfwrite($fp, date(\'Ymd-His\') . \':::Request from:\' . $_SERVER[\'REMOTE_ADDR\'] . \':::\' . $HTTP_RAW_POST_DATA.\"\\n\");\r\nfclose($fp);\r\n\r\necho \"Allo allo\";\r\nexit();\r\n\r\nfunction authenticateCompany( $username, $password, $companyId ) {\r\n	global $SPADE;\r\n\r\n	$ipAddress = $_SERVER[\'REMOTE_ADDR\'];		// This should be the IP of the connecting host\r\n\r\n	$Q = \"SELECT ci.*, c.userId, c.companyName, c.companyVanity\r\n		FROM company_integrations ci\r\n		INNER JOIN companies c ON (ci.companyId = c.id)\r\n		WHERE ci.companyId = \" . (int)$companyId . \"\r\n		AND ci.username = \'\" . $username . \"\'\r\n		AND ci.password = \'\" . md5($password) . \"\'\r\n		AND ci.ipAddress = \'\" . $ipAddress . \"\'\r\n		AND ci.isActive = \'yes\'\";\r\n\r\n	return $SPADE[\'db\']->query($Q, DB_ROW);\r\n}\r\n\r\n\r\nclass EhcIntegrationService { \r\n	//private $quotes = array(\"ibm\" => 98.42);   \r\n	\r\n	function createSession($objSession) { \r\n		global $SPADE;\r\n\r\n		$objResponse = new stdClass();\r\n\r\n		$username = $objSession->username;\r\n		$password = $objSession->password;\r\n		$companyId = $objSession->company_id;\r\n		$foreignId = $objSession->foreign_id;\r\n		$emailAddress = $objSession->email_address;  // email address of end user\r\n\r\n		$company = authenticateCompany($username, $password, $companyId);\r\n\r\n		if (TRUE || !$emailAddress || !$company) {\r\n\r\n			$objResponse->user_id = \'0\';\r\n			$objResponse->session_id = \'ERROR\';\r\n			//$objResponse->detail = \'Unauthorized, unregistered, bad login, or no email address specified.\';\r\n			$objResponse->detail = \'This response came from the NEW server. Please clear WSDL cache.\';\r\n			$objResponse->company_vanity = \'unknown\';\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		$ipAddress = $objSession->ip_address;  // IP address of the end-user\r\n		$firstName = $objSession->first_name;\r\n		$lastName = $objSession->last_name;\r\n		$address = $objSession->address;\r\n		$city = $objSession->city;\r\n		$state = $objSession->state;\r\n		$phone = $objSession->phone;\r\n\r\n		/*// Optional section to delete entries that are expired\r\n		$Q = \"DELETE FROM user_sessions WHERE expirationDate < \" . time();\r\n		$SPADE[\'db\']->query($Q);\r\n		//*/\r\n\r\n		/*// Optional section to delete existing entries for this email address\r\n		$Q = \"DELETE FROM user_sessions WHERE emailAddress = \'\" . $emailAddress . \"\'\";\r\n		$SPADE[\'db\']->query($Q);\r\n		//*/\r\n\r\n		$Q = \"SELECT *\r\n			FROM _users\r\n			WHERE foreignId = \'\" . $foreignId . \"\'\";\r\n			//WHERE email = \'\" . $emailAddress . \"\'\";   // Old method\r\n\r\n		$userCheck = $SPADE[\'db\']->query($Q);\r\n\r\n		if (!is_array($userCheck)) {\r\n			$objResponse->user_id = 0;\r\n			$objResponse->detail = \'New user. Ready to be created.\';\r\n			$objResponse->company_vanity = serialize($company); //$company[\'companyVanity\'];\r\n			\r\n			$temp = array(\'email\' => $emailAddress,\r\n					\'firstName\' => $firstName,\r\n					\'lastName\' => $lastName,\r\n					\'address\' => $address,\r\n					\'city\' => $city,\r\n					\'state\' => $state,\r\n					\'phone\' => $phone\r\n				);\r\n\r\n			// serialize user details to be stored in notes for session	\r\n			$sessionNotes = serialize($temp);\r\n\r\n		} elseif ( count($userCheck) > 1) {\r\n			$objResponse->user_id = 0;\r\n			$objResponse->session_id = \'ERROR\';\r\n			$objResponse->detail = \'Duplicate e-mail address. Contact us for help.\';\r\n			$objResponse->company_vanity = \'unknown\';\r\n\r\n			return $objResponse;\r\n\r\n		} elseif ( count($userCheck) == 1) {\r\n			// good things...\r\n			$userCheck = $userCheck[0];\r\n\r\n			$objResponse->user_id = $userCheck[\'id\'];\r\n			$objResponse->detail = \'Existing user, ready to authenticate.\';\r\n			$objResponse->company_vanity = $company[\'companyVanity\'];\r\n\r\n			$sessionNotes = $objResponse->detail;\r\n			\r\n		} else {\r\n			return \'FATAL ERROR\';\r\n		}\r\n\r\n		$objResponse->session_id = ($objResponse->session_id)\r\n						? $objResponse->session_id\r\n						: md5($username . $password . $emailAddress . microtime() . EHC_SESSION_KEY);\r\n\r\n		$Q = \"INSERT INTO user_sessions (userId, companyId, foreignId, emailAddress, ipAddress, referer, sessionId, expirationDate, notes)\r\n			VALUES (\" . (int)$objResponse->user_id . \",\r\n				\" . (int)$companyId . \",\r\n				\'\" . $foreignId . \"\',\r\n				\'\" . $emailAddress . \"\',\r\n				\'\" . $ipAddress . \"\',\r\n				\'\" . $company[\'domain\'] . \"\',\r\n				\'\" . $objResponse->session_id . \"\',\r\n				\" . (time() + 3600) . \",\r\n				\'\" . $sessionNotes . \"\')\";\r\n\r\n		if (!$SPADE[\'db\']->query($Q)) {\r\n			$objResponse->session_id = \'XXXXXX\';\r\n			$objResponse->detail = \'Unable to create session.\';\r\n		}\r\n\r\n		return $objResponse; \r\n	}\r\n\r\n	function sendEstatEntries($objEstatEntries) {\r\n		global $SPADE;\r\n\r\n		$username = $objEstatEntries->username;\r\n		$password = $objEstatEntries->password;\r\n		$companyId = $objEstatEntries->company_id;\r\n\r\n		$objResponse = new stdClass();\r\n		$objResponse->estat_entry = array();\r\n\r\n		if (!is_array($objEstatEntries->estat_entry)) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'estat entry not an array.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n			\r\n		if (!count($objEstatEntries->estat_entry)) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'estat entries count failed.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		if (!($company = authenticateCompany($username, $password, $companyId))) {\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'unable to authenticate company.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n		\r\n		if (!is_array($objEstatEntries->estat_entry)\r\n			|| !count($objEstatEntries->estat_entry) \r\n			|| !($company = authenticateCompany($username, $password, $companyId))) {\r\n\r\n			$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'Unauthorized, unregistered, bad login, or no estat entries specified.\'\r\n			);\r\n\r\n			return $objResponse;\r\n		}\r\n\r\n		\r\n		$users = array();\r\n\r\n		foreach ($objEstatEntries->estat_entry as $entry) {\r\n			// get user info for this user, if we don\'t already have it loaded\r\n\r\n			if (!$users[$entry->foreign_id][\'id\']) {\r\n				//$Q = \"SELECT * FROM _users WHERE email = \'\" . $entry->email_address . \"\'\";\r\n				$Q = \"SELECT * FROM _users WHERE foreignId = \'\" . $entry->foreign_id . \"\'\";\r\n				\r\n				$users[$entry->foreign_id] = $SPADE[\'db\']->query($Q, DB_ROW);\r\n\r\n				if (!$users[$entry->foreign_id]) {\r\n					// couldn\'t find user by foreign ID\r\n					$objResponse->estat_entry[] = array(\r\n						\'id\' => 0,\r\n						\'confirmation\' => \'Could not find user with foreign ID \"\' . $entry->foreign_id . \'\".\'\r\n					);\r\n\r\n					continue;\r\n				}\r\n			}\r\n\r\n			/*//\r\n			$objResponse = new stdClass();\r\n			$objResponse->estat_entry[] = array(\'id\' => 0,\'confirmation\' => \'Query:\' . $Q);\r\n			return $objResponse;\r\n			//*/\r\n\r\n			$Q = \"REPLACE INTO estat_entries (userId, estatId, value, dateOfEntry, createdByUserId, dateCreated)\r\n				VALUES (\r\n					\" . (int)$users[$entry->foreign_id][\'id\'] . \",	\r\n					\" . (int)$entry->estat_id . \",\r\n					\'\" . $entry->value . \"\',\r\n					\'\" . strtotime($entry->date_of_entry) . \"\',\r\n					\" . (int)$company[\'userId\'] . \",\r\n					\" . time() . \"\r\n				)\";\r\n\r\n			if ($newId = $SPADE[\'db\']->query($Q)) {\r\n				$objResponse->estat_entry[] = array(\r\n					\'id\' => $newId,\r\n					\'confirmation\' => \'eStat entry recorded successfully.\'\r\n				);\r\n			} else {\r\n				$objResponse->estat_entry[] = array(\r\n					\'id\' => 0,\r\n					\'confirmation\' => \'An error occurred while attempting to record this estat entry.\'\r\n				);\r\n			}\r\n		}\r\n\r\n		return $objResponse;\r\n	}\r\n}\r\n\r\nclass EhcIntegrationServiceRpcEnc extends EhcIntegrationService {\r\n	function createSession($username, $password, $company_id, $foreign_id, $email_address, $ip_address, $first_name, $last_name, $address, $city, $state, $phone) {\r\n		$objSession = new stdClass();\r\n\r\n		$objSession->username = $username;\r\n		$objSession->password = $password;\r\n		$objSession->company_id = $company_id;\r\n		$objSession->foreign_id = $foreign_id;\r\n		$objSession->email_address = $email_address;\r\n		$objSession->ip_address = $ip_address;\r\n		$objSession->first_name = $first_name;\r\n		$objSession->last_name = $last_name;\r\n		$objSession->address = $address;\r\n		$objSession->city = $city;\r\n		$objSession->state = $state;\r\n		$objSession->phone = $phone;\r\n\r\n		$objResponse = parent::createSession($objSession);\r\n		$strResponse = $objResponse->user_id . \'::\' . $objResponse->session_id . \'::\' . $objResponse->detail . \'::\' . $objResponse->company_vanity;\r\n\r\n		return $strResponse;\r\n	}\r\n\r\n	function sendEstatEntries($username, $password, $company_id, $estat_entries) {\r\n		$objEstatEntries = new stdClass();\r\n\r\n		$objEstatEntries->username = $username;\r\n		$objEstatEntries->password = $password;\r\n		$objEstatEntries->company_id = $company_id;\r\n\r\n		$arrRawEntries = split(\'%%\', $estat_entries);\r\n\r\n		foreach ($arrRawEntries as $strRawEntry) {\r\n			$arrEntryElements = split(\'::\', $strRawEntry);\r\n\r\n			$objEntry = new stdClass();\r\n			$objEntry->foreign_id = $arrEntryElements[0];\r\n			$objEntry->estat_id = $arrEntryElements[1];\r\n			$objEntry->date_of_entry = $arrEntryElements[2];\r\n			$objEntry->value = $arrEntryElements[3];\r\n\r\n			$objEstatEntries->estat_entry[] = $objEntry; \r\n		}\r\n\r\n		$objResponse = parent::sendEstatEntries($objEstatEntries);\r\n\r\n		$strResponse = \'\';\r\n\r\n		foreach ($objResponse->estat_entry as $arrEstatEntry) {\r\n			$strResponse .= $arrEstatEntry[\'id\'] . \'::\' . $arrEstatEntry[\'confirmation\'] . \'%%\';\r\n		}\r\n\r\n		$strResponse = substr($strResponse, 0, -2);\r\n\r\n		return $strResponse;\r\n	}\r\n}\r\n\r\nif ($_REQUEST[\'style\'] == \'rpcenc\') {\r\n	$server = new SoapServer(\"webservices/eis-rpcenc.wsdl\"); \r\n	$server->setClass(\"EhcIntegrationServiceRpcEnc\");\r\n	$server->handle(); \r\n} else {\r\n	$server = new SoapServer(\"webservices/eis-doclit.wsdl\"); \r\n	$server->setClass(\"EhcIntegrationService\");\r\n	$server->handle(); \r\n}\r\n\r\n?>'),