(function(a) { a.fn.DB_rotateRollingBanner = function(b) { var c = { key: "", moveSpeed: 200, autoRollingTime: 5000, size: 5 }; a.extend(c, b); return this.each(function() { var k = a(this); var l = k.find(".ul_pic"); var h = l.find(">li"); var j = k.find(".ul_menu"); var r = j.find(">li"); var z = k.find(".left_arrow"); var B = k.find(".right_arrow"); var p = h.length; var y = 5; var s = "next"; var f; var C; var u = []; var x = []; var m = 1; var t = 0; var o = 0; var v = 0; var e = 0; if(c.size < y) y = c.size; w(); function w() { d(); g(); n() } function d() { j.html(""); for (var E = 0; E < p; E++) { var D = h.eq(E); if (E < y) { u[E] = { left: D.position().left, top: D.position().top, zIndex: D.css("z-index"), width: D.width(), height: D.height() }; D.css("left", u[E].left) } else { D.css("left", u[y - 1].left) } x.push(D); j.append("
") } r = j.find(">li"); r.eq(0).addClass("li_select") } function g() { k.bind("mouseenter", function() { clearInterval(f) }).bind("mouseleave", function() { n() }); r.bind("click", function() { if (m && o != a(this).index()) { t = a(this).index(); m = 0; v = Math.abs(t - o); if (t > o) { s = "next" } else { s = "prev" } if (v > Math.ceil(p / 2)) { v = p - v; if (s == "next") { s = "prev" } else { s = "next" } } e = 0; q(); if (v > 1) { C = setInterval(function() { if (m) { q(); m = 0; if (e >= v) { clearInterval(C) } } }, 50) } } }); B.bind("click", function() { if (m) { s = "next"; m = 0; if (t == p - 1) { t = 0 } else { t++ } q() } }); z.bind("click", function() { if (m) { s = "prev"; m = 0; if (t == 0) { t = p - 1 } else { t-- } q() } }) } function q() { if (s == "next") { for (i = 0; i < y; i++) { var D = u[i - 1]; if (i == 0) { x[i].fadeOut(c.moveSpeed) } else { x[i].css("z-index", D.zIndex).animate({ left: D.left, top: D.top, width: D.width, height: D.height }, c.moveSpeed) } } var D = u[y - 1]; if (x.length != y) { x[y].css({ left: D.left, top: D.top, width: D.width, height: D.height, "z-index": D.zIndex }).fadeIn(c.moveSpeed, function() { m = 1 }) } else { x[0].stop().css({ left: D.left, top: D.top, width: D.width, height: D.height, "z-index": D.zIndex }).fadeIn(c.moveSpeed, function() { m = 1 }) } x.push(x.shift()) } else { for (i = 0; i < y; i++) { var D = u[i + 1]; if (i == y - 1) { x[i].css("z-index", 0).fadeOut(c.moveSpeed) } else { x[i].css("z-index", D.zIndex).animate({ left: D.left, top: D.top, width: D.width, height: D.height }, c.moveSpeed) } } var D = u[0]; x[x.length - 1].stop().css({ left: D.left, top: D.top, width: D.width, height: D.height, "z-index": D.zIndex }).fadeIn(c.moveSpeed, function() { m = 1 }); x.unshift(x.pop()) } r.removeClass("li_select"); r.eq(t).addClass("li_select"); if(h.eq(0).children().length>0) { var klen = h.eq(0).children().length; for(var kk=0;kk