$(document).ready(NewsHotInit);
function NewsHotInit()
{
	
}
function NewsHotGet(group_id)
{
	if ($('#news_hot_body'+group_id).html())
	{
		$('div.news_hot_title h2').html('<a style="color: #D57100" href="'+site_url+'news/group/'+group_id+'/">'+$('#news_hot_title'+group_id+' a').html()+'</a>');
		$('div.news_hot_title span').show();
		$('#news_hot_title'+group_id).hide();
		$('div.news_hot_panel').hide();
		$('#news_hot_body'+group_id).show();
		return;
	}
	var data = {};
	data.group_id = group_id;
	var data_string = JSON.stringify(data);
	$.post(window.location+'/', {func: 'NewsHotGet', data: data_string}, NewsHotGetResult, 'json');
}
function NewsHotGetResult(result)
{
	if (result.error)
		return;
	
	$('div.news_hot_title h2').html('<a style="color: #D57100" href="'+site_url+'news/group/'+result.group_id+'/">'+$('#news_hot_title'+result.group_id+' a').html()+'</a>');
	$('div.news_hot_title span').show();
	$('#news_hot_title'+result.group_id).hide();
	for (var i in result.news)
	{
		$('#news_hot_body'+result.group_id).append('<div class="new">'+(result.news[i].image ? '<a href="'+site_url+'news/new/'+result.news[i].id+'"><img src="'+result.news[i].image+'" alt="'+result.news[i].text1+'" align="left" /></a>' : '')+'<div class="text1"><span class="time">'+result.news[i].time+'</span> <a href="'+site_url+'news/new/'+result.news[i].id+'">'+result.news[i].text1+'</a></div><div class="text2">'+result.news[i].text2+'</div></div>');
	}
	$('div.news_hot_panel').hide();
	$('#news_hot_body'+result.group_id).show();
}
