function nextPage(next=true){
if(moving){
return
}
moving=true;
var currentW= $list.position().left
var offset= next? -IMG_WIDTH:IMG_WIDTH;
if(currentW==0){
currentW=-(listCount-2)*IMG_WIDTH
$list.css("left",currentW)
}else if(currentW==-(listCount-1)*IMG_WIDTH){
currentW=-IMG_WIDTH
$list.css("left",currentW)
}
$list.animate({left:currentW+offset+"px"},"slow",function(){
moving=false
});
updatePoints(next);
} setInterval(function(){
nextPage();
},1000);
if(moving){
return
}
moving=true;
var currentW= $list.position().left
var offset= next? -IMG_WIDTH:IMG_WIDTH;
if(currentW==0){
currentW=-(listCount-2)*IMG_WIDTH
$list.css("left",currentW)
}else if(currentW==-(listCount-1)*IMG_WIDTH){
currentW=-IMG_WIDTH
$list.css("left",currentW)
}
$list.animate({left:currentW+offset+"px"},"slow",function(){
moving=false
});
updatePoints(next);
} setInterval(function(){
nextPage();
},1000);
if (moving) {
return
}
moving = true;
var currentW = $list.position().left
var offset = next ? -IMG_WIDTH: IMG_WIDTH;
if (currentW == 0) {
currentW = -(listCount - 2) * IMG_WIDTH
$list.css("left", currentW)
} else if (currentW == -(listCount - 1) * IMG_WIDTH) {
currentW = -IMG_WIDTH
$list.css("left", currentW)
}
$list.animate({
left: currentW + offset + "px"
}, "slow", function() {
moving = false;
setTimeout(function() {
nextPage();
}, 400);
});
updatePoints(next);
}setTimeout(function() {
nextPage();
}, 1000);