$.fn.accessNews=function(A){A=$.extend({scroll:2,newsSpeed:"normal"},A);return this.each(function(B){aNewsSlider.itemWidth=parseInt($(".item:eq("+B+")",".pickup_slider").css("width"));aNewsSlider.init(A,this);$(".view_all > a",this).click(function(){aNewsSlider.vAll(A,this);return false})})};var aNewsSlider={itemWidth:0,init:function(A,B){$(".messaging",B).hide();itemLength=$(".item",B).length;parentWidth=$(B).width();newsContainerWidth=itemLength*aNewsSlider.itemWidth;$(".container",B).css("width",newsContainerWidth+"px");if(parentWidth>newsContainerWidth){return }$(".next",B).show();animating=false;$(".next",B).click(function(){if(animating==false){animating=true;var C=parseInt($(".container",B).css("left"));var D=parseInt($(".container",B).css("width"));var E=parseInt($(".news_items",B).css("width"));animateLeft=C-(aNewsSlider.itemWidth*A.scroll);if(animateLeft+D<E){animateLeft=E-D}if(animateLeft+D>=E){$(".prev",B).show();$(".container",B).animate({left:animateLeft},A.newsSpeed,function(){$(this).css("left",animateLeft);if(animateLeft+D<=E){$(".next",B).hide()}animating=false})}else{animating=false}}return false});$(".prev",B).click(function(){if(animating==false){animating=true;var C=parseInt($(".container",B).css("left"));var D=parseInt($(".container",B).css("width"));var E=parseInt($(".news_items",B).css("width"));animateLeft=C+(aNewsSlider.itemWidth*A.scroll);if(animateLeft>0){animateLeft=0}if((animateLeft+D)<=D){$(".next",B).show();$(".container",B).animate({left:animateLeft},A.newsSpeed,function(){$(this).css("left",animateLeft);if(animateLeft>=0){$(".prev",B).hide()}animating=false})}else{animating=false}}return false})}};
