function fitItem()
{
	if (window.innerWidth)
	{
		var docWidth = window.innerWidth;
	}
	if (document.body.clientWidth)
	{
		var docWidth = document.body.clientWidth;
	}
	if (docWidth < 998)
	{
		docWidth = 998;
	}
	var activeWidth = docWidth - 256;
	var w = Math.round(activeWidth / Math.round(activeWidth / 252));
	if (w < 252)
	{
		w = 252;
	}
	
	$('#categories .block').css('width', w+'px');
	$('#categories').css('visibility', 'visible');
}

$(document).ready(function() {
	fitItem();
});

window.onresize = fitItem;
