var moodurl='http://mood.chinanews.com.cn/';
var hotpath='rank';

window.onload=function(){
	//$('tr[@class*=hours]').hide();
	//$('table[@class*=listtable]').hide();
	//$('.hours0').show();
	//$('.listtable0').show();
	//$('#timediv0').removeClass('nonowdiv');
	//$('#timediv0').addClass('nowdiv');
	//setnum('0');	
	document.title='Í¶Æ±ÅÅÐÐ°ñ';
	$('#total').html("Í¶Æ±Êý");

}

function changehours(num){
	var url=moodurl+hotpath;
	if(num==0){
		window.location.href=url+"/news_rank.shtml";
	}else{
		window.location.href=url+"/news_rank_"+num+".shtml";
	}
	//showtr(num);
	//setnum(num);
}

function setnum(num){
	var count=$('.hours'+num).find('td[@class=hottype]').size();	
	$('td[@class=countclass]').each(
		function(){
			var thistype=$(this).attr("alt");
			var zz='td[@alt='+thistype+']';
			var thiscount=$('.hours'+num).find(zz).size();
			if(count!=0){
				var res=parseInt((thiscount/count)*1000);
				$('#'+thistype).html(parseFloat(res/10)+'%');
			}else{
				$('#'+thistype).html('--');
			}
		}
	);
	
}

function showtr(num){
	$('tr[@class*=hours]').hide();
	$('table[@class*=listtable]').hide();
	$('div[@id*=timediv]').removeClass('nowdiv');
	$('div[@id*=timediv]').addClass('nonowdiv');
	$('#timediv'+num).removeClass('nonowdiv');
	$('#timediv'+num).addClass('nowdiv');
	$('.hours'+num).show();		
	$('.listtable'+num).show();		
}
function showlist(eve){
	//var tnt=document.getElementById("tdnewstype");
	//eve = eve ? eve : (window.event ? window.event : null); 
	//var sx=eve.screenX;
	//var sy=eve.screenY;
	var ld=document.getElementById("listdiv");
	var ttop=$('#tdnewstype').offset().top;
	var ttleft=$('#tdnewstype').offset().left;
	var thei=$('#tdnewstype').innerHeight();
	var twid=$('#tdnewstype').innerWidth();
	var sx=ttleft-twid+25;
	var sy=ttop+thei-1;
	ld.style.left=sx+'px';
	ld.style.top=sy+'px';	
	$('#listdiv').show("normal");
	$('#listdiv2').show("normal");
}
function hidelist(){
	$('#listdiv').hide("normal");
	$('#listdiv2').hide("normal");
}
function filterKey(newstype){
	$('.hottype').parent().show();
	if(newstype!='all'){
		$('.hottype').each(
			function(){
				var al=$(this).attr('alt');
				if(al!=newstype){
					$(this).parent().hide();
				}		
			}
		);
	}
	
	//$('#listdiv').hide("normal");
}
function listaover(tdd){
		tdd.style.background='highlight';
		tdd.style.color='white';
}
function listaout(tdd){
		tdd.style.background='white';
		tdd.style.color='black';
}