/*!
Grab Bag - Assorted Detritus
  (c) 2008 Jason Frame (jason@onehackoranother.com)
  Released under The MIT License.
 */
function wbAutogrowInit(){$("textarea.autoresize").filter(function(){return $(this).data("wbAutogrowInit")?!1:!0}).data("wbAutogrowInit",!0).css("resize","none").autogrow()}jQuery().ready(function(){$.fn.autogrow=function(){return this.filter("textarea").each(function(){var n=$(this),r=n.data("min-height")||n.data("height")||n.height(),u=parseInt(n.css("paddingLeft"))-parseInt(n.css("paddingRight")),i=$(document.createElement("div")).css({position:"absolute",wordWrap:"break-word",top:-1e4,left:-1e4,fontSize:n.css("fontSize"),fontFamily:n.css("fontFamily"),lineHeight:n.css("lineHeight"),resize:"none",pointerEvents:"none",visibility:"hidden"}).appendTo(document.body),t=function(){var f=function(n,t){for(var i=0,r="";i<t;i++)r+=n;return r},e=n[0].value.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&/g,"&amp;").replace(/\n$/,"<br/>&nbsp;").replace(/\n/g,"<br/>").replace(/ {2,}/g,function(n){return f("&nbsp;",n.length-1)+" "}),t;i.css("width",n.width()-u).html(e);t=Math.max(i.height()+40,r);n.css({height:t}).css("overflow","hidden")};n.change(t).keyup(t).keydown(t);clWDUtil.AttacheOnScrollResize(function(i,r){r||(clWDUtil.bEstDisplay(n[0],document,!1)?t.apply(n[0],[i,!1]):setTimeout(function(){t.apply(n[0],[i,!0])},1))});t.apply(this,[undefined,!0])}),this};wbAutogrowInit();window.clWDUtil!==undefined&&(clWDUtil.m_oNotificationsAjoutHTML&&clWDUtil.m_oNotificationsAjoutHTML.AddNotification(wbAutogrowInit),clWDUtil.m_oNotificationsFinAJAX&&clWDUtil.m_oNotificationsFinAJAX.AddNotification(wbAutogrowInit))})