<script language='javascript'>
var isIE=!(navigator.userAgent.indexOf('MSIE')==-1);
var news;
var curNew=0;
var timer;
function init(pic,txt)
{
if(!pic)pic="NewsPic";
if(!txt)txt="NewsPicTxt";
var text=document.getElementById(txt);
var div=document.getElementById(pic);
if(!div)return;
var nav=document.createElement("DIV");
nav.className="Nav";
var nodes;
if(isIE)
{
nodes=div.childNodes;
}
else
{
nodes=childrenNodes(div.childNodes);
}
news=new Array(nodes.length);
for(var i=nodes.length-1;i>=0;i--)
{
var element=nodes[i];
news[i]={};
news[i].Element=element;
news[i].Text=element.getAttribute("title");
news[i].Url=element.getAttribute("href");
var n=document.createElement("span");
n.innerHTML="<a herf=\"javascript:;\" onclick=\"javascript:curNew="+(i-1)+";change('"+pic+"','"+txt+"');\">"+(i+1)+"</a>";
if(i==curNew)
{
n.className="Cur";
text.innerHTML="<a href=\""+news[i].Url+"\" title=\""+news[i].Text+"\" target=\"_blank\">"+news[i].Text+"</a>";
}
else
{
n.className="Normal";
}
nav.appendChild(n);
news[i].LinkElement=n;
}
div.appendChild(nav);
curNew--;
window.setTimeout("change('"+pic+"','"+txt+"')",3000);
}
function childrenNodes(node)
{
var c=new Array();
for(var i=0;i<node.length;i++)
{
if(node[i].nodeName.toLowerCase()=="a")
c.push(node[i]);
}
return c;
}
function change(pic,txt)
{
var div=document.getElementById(pic);
var text=document.getElementById(txt);
if(!div)return;
curNew=curNew+1;
if(curNew>=news.length)curNew=0;
for(var i=0;i<news.length;i++)
{
if(i==curNew)
{
news[i].Element.style.display="block";
news[i].Element.style.visibility="visible";
news[i].LinkElement.className="Cur";
text.innerHTML="<a href=\""+news[i].Url+"\" title=\""+news[i].Text+"\" target=\"_blank\">"+news[i].Text+"</a>";
}
else
{
news[i].Element.style.visibility="hidden";
news[i].Element.style.display="none";
news[i].LinkElement.className="Normal";
}
}
if(timer)window.clearTimeout(timer);
timer=window.setTimeout("change('"+pic+"','"+txt+"')",20000);
}
</script>
<div id="NewsPicTxt"></div>
<div id="NewsPic" style="width:285px;overflow:hidden;"><a title="雪灾,生命是如此的脆弱" style="DISPLAY: block; VISIBILITY: visible;text-decoration:none;" href="http://cache.tianya.cn/publicforum/content/no04/1/679181.shtml" target="_blank">
<img border="0" class="Picture" height="180" alt="雪灾,生命是如此的脆弱" src="http://pic.yupoo.com/fatco/579624ff59bd/gk422jvg.jpg"
width="280"/></a><a title="Symbian OS全球化智能手机主流平台" style="DISPLAY: none; VISIBILITY: hidden;text-decoration:none;" href="http://z.csdn.net/adclick.php?bannerid=459" target="_blank"><img border="0"
class="Picture" height="180" alt="Symbian OS全球化智能手机主流平台"
src="280180hyllecheng.jpg" width="280"/></a><a title="Solaris 10 下载" style="DISPLAY: none; VISIBILITY: hidden;text-decoration:none;" href="http://z.csdn.net/adclick.php?bannerid=401" target="_blank"><img border="0"
class="Picture" height="180" alt="Solaris 10 下载" src="296196solaris.jpg"
width="280"/></a><a title="为年您心中的"金牛"投票!" style="DISPLAY: none; VISIBILITY: hidden;text-decoration:none;" href="http://z.csdn.net/adclick.php?bannerid=410" target="_blank"><img border="0"
class="Picture" height="180" alt="为年您心中的"金牛"投票!"
src="280180wulipingxuan.gif" width="280"/></a><a title="2007《程序员》精华本" style="DISPLAY: none; VISIBILITY: hidden;text-decoration:none;" href="http://z.csdn.net/adclick.php?bannerid=369" target="_blank"><img border="0"
class="Picture" height="180" alt="2007《程序员》精华本" src="280187jinghua.gif"
width="280"/></a></div>
<script type="text/javascript">
init();
</script>