jQuery(document).ready(
		function()
		{
			jQuery('.blog_list .list .content-head').corner('6px');
			jQuery('.contentpaneopen h2').corner('6px');
			jQuery('div.persons div.person-th-container').corner('6px');
			jQuery('div.persons span.person-th-container').corner('3px');
			
			init_share_hover();
			
			//--- фиксим отступы картинок в контенте 
			init_content_images();
			
			//--- проставляем ласты
			initLasts();
			
			//--- расшариватель
			initShareFunction();
			
			//--- бордеры в контенте
			initContentBorders();
			
			//--- переключатель архивов
			initArhiveSelect();
			
			//--- поле селекта
			initCustomSelect();
		}
);

function initLasts()
{
	top_article_detail_init();
	
	//--- таблицам в person стиле
	jQuery('.persons table').each(
			function()
			{
				jQuery('tr:last td', jQuery(this)).addClass('last');				
			}
	);
}

function top_article_detail_init()
{
	jQuery('.top-article-detail li:last').addClass('last')
}

function init_share_hover()
{
	jQuery('.share-list img').hover(
			function()
			{
				jQuery(this).attr('src', jQuery(this).attr('src').replace('normal', 'hover'));
			},
			function()
			{
				jQuery(this).attr('src', jQuery(this).attr('src').replace('hover', 'normal'));
			}
	);	
}

function init_content_images()
{
	jQuery('.contentpaneopen img').each(
			function()
			{
				if (jQuery(this).css('float') == 'left')				
				{
					jQuery(this).css({'margin-left':'0px'});
					
					if (parseInt(jQuery(this).css('margin-right')) == 0)
					{
						jQuery(this).css({'margin-right':'5px'});
					}
				}
				
				if (jQuery(this).css('float') == 'right')				
				{
					jQuery(this).css({'margin-right':'0px'});
					
					if (parseInt(jQuery(this).css('margin-left')) == 0)
					{
						jQuery(this).css({'margin-left':'5px'});
					}
				}
			}
	);
}

function initShareFunction()
{
	jQuery('.popup .share-link').popupWindow({ 
		centerScreen : 1,
		height: 500,
		width: 700
	});
}

function initContentBorders()
{
	jQuery('img[border="1"]').css({border:'1px solid'});
}

function initArhiveSelect()
{
	jQuery('.inp-select-archive').change(
			function()
			{
				window.location.href = jQuery(this).val().replace('span','option');
				return false;
			}
	);
}

function initCustomSelect()
{
	jQuery('.inp_select-cusel').css("width","217px");
	
	var params = {
    changedEl: ".inp_select-cusel",
    visRows: 15,
    scrollArrows: true
	}
	cuSel(params);
}

