(function(a) {
a.fn.vTicker = function(b) {
var c = {
speed: 700,
pause: 4000,
showItems: 3,
animation: "",
mousePause: true,
isPaused: false,
direction: "up",
height: 0
};
var b = a.extend(c, b);
moveUp = function(g, d, e) {
if (e.isPaused) {
return
}
var f = g.children(".twtr-tweets");
var h = f.children(".twtr-tweet:first").clone(true);
if (e.height > 0) {
d = f.children(".twtr-tweet:first").height()
}
f.animate({
top: "-=" + d + "px"
},
e.speed,
function() {
a(this).children(".twtr-tweet:first").remove();
a(this).css("top", "0px")
});
if (e.animation == "fade") {
f.children(".twtr-tweet:first").fadeOut(e.speed);
if (e.height == 0) {
f.children(".twtr-tweet:eq(" + e.showItems + ")").hide().fadeIn(e.speed)
}
}
h.appendTo(f)
};
moveDown = function(g, d, e) {
if (e.isPaused) {
return
}
var f = g.children(".twtr-tweets");
var h = f.children(".twtr-tweet:last").clone(true);
if (e.height > 0) {
d = f.children(".twtr-tweet:first").height()
}
f.css("top", "-" + d + "px").prepend(h);
f.animate({
top: 0
},
e.speed,
function() {
a(this).children(".twtr-tweet:last").remove()
});
if (e.animation == "fade") {
if (e.height == 0) {
f.children(".twtr-tweet:eq(" + e.showItems + ")").fadeOut(e.speed)
}
f.children(".twtr-tweet:first").hide().fadeIn(e.speed)
}
};
return this.each(function() {
var f = a(this);
var e = 0;
f.css({
overflow: "hidden",
position: "relative"
}).children(".twtr-tweets").css({
position: "absolute",
margin: 0,
padding: 0
}).children(".twtr-tweet").css({
margin: 0,
padding: 0
});
/*
if (b.height == 0) {
f.children(".twtr-tweets").children(".twtr-tweet").each(function() {
if (a(this).height() > e) {
e = a(this).height()
}
});
f.children(".twtr-tweets").children(".twtr-tweet").each(function() {
a(this).height(e)
});
f.height(e * b.showItems)
} else {
f.height(b.height)
}*/
e = 68;
f.height(e * b.showItems)

var d = setInterval(function() {
if (b.direction == "up") {
moveUp(f, e, b)
} else {
moveDown(f, e, b)
}
},
b.pause);
if (b.mousePause) {
f.bind("mouseenter",
function() {
b.isPaused = true
}).bind("mouseleave",
function() {
b.isPaused = false
})
}
})
}
})(jQuery);
