jQuery.fn.vhTicker=function(options){var defaults={speed:700,pause:4000,showItems:1,animation:'',mousePause:true,isPaused:false,direction:'up',height:0,width:0};var options=jQuery.extend(defaults,options);moveUp=function(obj2,height,options){if(options.isPaused)
return;var obj=obj2.children('ul');var clone=obj.children('li:first').clone(true);if(options.height>0)
{height=obj.children('li:first').height();}
obj.animate({top:'-='+height+'px'},options.speed,function(){jQuery(this).children('li:first').remove();jQuery(this).css('top','0px');});if(options.animation=='fade')
{obj.children('li:first').fadeOut(options.speed);if(options.height==0)
{obj.children('li:eq('+options.showItems+')').hide().fadeIn(options.speed).show();}}
clone.appendTo(obj);};moveDown=function(obj2,height,options){if(options.isPaused)
return;var obj=obj2.children('ul');var clone=obj.children('li:last').clone(true);if(options.height>0)
{height=obj.children('li:first').height();}
obj.css('top','-'+height+'px').prepend(clone);obj.animate({top:0},options.speed,function(){jQuery(this).children('li:last').remove();});if(options.animation=='fade')
{if(options.height==0)
{obj.children('li:eq('+options.showItems+')').fadeOut(options.speed);}
obj.children('li:first').hide().fadeIn(options.speed).show();}};moveRight=function(obj2,width,options){if(options.isPaused)
return;var obj=obj2.children('ul');var clone=obj.children('li:last').clone(true);if(options.width>0)
{width=obj.children('li:first').width();}
obj.css('left','-'+width+'px').prepend(clone);obj.animate({left:0},options.speed,function(){jQuery(this).children('li:last').remove();});if(options.animation=='fade')
{if(options.width==0)
{obj.children('li:eq('+options.showItems+')').fadeOut(options.speed);}
obj.children('li:first').hide().fadeIn(options.speed).show();}};moveLeft=function(obj2,width,options){if(options.isPaused)
return;var obj=obj2.children('ul');var clone=obj.children('li:last').clone(true);if(options.width>0)
{width=obj.children('li:first').width();}
obj.css('right','-'+width+'px').prepend(clone);obj.animate({left:0},options.speed,function(){jQuery(this).children('li:last').remove();});if(options.animation=='fade')
{if(options.width==0)
{obj.children('li:eq('+options.showItems+')').fadeOut(options.speed);}
obj.children('li:first').hide().fadeIn(options.speed).show();}};return this.each(function(){var obj=jQuery(this);var maxHeight=0;var maxWidth=0;obj.css({overflow:'hidden',position:'relative'}).children('ul').css({position:'absolute',margin:0,padding:0}).children('li').css({margin:0,padding:0});if(options.height==0)
{obj.children('ul').children('li').each(function(){if(jQuery(this).height()>maxHeight)
{maxHeight=jQuery(this).height();}});obj.children('ul').children('li').each(function(){jQuery(this).height(maxHeight);});obj.height(maxHeight*options.showItems);}
else
{obj.height(options.height);}
if(options.width==0)
{obj.children('ul').children('li').each(function(){if(jQuery(this).width()>maxWidth)
{maxWidth=jQuery(this).width();}});obj.children('ul').children('li').each(function(){jQuery(this).width(maxWidth);});obj.width(maxWidth*options.showItems);}
else
{obj.width(options.width);}
var interval=setInterval(function(){switch(options.direction){case'down':moveDown(obj,maxHeight,options);break;case'right':moveRight(obj,maxWidth,options);break;case'left':moveLeft(obj,maxWidth,options);break;default:moveUp(obj,maxHeight,options);}},options.pause);if(options.mousePause)
{obj.bind("mouseenter",function(){options.isPaused=true;}).bind("mouseleave",function(){options.isPaused=false;});}});};
