$(document).ready(function(){
	$('.table div img, .table div b').click(function(){
		var obj = $(this).parent();
		if(obj.attr('class')=="noimg")return;
		obj.attr('class', obj.attr('class') == 'minus' ? 'plus' : 'minus');
		obj.children('img').attr('src', '/img/'+obj.attr('class')+'.gif');
	});
	$('#center .analNews .list li').hover(	function(){
		clip($(this));
	});
	if($('#center .analNews').attr('class'))
	{
		window.setInterval(function(){
			var obj = $('#center .analNews .list li.active');
			clip(obj.next().attr('id') ? obj.next() : obj.parent().children().first());
		}, 10000);
	};
	
	
	/* by KARL: */
	/* hello lummers of JQuery 8-) */
	
		$('.blockOverlay, .close-popup').live('click', function(){
			$.unblockUI();
		});

	
		$('#add-comment-now').click(function(){
			//$('.add-comment-now-form').slideDown('fast');
			$.blockUI({ 
				message: $('.add-comment-now-form'),
				centerY: true,
				css: { 
					width: '400px',
					cursor: null,
					left: '50%',
					marginLeft: '-200px',
					top: '100px',
					textAlign: 'left',
					border: 'none', 
					backgroundColor:'#F0F0F0',
					'-webkit-border-radius': '5px', 
					'-moz-border-radius': '5px', 
					color: '#FFF' 
				}
			});
		});
		
		$('#big-search-now').click(function(){
			//$('.add-comment-now-form').slideDown('fast');
			$.blockUI({ 
				message: $('#big-search-form'),
				centerY: true,
				css: { 
					width: '500px',
					cursor: null,
					left: '50%',
					marginLeft: '-250px',
					top: '100px',
					textAlign: 'left',
					border: 'none', 
					backgroundColor:'#F0F0F0',
					'-webkit-border-radius': '5px', 
					'-moz-border-radius': '5px', 
					color: '#FFF' 
				}
			});
		});
	
	/* end it 980900 */
})

function clip(obj)
{
	$('#center .analNews .list li.active').attr('class', '');
	obj.attr('class', 'active');

	$('#analImage').attr('src', '/analitic/img/'+obj.attr('id')+'.jpg');
}
