{assign var="pgLayout" value="file:./layouts/lite.tpl"}
{include_php file="shared_handle:company/survey"}

{display var=$survey}

<h2 class="withBG">Take a Survey: {$survey.surveyName}</h2>
<div style="margin-left:20px;">May be taken: {$survey.frequency}</div>

<form name="surveyForm" action="index.php" method="post">
<input type="hidden" name="pg" value="{$page.name}" />
<input type="hidden" name="no_expire" value="true" />
<input type="hidden" name="id" value="{$smarty.request.id}" />

<ol id="surveyQuestionList">
	{foreach name="questions" from=$survey.questions item="question"}
	<li>{$question.question}
	<dl>
		{if $question.A !== ""}<dt><input id="q{$smarty.foreach.questions.iteration}A" type="radio" name="q[{$question.id}]" value="A" /> <a href="javascript://" onclick="document.getElementById('q{$smarty.foreach.questions.iteration}A').checked = true;">{$question.A}</a></dt>{/if}
		{if $question.B !== ""}<dt><input id="q{$smarty.foreach.questions.iteration}B" type="radio" name="q[{$question.id}]" value="B" /> <a href="javascript://" onclick="document.getElementById('q{$smarty.foreach.questions.iteration}B').checked = true;">{$question.B}</a></dt>{/if}
		{if $question.C !== ""}<dt><input id="q{$smarty.foreach.questions.iteration}C" type="radio" name="q[{$question.id}]" value="C" /> <a href="javascript://" onclick="document.getElementById('q{$smarty.foreach.questions.iteration}C').checked = true;">{$question.C}</a></dt>{/if}
		{if $question.D !== ""}<dt><input id="q{$smarty.foreach.questions.iteration}D" type="radio" name="q[{$question.id}]" value="D" /> <a href="javascript://" onclick="document.getElementById('q{$smarty.foreach.questions.iteration}D').checked = true;">{$question.D}</a></dt>{/if}
		{if $question.E !== ""}<dt><input id="q{$smarty.foreach.questions.iteration}E" type="radio" name="q[{$question.id}]" value="E" /> <a href="javascript://" onclick="document.getElementById('q{$smarty.foreach.questions.iteration}E').checked = true;">{$question.E}</a></dt>{/if}
	</dl></li>
	{/foreach}
</ol>

<div style="text-align:center;"><input type="submit" value="Submit Responses" /></div>
</form>
