<div id="focus-pic">
<span id="btn-left"></span>
<ul id="ul01" class="bigImg">
<li><a href="javascript:void(0)"><img src="img/focus01.jpg" alt="" /></a></li>
<li><a href="javascript:void(0)"><img src="img/focus02.jpg" alt="" /></a></li>
<li><a href="javascript:void(0)"><img src="img/focus01.jpg" alt="" /></a></li>
<li><a href="javascript:void(0)"><img src="img/focus02.jpg" alt="" /></a></li>
<li><a href="javascript:void(0)"><img src="img/focus01.jpg" alt="" /></a></li>
</ul>
<div class="cutBtn">
<ul id="ul02">
<li class="active">1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
</div>
<span id="btn-right"></span>var bigImgScroll=function(){};
function $(id){ return typeof id == "string" ? document.getElementById(id) : id; }
bigImgScroll.prototype={
init:function(obj){
var t = this;
this.obigImgLi = obj.getElementsByTagName("li");
this.oBtnLi = $("ul02").getElementsByTagName("li");
this.iNow = 0;
this.oMaxWidth = this.obigImgLi[0].offsetWidth;
this.oTimer = null;
this.iSpeed = 0;
obj.style.width= this.obigImgLi[0].offsetWidth * this.obigImgLi.length + "px";
for (i=0;i<t.oBtnLi.length ;i++ )
{
t.oBtnLi[i].index=i;
t.oBtnLi[i].onclick=function()
{
t.iNow=this.index;
t.scroll(obj,-t.iNow * t.oMaxWidth);
}
}
if ($("btn-right"))
{
$("btn-right").onclick = function(){
t.autoPlay(obj);
}
}
if ($("btn-left"))
{
$("btn-left").onclick = function(){
t.leftScroll(obj);
}
}
var timer=setInterval(function(){t.autoPlay(obj)}, 5000);
$("focus-pic").onmouseover=function ()
{
clearInterval(timer);
};

$("focus-pic").onmouseout=function ()
{
timer=setInterval(function(){t.autoPlay(obj)}, 5000);
}; },
scroll:function(obj,tag){
for (i=0;i<this.oBtnLi.length ;i++ )
{
this.oBtnLi[i].className = "";
}
this.oBtnLi[this.iNow].className = "active";
this.starmove(obj,tag);
},
starmove:function(obj,tag){
var t = this;
if (t.oTimer)
{
clearInterval(t.oTimer);
}
t.oTimer = setInterval(function(){
t.domove(obj,tag);
},
30
);
},
domove:function(obj,tag){
var t = this;
t.iSpeed =(tag - obj.offsetLeft)/5;
t.iSpeed = t.iSpeed>0 ? Math.ceil(t.iSpeed) : Math.floor(t.iSpeed);
obj.style.left = obj.offsetLeft + t.iSpeed + "px";
},
autoPlay:function(obj){
this.iNow++;
if(this.iNow>=this.oBtnLi.length){

this.iNow=0;
}
this.scroll(obj,-this.iNow * this.oMaxWidth);
},
leftScroll:function(obj){
this.iNow--;
if(this.iNow<=-1){

this.iNow=this.oBtnLi.length-1;
}
this.scroll(obj,-this.iNow * this.oMaxWidth);
}
}
new bigImgScroll().init($("ul01"));