{assign var="pgLayout" value="layouts/default.tpl"}

{stored_object name=$smarty.session.session_id|truncate:10:"" type="integration/signup" from="signup" assign="signup"}
{if $signup.session_id != $smarty.session.session_id}{message type="error" value="There has been a problem loading your user data, please return to the original site and log in again. If this problem persists please contact our support department." db_log=0 is_critical=0}{store_messages}{redirect href="?pg=apple/landing"}{/if}
{if $smarty.post.signup.agree}{include_php file="handle:integration/signup.agreeAndLogIn"}{/if}

{display var=$signup}

{select_query assign="termsOfUse" return="val"}
	h.content 
FROM _toc t 
	INNER JOIN _pages p ON (t.pageId = p.id)
	INNER JOIN _page_history h ON (h.pageId = p.id)
	LEFT JOIN _users u ON (h.userId = u.id)
WHERE
	t.pageName = 'terms' AND h.isActive = '1'
ORDER BY h.version DESC
{/select_query}

{capture name="search"}{literal}/\{[^\}]*\}/{/literal}{/capture}

{$termsOfUse|regex_replace:$smarty.capture.search:""}

{toc_next assign="next"}
{toc_prev assign="prev"}
<form name="signup" method="post" action="index.php" style="margin:0px;">
<input type="hidden" name="pg" value="{$page.name}">
<input type="hidden" name="no_expire" value="true">
<input type="hidden" name="email" value="{$signup.email}">
<input type="hidden" name="signup[return]" value="{$signup.return}">

<div align="center" class="quote">
	I, {$signup.firstName} {$signup.lastName}, agree to these terms:<br />
	<em>
	<input type="radio" name="signup[agree]" value="Yes"> Yes &nbsp; <input type="radio" name="signup[agree]" value="No"> No
	</em>
</div>
<br />
<h2 class="withBG">Sign up for our Newsletter?</h2>
<p>eHealthCompete sends its users useful tips and advice from the health and wellness world, if you would like to add yourself to this group of recipients, select 'Yes' below.</p>

<div style="text-align:center;"><input type="radio" name="newsletterAction" value="add" checked="checked"> Yes <input type="radio" name="newsletterAction" value=""> No</div>

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

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

</form>