<script>
	$(document).ready(function(){
		$('#user-block').html(
			'<div class="user-block">'
				+'<div class="user-pofile">'
					+'<div class="user-avatar"><img src="'+home+'{avatar}" alt="MarVal"></div>'
					+'<div class="user-info">'
						+'<div class="user-name"><a href="'+home+'profile">{login}</a></div>'
						+'<div class="user-money">Баланс: <span>{balance}р</span></div>'
						+'<a href="'+home+'purse"><div class="user-money-plus"><i class="fa fa-rub"></i></div></a>'
						+'<a href="'+home+'bans" id="bans-view"><div class="user-money-plus bans-view">Разбан</div></a>'
					+'</div>'
				+'</div>'
				+'<div class="user-links float-right">'
					+'<a href="'+home+'profile">Профиль</a>'
					+'<a href="'+home+'settings">Настройки</a>'
					+'<a href="'+home+'messages">Личные сообщения</a>'
					+'<a href="'+home+'my_stores">Купленные услуги</a>'
					+'<a href="'+home+'store">Магазин</a>'
					+'<a href="'+home+'support">Тех. Поддержка</a>'
					+'<a href="'+home+'friends">Друзья</a>'
					+'<a href="'+home+'exit">Выйти</a>'
				+'</div>'
			+'</div>'
		);

		check_news('{user_id}');
		<? if(strripos($users_groups[$sessionrights]['rights'], "i") !== false) { ?>
			check_bans();
		<? } ?>
		get_onl_users();
	});

	function check_bans()
	{
		$.ajax({
			type: 'POST',
			url: home+'templates/SquareLine/php/bansview.php',
			data: 'token='+$('#token').val(),
			success: function(data)
			{
				if(data == 1)
					$('#bans-view div').show();
			}
		});

		return null;
	}

	if(window.location.pathname != '/messages')
		var check_mess = setInterval(check_messages, 30000);
</script>

<!-- gamecms code -->
<div id="check_mess"></div>
<!-- /gamecms code -->
