<!--{if $optiontype=='checkbox'}-->
	<script type="text/javascript">
	var max_obj = $maxchoices;
	var p = 0;
	function checkbox(obj) {
		if(obj.checked) {
			p++;
			for (var i = 0; i < poll.elements.length; i++) {
				var e = poll.elements[i];
				if(p == max_obj) {
					if(e.name.match('pollanswers') && !e.checked) {
						e.disabled = true;
					}
				}
			}
		} else {
			p--;
			for (var i = 0; i < poll.elements.length; i++) {
				var e = poll.elements[i];
				if(e.name.match('pollanswers') && e.disabled) {
					e.disabled = false;
				}
			}
		}
	}
	</script>
<!--{/if}-->

<form name="poll" method="post" action="misc.php?action=votepoll&fid=$fid&tid=$tid">
<input type="hidden" name="formhash" value="{FORMHASH}">
<div class="spaceborder" style="width: {TABLEWIDTH}">
<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
<tr><td class="header" colspan="2">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr class="smalltxt" style="color: {HEADERTEXT}"><td class="bold">{lang poll_subject}: $thread[subject]&nbsp;
<!--{if $multiple}-->{lang poll_multiple}<!--{if $maxchoices}-->: {lang poll_more_than}<!--{/if}--><!--{else}-->{lang poll_single}<!--{/if}-->
<!--{if $expiration && $expirations > $timestamp}-->{lang poll_expiration}<!--{elseif $expiration && $expirations < $timestamp}-->{lang poll_finish}<!--{/if}-->
</td><td align="right"><!--{if empty($showvoters)}--><a href="viewthread.php?tid=$tid&page=$page&sid=$sid&showvoters=yes">{lang poll_view_voters}<!--{/if}--></a>
</td></tr></table>
</td></tr>

<!--{if !empty($showvoters)}-->
	<tr>
	<td class="altbg2" colspan="2"><span class="bold">{lang poll_voters}:</span><br><br>
	<!--{if $adminid == 1}-->
		<!--{loop $options['viewvoters'] $key $voter}-->
			{lang options} <!--{eval print($key + 1)}-->:
			<!--{loop $options['viewvoters'][$key] $viewvoter}-->
				<a href="viewpro.php?username={echo rawurlencode($viewvoter)}">$viewvoter</a> &nbsp;
			<!--{/loop}-->
			<br>
		<!--{/loop}-->
	<!--{else}-->
		<!--{loop $options['voters'] $voter}-->
			<a href="viewpro.php?username={echo rawurlencode($voter)}">$voter</a> &nbsp;
		<!--{/loop}-->
	<!--{/if}-->
	<br>
<!--{/if}-->

<!--{loop $polloptions $key $option}-->
	<tr>
	<td class="altbg1" width="18%">
	<!--{if $allowvote}-->
		<input class="checkbox" type="$optiontype" name="pollanswers[]" value="$option[polloptionid]" <!--{if $optiontype=='checkbox'}-->onclick='checkbox(this)'<!--{/if}-->>
	<!--{/if}-->
	$option[polloption]</td>
	<!--{if !$visiblepoll}-->
	<td class="altbg2"><div class="percent"><div style="width: $option[width]"></div></div><div class="percenttxt">&nbsp;&nbsp;$option[votes] <u>($option[percent]%)</u></div></td>
	<!--{else}-->
	<td class="altbg2"></td>
	<!--{/if}-->
	</tr>
<!--{/loop}-->
<!--{if $visiblepoll && $allowvote}--><tr><td class="altbg1"></td><td class="altbg2">{lang poll_after_result}</td></tr><!--{/if}-->
<!--{if $allowvote}--><tr class="bottom"><td class="altbg1"></td><td class="altbg2"><input class="button" type="submit" name="pollsubmit" value="{lang submit}"></td></tr>
<!--{elseif $visiblepoll}--><tr class="bottom"><td class="altbg1"></td><td class="altbg2">{lang poll_nopermission}</td></tr><!--{/if}-->
</table></div>

<br><br></form>