var isie=!(navigator.useragent.indexof('msie')==-1);
var news;
var curnew=0;
var timer;
function init()
{
var div=document.getelementbyid("newspic");
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=""+(i+1)+"";
if(i==curnew)n.classname="cur";
nav.appendchild(n);
news[i].linkelement=n;
}
div.appendchild(nav);
curnew--;
change();
}
function childrennodes(node)
{
var c=new array();
for(var i=0;i=news.length)curnew=0;
for(var i=0;i"+news[i].text+"";
}
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()",3000);
}