﻿$.get('/index/14', function (a) {
	$('#allMessArea').html(Math.round(parseInt($('a.pmCatLinkActive b:first', a).html(), 10) + parseInt($('a.pmCatLink b:first', a).html(), 10)))
});
$('#uMessage').click(function () {
	$('#imgLoad').attr('src', 'http://src.ucoz.ru/img/wd/3/ajaxs.gif');
	$.get('/index/14', function (d) {
		$('#allMessArea').html(Math.round(parseInt($('a.pmCatLinkActive b:first', d).html(), 10) + parseInt($('a.pmCatLink b:first', d).html(), 10)));
		loadMessage = $('b.unread', d).length;
		if (loadMessage == 0) {
			_uWnd.alert('У вас нет новых сообщений', null, {
				w: 250
			})
		} else {
			_uWnd.alert('У вас ' + loadMessage + ' непрочитаных сообщений', null, {
				w: 250
			});
			$('#unreadPM').replaceWith(loadMessage);
			$('.loadM').replaceWith(loadMessage)
		}
		$('#imgLoad').attr('src', 'http://src.ucoz.ru/img/icon/ok.png')
	})
});

try {
	var nl = document.getElementById('menu').getElementsByTagName('a'),
	found = -1,
	url = document.location.href + '/',
	len = 0;
	for (var i = 0; i < nl.length; i++) {
		if (url.indexOf(nl[i].href) >= 0) {
			if (found == -1 || len < nl[i].href.length) {
				found = i;
				len = nl[i].href.length
			}
		}
	}
	if (found >= 0) {
		nl[found].style.fontWeight = 'bolder'
	}
} catch(e) {}

try {
	var nl = document.getElementById('menu-visit').getElementsByTagName('a'),
	found = -1,
	url = document.location.href + '/',
	len = 0;
	for (var i = 0; i < nl.length; i++) {
		if (url.indexOf(nl[i].href) >= 0) {
			if (found == -1 || len < nl[i].href.length) {
				found = i;
				len = nl[i].href.length
			}
		}
	}
	if (found >= 0) {
		nl[found].className = 'menus'
	}
} catch(e) {}
