
(function($){$.fn.naBannerRotation=function(options){var $defaults={animateTime:500,changeTime:5000};var $options=$.extend($defaults,options);$naObject=$(this);if($naObject.find(".banner_rotator_outer a").length>1){var $banner_rotator_list='<ul class="banner_rotation_list">';$naObject.find(".banner_rotator_outer a").each(function(){var $banner_index=$(this).index();$(this).addClass("banner_item_"+$banner_index);$banner_rotator_list+='<li class="banner_item_'+$banner_index+'"><a href="#"><span>'+$banner_index+'</span></a></li>';});$banner_rotator_list+='</ul>'
$naObject.find(".banner_rotator_outer").after($banner_rotator_list);$naObject.find(".banner_rotator_outer a:first").addClass("active");$naObject.find(".banner_rotation_list li:first a").addClass("active");var $animationPending=false;$naObject.find(".banner_rotation_list li").live("click",function(){if(!$animationPending){if(!$(this).children("a").hasClass("active")){clearTimeout($t);$animationPending=true;$thisIndex=$(this).index();if($naObject.find(".banner_rotation_list li:eq("+($thisIndex+1)+")").length>0){$toClick=$thisIndex+1;}else{$toClick=0;}
$naObject.find(".banner_rotation_list li a").removeClass("active");$(this).children("a").addClass("active");var $banner_class=$(this).attr("class");var $that=$naObject.find(".banner_rotator_outer").children("."+$banner_class);$that.addClass("toActivate").css({left:260});$that.stop(false,true).animate({left:0},$options.animateTime,function(){$naObject.find(".banner_rotator_outer a").removeClass("active").removeClass("toActivate");$naObject.find(".banner_rotator_outer").children("."+$banner_class).addClass("active");$t=setTimeout('$naObject.find(".banner_rotation_list li:eq("+$toClick+")").click();',$options.changeTime);$animationPending=false;});}}
return false;});var $t=setTimeout('$naObject.find(".banner_rotation_list li:eq(1)").click();',$options.changeTime);}};})(jQuery);
