fluid_1_1=fluid_1_1||{};(function($,fluid){var refreshView=function(that){var maxHeight=that.options.maxHeight;var isOverMaxHeight=(that.scrollingElm.children().eq(0).height()>maxHeight);var setHeight=(isOverMaxHeight)?maxHeight:"";that.scrollingElm.height(setHeight)};var scrollBottom=function(that){that.scrollingElm[0].scrollTop=that.scrollingElm[0].scrollHeight};var scrollTo=function(that,element){if(!element||element.length<1){return }var padTop=0;var padBottom=0;var elmPosTop=element[0].offsetTop;var elmHeight=element.height();var containerScrollTop=that.scrollingElm[0].scrollTop;var containerHeight=that.scrollingElm.height();if(that.options.padScroll){var prevElmHeight=element.prev().height();padTop=(prevElmHeight+elmHeight<=containerHeight)?prevElmHeight:0;var nextElmHeight=element.next().height();padBottom=(nextElmHeight+elmHeight<=containerHeight)?nextElmHeight:0}if((elmPosTop-padTop)<containerScrollTop){that.scrollingElm[0].scrollTop=elmPosTop-padTop}if(((elmPosTop+elmHeight)+padBottom)>(containerScrollTop+containerHeight)){elmHeight=(elmHeight<containerHeight)?elmHeight:containerHeight;that.scrollingElm[0].scrollTop=(elmPosTop-containerHeight+elmHeight+padBottom)}};var setupScroller=function(that){that.scrollingElm=that.container.parents(that.options.selectors.wrapper);if(!that.scrollingElm.length){fluid.fail({name:"Missing Scroller",message:"The scroller wrapper element was not found."})}if(!$.browser.msie||$.browser.version>6){that.scrollingElm.css("max-height",that.options.maxHeight)}};fluid.scroller=function(container,options){var that=fluid.initView("fluid.scroller",container,options);setupScroller(that);that.scrollTo=function(element){scrollTo(that,element)};that.scrollBottom=function(){scrollBottom(that)};that.refreshView=function(){if($.browser.msie&&$.browser.version<7){refreshView(that)}};that.refreshView();return that};fluid.defaults("fluid.scroller",{selectors:{wrapper:".flc-scroller"},maxHeight:180,padScroll:true})})(jQuery,fluid_1_1);