<a class="list-group-item" href="{url href=$pm.path}">{t}Личные сообщения{/t} <span class="badge pull-right{if $pm.umess} badge-important{/if}" id="pm_count">{$pm.umess} / {$pm.mess}</span></a>

<script type="text/javascript">
	(function(){
		var pm_status_url='{url href=$pm.path type="json"}';

		function updatePmInfo() {
			$.ajax({
				url:pm_status_url,
				type: 'post',
				dataType: 'json',
				data:{ 'action':'status', 'token':'{$_user->token}' } })
				.done(function(result) {
					if(!result.error) {
						$('#pm_count').html(result.umess+' / '+result.mess);
						if (result.umess) {
							$('#pm_count').addClass('badge-important');
						} else {
							$('#pm_count').removeClass('badge-important');
						}
					}
				}
				);
	}

		if (window.jQuery) {
			$(document).ready(function() {
				if (typeof pm_status_url != 'undefined') checkTimer=setInterval(updatePmInfo,10000);
			});
		}
	})();
</script>