{include file="$gentemplates/$header_tpl"}
{include file="$gentemplates/poll_header.tpl"}
{if $err}
<font class="error_msg">* {$err}</font>
<div class="sep"></div>
{/if}
{if $my_polls}
<div class="content content_adult_2">
	<h3 class="p-b5">{$lang.poll.my_polls}
		<ins onclick="javascript:location.href='{$site_root}/{$seo.poll}?sel=polls&par=my_polls';" class="view-icon sub_icon" title="{$lang.button.view}">&nbsp;</ins>
	</h3>
	<div id="poll_homepage" style="overflow:hidden;">
        <table class="poll_table">
			<tr>
				<th style="padding-{$default_left}: 5px; width: 90%;">{$lang.poll.pollname}</th>
				<th >{$lang.poll.answers}</th>
			</tr>
			{foreach from=$my_polls item=item}
			<tr>
				<td style="text-align: {$default_left}; padding-{$default_left}: 5px;">
					<a href="#" onclick="showAdvStats('{$item.poll_id}'); return false;">{$item.question}</a>
				</td>
				<td>{$item.votes_count}</td>				
			</tr>
			{/foreach}
		</table>
	</div>
</div>
<div class="sep"></div>
{/if}
{if $last_polls}
<div class="content content_adult_2">
	<h3 class="p-b5">{$lang.poll.last_polls}
		<ins onclick="javascript:location.href='{$site_root}/{$seo.poll}?sel=polls&par=last_polls';" class="view-icon sub_icon" title="{$lang.button.view}">&nbsp;</ins>
	</h3>
	<div  class="account" style="overflow:hidden;">
		{foreach from=$last_polls item=item}
		<dl>
			<dt style="width:49%" style="text-align:{$default_left}"><a href="#" onclick="answerPoll('{$item.poll_id}'); return false;">{$item.question}</a></dt>
			<dt style="width:34%">{$lang.poll.by}: 
				{if $item.user_id ne '1'}<a href="{$item.view_link}">{$item.login}</a>
				{else}
				<font class="text">{$item.login}</font>	
				{/if}
			</dt>
			<dt style="width:17%" style="white-space: nowrap">
				{$item.date_add_full}
			</dt>
		</dl>
		{/foreach}
	</div>
</div>
<div class="sep"></div>
{/if}
{if $friend_polls}
<div class="content content_adult_2">
	<h3 class="p-b5">{$lang.poll.friends_polls}
		<ins onclick="javascript:location.href='{$site_root}/{$seo.poll}?sel=polls&par=friends_polls';" class="view-icon sub_icon" title="{$lang.button.view}">&nbsp;</ins>
	</h3>
	<div style="overflow:hidden;">
		<dl>
		{foreach from=$friend_polls item=item}
			<dt style="width:47%; margin-{$default_right}:10px; margin-bottom: 10px;">
				<div style="overflow:hidden;">
						<div class="float_left" style="width:33%;">
							{if $item.user_id ne '1'}
								<a class="imgcanvas_container" href="{$item.view_link}"><img src="{$item.icon_path}" class="imgcanvas" border="0" /></a>
							{else}
								<a class="imgcanvas_container"><img src="{$item.icon_path}" class="imgcanvas" border="0" /></a>
							{/if}
						</div>
						<div valign="top" align="{$default_left}" class="float_left" style="padding-{$default_left}:5px;overflow:hidden;width:60%;">
							<div align="{$default_left}">
								<a href="#" onclick="answerPoll('{$item.poll_id}'); return false;">{$item.question}</a>
							</div>
							<div align="{$default_left}">
								<div class="view_info">{$lang.poll.category} :</div> 
                                <a href="{$site_root}/{$seo.poll}?sel=polls&par=category&category_id={$item.category_id}">{$item.cat_name}</a>
							</div>
							<div align="{$default_left}">
								{if $item.user_id ne '1'}
								<div class="view_info">{$lang.poll.author} : </div><a href="{$item.view_link}">{$item.login}</a>
								{else}
								<div class="view_info">{$lang.poll.author} : </div><font class="text">{$item.login}</font>
								{/if}
							</div>
							<div align="{$default_left}">
								<div class="view_info">{$lang.poll.answers} : </div>{$item.votes_count}
							</div>
						</div>
				</div>
			</dt>
		{/foreach}
		</dl>
	</div>
</div>
{/if}
{if $popular_polls}
<div class="content content_adult_2">
	<h3 class="p-b5">{$lang.poll.popular_polls}
		<ins onclick="javascript:location.href='{$site_root}/{$seo.poll}?sel=polls&par=popular_polls';" class="view-icon sub_icon" title="{$lang.button.view}">&nbsp;</ins>
	</h3>
	<div style="overflow:hidden;">
		<dl style="overflow:hidden; margin: 5px 0;">
		{foreach name=popular from=$popular_polls item=item}
			<dt style="width:47%; margin-{$default_right}:10px; margin-bottom: 10px;">
				<div style="overflow:hidden;">
						<div class="float_left" style="width:33%">
							{if $item.user_id ne '1'}
								<a class="imgcanvas_container" href="{$item.view_link}"><img class="imgcanvas" src="{$item.icon_path}" border="0" /></a>
							{else}
								<a class="imgcanvas_container"><img src="uploades/icons/thumb_default_icon_male.png" class="imgcanvas" border="0" /></a>
							{/if}
						</div>
						
						<div class="float_left" valign="top" align="{$default_left}" style="padding-{$default_left}: 5px;overflow:hidden;width:60%;">
							<div align="{$default_left}">
								<a href="#" onclick="answerPoll('{$item.poll_id}'); return false;">{$item.question}</a>
							</div>
							<div align="{$default_left}">
								<div class="view_info">{$lang.poll.category} : </div><a href="{$site_root}/{$seo.poll}?sel=polls&par=category&category_id={$item.category_id}">{$item.cat_name}</a>
							</div>
							<div align="{$default_left}">
								{if $item.user_id ne '1'}
								<div class="view_info">{$lang.poll.author} :</div> <a href="{$item.view_link}">{$item.login}</a>
								{else}
								<div class="view_info">{$lang.poll.author} : </div><font class="text">{$item.login}</font>
								{/if}
							</div>
							<div align="{$default_left}">
								<div class="view_info">{$lang.poll.answers} : </div>{$item.votes_count}
							</div>
						</div>
				</div>
			</dt>
		{if $smarty.foreach.popular.iteration is div by 2}
		</dl>
		<dl style="overflow:hidden; margin: 5px 0;">
		{/if}
		{/foreach}
		</dl>
	</div>
</div>
<div class="sep"></div>
{/if}
{if $categories}
<div class="content content_adult_2">
	<h3 class="p-b5">{$lang.poll.categories}</h3>
	<div style="overflow:hidden;">
		<dl>
			{foreach name=categories from=$categories item=item}
			<dt style="width:30%; text-align: {$default_left}; line-height: 2;">
				 <div class="view_info"><a href="{$site_root}/{$seo.poll}?sel=polls&par=category&category_id={$item.category_id}">{$item.name}</a></div>&nbsp;&nbsp;&nbsp;&nbsp;{$item.all_polls_count}
			</dt>
			{if $smarty.foreach.categories.iteration is div by 3}
			</dl>
			<dl>
			{/if}
			{/foreach}
		</dl>
	</div>
</div>
{/if}
{include file="$gentemplates/$footer_tpl"}