function $(name)
{
	return document.getElementById(name);
}
function ShowInfo(x,_c,_x)
{
	for(var i=1; i<=_x; i++){
		$("t"+_c+"_" + i).className="";
		$("t"+_c+"_info_"+ i).style.display = "none";
	}
	$("t"+_c+"_" + x).className="select";
	$("t"+_c+"_info_"+ x).style.display = "block";
}

function ShowInfo2(x,_c,_x)
{
	for(var i=1; i<=_x; i++){
		$("t"+_c+"_" + i).className="";
		$("t"+_c+"_info_"+ i).style.display = "none";
	}
	$("t"+_c+"_" + x).className="select_ay";
	$("t"+_c+"_info_"+ x).style.display = "block";
}

function ShowTime()
{
	var now=new Date();
	with(now)
	{
		var year=getYear();
		var month=getMonth()+1;
		var day=getDate();
		var dayW = getDay();
		var hours=getHours();
		var minutes=getMinutes();
		var seconds=getSeconds();
		if(hours<10){ hours="0"+hours;}
		if(minutes<10){ minutes="0"+minutes;}
		if(seconds<10){ seconds="0"+seconds;}
	}
	var dayStr = "星期日";
	if (dayW==1){dayStr = "星期一";}
	if (dayW==2){dayStr = "星期二";}
	if (dayW==3){dayStr = "星期三";}
	if (dayW==4){dayStr = "星期四";}
	if (dayW==5){dayStr = "星期五";}
	if (dayW==6){dayStr = "星期六";}
	$("nowTime").innerHTML = "当前时间:"+year+"年"+month+"月"+day+"日 "+dayStr+" "+hours+":"+minutes+":"+seconds;
}
function ChangeColor(x)
{
	if(x+""=="0")
	{
		var vNum = 2;
		//随机读取
		//vNum = Math.random();
		//vNum = Math.round(vNum*6) + 1;
		var skin_ID;     
		skin_ID = GetCookie("nowskinID");
		if(skin_ID!="")     
		    ChangeColor(skin_ID);
		else
		    ChangeColor(vNum);
	}
	else
	{
		$("skinID").href = "http://www.newssc.org/images/i/c_"+x+".css";
		ShowFocusNews(x);
//		for(var i=1;i<=7;i++)
//			$("hf_"+i).className = "";
//		$("hf_"+x).className = "select";
		var expdate = new Date();     
        expdate.setTime(expdate.getTime()+(1000*60*60*20));//毫秒 1000*60*60为1小时
		SetCookie("nowskinID",x,expdate,"/",null,false); 
	}
}
function SetCookie(name,value){
    var argv=SetCookie.arguments;     
    var argc=SetCookie.arguments.length;     
    var expires=(2<argc)?argv[2]:null; 
    var path=(3<argc)?argv[3]:null;     
    var domain=(4<argc)?argv[4]:null;     
    var secure=(5<argc)?argv[5]:false;     
    document.cookie=name+"="+escape(value)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"");     
}
function GetCookie(Name) {     
    var search = Name + "=";     
    var returnvalue = "";     
    if (document.cookie.length > 0) {     
          offset = document.cookie.indexOf(search);     
          if (offset != -1) {           
                offset += search.length;     
                end = document.cookie.indexOf(";", offset);                             
                if (end == -1)     
                      end = document.cookie.length;     
                returnvalue=unescape(document.cookie.substring(offset,end));     
          }     
    }     
    return returnvalue;     
}
var nowDisplayNum = 1;
function ReSetNowDisplayNum()
{
	nowDisplayNum = 1;
}
function GetNowDisplayNum()
{
	document.write("<div class='rank'>"+(nowDisplayNum++)+"</div>");
}
function ShowFocusNews(id)
{
	var x = id;
	if(x<1||x>3){ x=2; }
	var key = "b";
	if(x==2){key="a";}
	if(x==3){key="c";}
	var outStr = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">';
	outStr += '<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="http://www.newssc.org/images/i/hotnews_'+key+'.swf"> <param name="quality" value="high">';
	outStr += '<param name="menu" value="false"><param name="wmode" value="transparent">';
	outStr += '<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">';
	outStr += '<embed src="http://www.newssc.org/images/i/hotnews_'+key+'.swf" wmode="transparent" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	outStr += '</object>';
	$('focusNews').innerHTML = outStr;
}
 
 
 
 
 
 