$(document).ready(function() {

	/* standart table style */

	if (!$.browser.msie) {

		var tables = $('table.standart-table').wrap('<div style="position: relative;"></div>');

		for (var i = 0; i < tables.length; i++) {

			if ($(tables[i]).find('th').length) {

				var left = $(tables[i]).find('th:first').position().left;

				var right = $(tables[i]).find('th:last').position().left + $(tables[i]).find('th:last').width() + 15;

				var top = $(tables[i]).position().top;

				var bottom = top + $(tables[i]).find('th:first').height() - 5;

				$(tables[i]).find('th:first').html('<div class="lt" style="left: ' + left + 'px; top: ' + top + 'px;"></div><div class="lb" style="left: ' + left + 'px; top: ' + bottom + 'px;"></div>' + $(tables[i]).find('th:first').html());

				$(tables[i]).find('th:last').html('<div class="rt" style="left: ' + right + 'px; top: ' + top + 'px;"></div><div class="rb" style="left: ' + right + 'px; top: ' + bottom + 'px;"></div>' + $(tables[i]).find('th:last').html());

			}

		}

	}

	

	/* main menu */

	$('.right-menu li a').click(function() {

		/* если нет подменю, то переходим */

		if (!$(this).parent().find('.hide').length) return true;

		

		/* закрываем открытый пункт */

		$(this).parent().parent().find('li').removeClass('select');

		

		/* открываем выбранный пункт */

		$(this).parent().addClass('select');



        setPadding();

		return false;

	});

	

	/* li styles */

	var li_count = $('.content li').length;

	if (li_count > 0) {

		for (var i = 0; i < li_count; i++) {

			$('.content li')[i].innerHTML = '<p>' + $('.content li')[i].innerHTML + '</p>';

		}

	}

    

    setPadding();

});



function setPadding() {

    /*$('#padding').css('padding-top', parseInt($('div.right-box').height()) - 50 + 'px');*/

}
