var FL = 1;
var PL = true;

$(function(){
	DisplayDate();
	setInterval("Focus()", 5000);
})

function DisplayDate()
{
	var today = new Date();
	var week;
	var date;
	if(today.getDay()==0) week="星期日";
	if(today.getDay()==1) week="星期一";
	if(today.getDay()==2) week="星期二";
	if(today.getDay()==3) week="星期三";
	if(today.getDay()==4) week="星期四";
	if(today.getDay()==5) week="星期五";
	if(today.getDay()==6) week="星期六";
	date=(today.getFullYear())+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日"+" ";
	$('#date').html(date+week);
}

$(function(){
	$('.tab li a').mouseover(function(){
		var name = $(this).attr('name');
		$(this).parents('ul').find('li').removeClass();
		$(this).parent('li').addClass('current');
		$(this).parents('.tit').next().find('.cont').hide();
		$('.table '+ '#'+name).show();
	})
})

$(function(){
	$('.focus .page a').hover(function(){
		var name = $(this).attr('name');
		$(this).parents('div').find('a').removeClass();
		$(this).addClass('current');
		$(this).parents('.focus').find('.imgs div').hide()
		$('#'+name+'_img').fadeIn(800);
		$(this).parents('.focus').find('.tit div').hide()
		$('#'+name+'_tit').show();
		PL = false;
		FL = Number($(this).text());
	}, function(){
		PL = true;
	})
})

function Focus()
{
	if (PL == false)
	{
		return;
	}
	if (FL >= GetFocusPageNum())
	{
		FL = 0;
	}
	$('.focus .page a').eq(FL).hover();
}

function GetFocusPageNum()
{
	return $('.focus .page a').size();
}

function reply_quote(str)
{
	$('#comment #content').focus();
	$('#comment #content').val("[quote]"+str+"[/quote]\n");
	$('#comment #content').focus();
}