// JavaScript Document
// JavaScript Document
$(document).ready
(
function()
{

	setInterval(function(){showTime('time')},1000);
	setInterval(function(){scr("scr")},1000);
	
	
	var pos=(parseInt(screen.availWidth)-960)*0.5;

	$("#nav>li>a").hover(
	function()
	{		
		if($(this).attr('id')=='')
		{
			hideAll();
			$("#scr").css('visibility','visible')
		}
		else
		{
			//alert($(this).attr('id'));
			hideAll();
			if($(this).attr('id')=='a_zsxx')
			{
				$("#zsxx").css({'top':'210px','left':pos+120+'px'})
			}
			else if($(this).attr('id')=='a_dfqgs')
			{
				$("#dfqgs").css({'top':'210px','left':pos+350+'px'})				
			}
			else if($(this).attr('id')=='a_klxx')
			{
				$("#klxx").css({'top':'210px','left':pos+300+'px'})
			}
			else if($(this).attr('id')=='a_zpzs')
			{
				$("#zpzs").css({'top':'210px','left':pos+650+'px'})
			}
			
		}
	},function()
	{
	}
	
	)

}
)

function showTime(obj)
{
	var date = new Date;
	
	if(date.getDay()==1) day='一';
	else if(date.getDay()==2) day='二';
	else if(date.getDay()==3) day='三';
	else if(date.getDay()==4) day='四';
	else if(date.getDay()==5) day='五';
	else if(date.getDay()==6) day='六';
	else day='天';
	
	$("#"+obj).html(date.getFullYear()
	+'年'+(date.getMonth()+1)
	+'月'+(date.getDate())
	+'日 星期'+day+'&nbsp;&nbsp;&nbsp;'
	+date.getHours()+':'+date.getMinutes()+':'+(date.getSeconds()+1));
}

function scr(a)
{
	var obj=$("#"+a)
	if(parseInt(obj.css('margin-left'))==10)
	{
		obj.animate({'margin-left':'560px'},15000)
	}
	if(parseInt(obj.css('margin-left'))==560)
	{
		obj.animate({'margin-left':'10px'},15000)
	}
}
function hideAll()
{

	$("#scr").css('visibility','hidden')
	$("#zsxx").css('top','-999px');
	$("#dfqgs").css('top','-999px');
	$("#klxx").css('top','-999px');
	$("#zpzs").css('top','-999px');
}

function closeIt()
{
	$("#divStayTopleft").css('display','none')
}
