";
for(var i=0; i < len; i++) {
btn += "" + (i+1) + "";
}
btn += "
";
$("#focus").append(btn);
$("#focus .btnBg").css("opacity",0.5);
$("#focus .btn span").css("opacity",0.4).mouseenter(function() {
index = $("#focus .btn span").index(this);
showPics(index);
}).eq(0).trigger("mouseenter");
$("#focus ul").css("width",sWidth * (len));
$("#focus ul li").css("width",sWidth);
$("#focus").hover(function() {
clearInterval(picTimer);
},function() {
picTimer = setInterval(function() {
showPics(index);
index++;
if(index == len) {index = 0;}
},3000);
}).trigger("mouseleave");
function showPics(index) {
var nowLeft = -index*sWidth;
$("#focus ul").stop(true,false).animate({"left":nowLeft},300);
$("#focus_text ul").stop(true,false).animate({"left":nowLeft},300);
$("#focus .btn span").removeClass("on").eq(index).addClass("on");
$("#focus .btn span").stop(true,false).animate({"opacity":"0.9"},300).eq(index).stop(true,false).animate({"opacity":"1"},300);
}
$("#focus .next").click(function(){index += 1; if (index == len) { index = 0; }showPics(index)});
$("#focus .prev").click(function(){ index -= 1;if (index == -1) { index = len - 1; } showPics(index);});
});