{include file="$gentemplates/$header_tpl"}
{include file="$gentemplates/poll_header.tpl"}
<div class="content content_adult_2">
	<h3 class="p-b5">{$table_header}</h3>
	{if $links_top}
	<div style="display:table;width:100%;padding: 15px 0;">		
		{include file="$gentemplates/pagination_top.tpl"}
	</div>
	{/if}
	<div id="poll_polls_table">
		
		<dl style="overflow:hidden;">
			{if $par != 'category'}
			<dt class="first" style="width: 112px; text-align:{$default_left};">{$lang.poll.category}</dt>
			{/if}
			{if $par == 'category'}
				<dt class="first" style="width:400px; text-align:{$default_left};">{$lang.poll.question}</dt>
			{elseif $par == "my_polls"}
                <dt class="first" style="width: 390px; text-align:{$default_left};">{$lang.poll.question}</dt>
            {else}
				<dt class="first" style="width: 285px; text-align:{$default_left};">{$lang.poll.question}</dt>
			{/if}
			{if $par!='my_polls'}
			<dt class="first" style="width: 100px; text-align:{$default_left};">{$lang.poll.owner}</dt>
			{/if}
			<dt class="first" style="width:115px; text-align:{$default_left};">{$lang.poll.stats}</dt>
			<dt class="first" style="width:112px; text-align:{$default_left};">{$lang.poll.created}</dt>
		</dl>
		{foreach from=$polls item=item}
		<dl id="tr{$item.poll_id}" param="poll_tr" style="overflow: hidden; margin: 10px 0;">
			{if $par != 'category'}
			<dt style="width:112px; padding-{$default_left}: 5px;"><a href="{$site_root}/{$seo.poll}?sel=polls&par=category&category_id={$item.category_id}">{$item.cat_name}</a></dt>
			{/if}
			{if $par == 'category'}
				<dt style="width:400px; padding-{$default_left}: 5px;"><a href="#" onclick="answerPoll('{$item.poll_id}'); return false;">{$item.question}</a></dt>
			{elseif $par == "my_polls"}
                <dt style="width: 390px; padding-{$default_left}: 5px;"><a href="#" onclick="answerPoll('{$item.poll_id}'); return false;">{$item.question}</a></dt>
            {else}
				<dt style="width: 285px; padding-{$default_left}: 5px;"><a href="#" onclick="answerPoll('{$item.poll_id}'); return false;">{$item.question}</a></dt>
			{/if}

			{if $par!='my_polls'}
			<dt style="width: 100px; padding-{$default_left}: 5px;">
				{if 1 == $item.user_id}
				{$item.login}
				{else}
				<a href="{$item.view_link}" >{$item.login}</a>
				{/if}
			</dt>
			{/if}
			<dt class="main_header_text" style="white-space: nowrap; width: 115px; padding-{$default_left}: 5px;">
				<div class="float_left" style="width: 90px;">{$lang.poll.votes_count}: </div>{$item.votes_count}<br>
				<div class="float_left" style="width: 90px;">{$lang.poll.comments_count}: </div>{$item.comments_count}
			</dt>
			<dt style="white-space: nowrap;width: 112px; padding-{$default_left}: 5px;">{$item.active_time}</dt>
		</dl>
		{foreachelse}
		<dl>
			<dd colspan="8" align="center">{$lang.poll.no_polls}</dd>
		</dl>
		{/foreach}
	</div>
	<div>&nbsp;</div>
	{include file="$gentemplates/pagination_bottom.tpl"}
</div>
{include file="$gentemplates/$footer_tpl"}