<div style="overflow: hidden;">
	<div class="float_left">
		<h2>{$lang.section.poll}</h2>
	</div>
	<div class="float_right" style="padding-top:10px;padding-bottom:4px;">
	{if $user_id ne '2'}
		<a href="{$site_root}/{$seo.poll}" class="poll-icon" alt="" title="{$lang.poll.homepage}">&nbsp;</a>&nbsp;
	{if $settings.allow_users_create_poll}
		<a href="{$site_root}/{$seo.poll}?sel=polls&par=my_polls" class="my-poll-icon" alt="" title="{$lang.poll.my_polls}">&nbsp;</a>&nbsp;
		<a onclick="addPoll();" class="add-poll-icon" alt="" title="{$lang.poll.add_poll}">&nbsp;</a>
		{/if}
	{/if}
	</div>
</div>
<div class="sep"></div>
<script type="text/javascript">
	sel= '{$sel}'
	poll_from_param = '{$par}';
	page = '{$page}';

	{literal}

	function editPoll(poll_id){
		launchWindow(SEO_SITE_ROOT + '/poll.php?sel=edit_poll_form&par='+poll_from_param+'&poll_id='+poll_id+'&page='+page,'', 700, 600);
	}

	function deletePoll(poll_id){
		ajaxLoadingImage(1, 'poll_loading'+poll_id);
		str = 'poll_id='+poll_id;
		$.post(SEO_SITE_ROOT + '/poll.php?sel=delete_poll',str,function(data){
			data = getJQData(data);
			if (data['success']=='1'){
				showNoticeOnEl(data['msg'],$("#delete_link"+poll_id));
				$("#tr"+poll_id).remove();
				if ($("tr[param=poll_tr]").length==0){
					location.href=SEO_SITE_ROOT + "/poll.php?sel="+sel+"&par="+poll_from_param+"&page="+(page-1);
				}
			}else{
				showNoticeOnEl(data['msg'],$("#delete_link"+poll_id));
			}
			ajaxLoadingImage(0,  $("#poll_loading"+poll_id));
		});
	}

	function showAdvStats(poll_id){
		launchWindow(SEO_SITE_ROOT + '/poll.php?sel=show_adv_stats&ajax=1&poll_id='+poll_id+'&page='+page, '', 700, 600);
	}

	{/literal}
</script>