var cTicker, nTicker;

function changeTiker()
{
	i 	 = nTicker;
	while(i == nTicker)
		i = Math.floor(Math.random() * (cTicker + 1));
	nTicker = i;
	
	$('#tiker span[class="now"]').hide().removeClass('now');
	$('#_tiker' + nTicker).slideDown().addClass('now');
}

function res()
{
		$('#content').width('440px');
		$('#body').css({overflow: 'visible'});
return true;
	w = $(window).width();
	if(w > 1012)
	{
		if(w > 1200) w = 1200;
		$('#content').width(360 + (w - 1024) + 'px');
		$('#body').css({overflow: 'visible'});
	}
	else
	{
		$('#content').width('440px');
		$('#body').css({overflow: 'hidden'});
	}
}

$
(
 	function()
	{
		res();
		
		// TIKER animation
		$('#tiker span').each
		(
		 	function(i)
			{
				$(this).attr('id', '_tiker' + i);
				
				if(!$(this).hasClass('now')) 
					$(this).hide()
				else
					nTicker = i;
					
				cTicker = i;
			}
		);
		
		setInterval('changeTiker()', parseInt($('#tiker span[class="now"]').attr('alt')));
		
		//Сворачивание блоков для "Статьи"
		$('.sub').click
		(
		 	function()
			{
				$(this).next().toggle();
				return false;
			}
		);
		
		
		$(window).resize
		(
			function()
			{
				res();
			}
		);
	}
);