;(function($) {

function start() {
	$(this).css('opacity',0.3);
	var o = this.opts;
	var i = o.itm;
	var t = o.up ? 0 : Math.min(0,$(i.parentNode).height() - $(i).height()-o.correccion);
	var s = Math.abs(o.msec * (t - parseInt($(i).css('top'))) / o.offs);
	$(i).animate({'top':t}, s);
}
function stop() {
	$(this.opts.itm).stop();
	$(this).css('opacity',1.0);	
}

$.fn.scrolltxt = function(options) {
	var defs = {
		offs: 1,
		msec: 15,
		slup: '#up',
		sldn: '#dn',
		correccion: 0
	};  
	return this.each(function() {
        $(this).css({'position':'relative','top':0,'zoom':1});
		var opts = $.extend({itm: this}, defs, options || {});
	    $(opts.slup).hover(start,stop).each(function(){this.opts=$.extend({up:true}, opts);});
	    $(opts.sldn).hover(start,stop).each(function(){this.opts=$.extend({dn:true}, opts);});
	});
};


})(jQuery);


