";
for(var i=0; i < len; i++) {
btn += "";
}
btn += "
";
$("#focusTo").append(btn);
$("#focusTo .btnBg").css("opacity",1);
$("#focusTo .btn span").css("opacity",1).mouseenter(function() {
index = $("#focusTo .btn span").index(this);
showPics(index);
}).eq(0).trigger("mouseenter");
$("#focusTo .preNext").css("opacity",0.5).hover(function() {
$(this).stop(true,false).animate({"opacity":"0.8"},300);
},function() {
$(this).stop(true,false).animate({"opacity":"0.5"},300);
});
$("#focusTo .pre").click(function() {
index -= 1;
if(index == -1) {index = len-4;}
showPics(index);
});
$("#focusTo .next").click(function() {
index += 1;
if(index == len ) {index = 0;}
showPics(index);
});
$("#focusTo ul").css("width",(sWidth + 14) * (len));
/*autoscript*/ $("#focusTo").hover(function() {
clearInterval(picTimer);
},function() {
picTimer = setInterval(function() {
showPics(index);
index++;
if(index == len - 3) {index = 0;}
},5000);
}).trigger("mouseleave");
function showPics(index) {
var nowLeft = -index*(sWidth + 17);
$("#focusTo ul").stop(true,false).animate({"left":nowLeft},300);
$("#focusTo .btn span").stop(true,false).css("background","url()").eq(index).stop(true,false).css("background","url( )");
}
});