// -------------------- HOT NEWS -------------------------------- //
$(document).ready(function(){
	var hotNewsChangeInterval = setInterval( function(){ changeHotNews('auto'); } , 5000 );
}); 


function changeHotNews(act){

	var nextHot;
	var hotCnt = $('#hotnews_block .hot').length;
	var activeNews = $('#hotnews_block .hot').index( $('#hotnews_block .active') );

	if( act=='next' || act=='auto' )
		nextHot = activeNews + 1;
	else
	if( act=='prev' )
		nextHot = activeNews - 1;

	if( nextHot == hotCnt )
		nextHot = 0;
	else
	if( nextHot == -1 )
		nextHot = hotCnt-1;

	$('#hotnews_block .active').removeClass('active').fadeOut(function(){
														$(this).addClass('none');
														$('#hotnews_block .hot').eq(nextHot).addClass('active').fadeIn(function(){ $(this).removeClass('none'); });
													});
}         
// -------------------- end HOT NEWS -------------------------------- //


// -------------------- HOT NEWS -------------------------------- //
$(document).ready(function(){
	var hotNewsChangeInterval = setInterval( function(){ changeHotNews2('auto'); } , 999999000 );
}); 


function changeHotNews2(act){
	var nextHot;
	var hotCnt = $('#hotnews_block_top .hot').length;
	//console.info('changeHotNews2 '+hotCnt);
	var activeNews = $('#hotnews_block_top .hot').index( $('#hotnews_block_top .active') );

	if( act=='next' || act=='auto' )
		nextHot = activeNews + 1;
	else
	if( act=='prev' )
		nextHot = activeNews - 1;

	if( nextHot == hotCnt )
		nextHot = 0;
	else
	if( nextHot == -1 )
		nextHot = hotCnt-1;

	/*$('#hotnews_block_top .active').removeClass('active').fadeOut(function(){
														$(this).addClass('none');
														$('#hotnews_block_top .hot').eq(nextHot).addClass('active').fadeIn(function(){ $(this).removeClass('none'); });
													}); */    
    var options = {};                                                    
    $('#hotnews_block_top .active').removeClass('active').fadeOut(function(){
														//$(this).addClass('none');
                                                        $(this).hide('drop',options,500);
														$('#hotnews_block_top .hot').eq(nextHot).addClass('active').show('drop',options,500);
													});                                                
}         
// -------------------- end HOT NEWS -------------------------------- //
