function resizeBlocks() {
	var documentWidth = $(document).width();
	var blocksWidth = documentWidth - 70 - 280 - 62;
	var numberOfBlocks = Math.floor(blocksWidth / 148);
	if(numberOfBlocks >= 3) {
		var newTopWidth = numberOfBlocks * 148;
		var newBlocksWidth = numberOfBlocks * 148;
		var newFooterWidth = numberOfBlocks * 148;
		newFooterWidth -= 8;
		newTopWidth -= 8;
		$('#center-blocks').css('width', newBlocksWidth + 'px');
		$('#center-wrapper').css('width', newBlocksWidth + 'px');
		$('#footer').css('width', newFooterWidth + 'px');
		$('#top').css('width', newTopWidth + 'px');
		$('#top table').css('width', newTopWidth + 'px');
	}
	if(numberOfBlocks == 3) {
		$('#lang-menu').css('right', '1px');
	} else {
		$('#lang-menu').css('right', '-5px');
	}
	
	var topHeight = $("#top").height();
	//alert(topHeight);
	if(topHeight > 17) {
		$("#left-wrapper").css('padding-top', '32px');
	}
}



$(document).ready(function() {
	$(window).resize(function() {
		resizeBlocks();
	});
	
	$(window).load(function() {
		resizeBlocks();
	});
	var headers = $(".header");
	for(var i = 0; i < headers.length; i++){
		$(headers[i]).textfill({ maxFontPixels: 17, innerTag:'span' })
	}
});

