(function($){$.fn.bounce=function(sConfig){var opts=$.fn.bounce.opts;if(typeof(sConfig)!='undefined'){if(typeof(sConfig.bounceclass)!='undefined'){opts.bounceclass=sConfig.bounceclass}if(typeof(sConfig.min)!='undefined'){opts.iMin=sConfig.min}if(typeof(sConfig.max)!='undefined'){opts.iMax=sConfig.max}if(typeof(sConfig.bottom)!='undefined'){opts.bBottom=sConfig.bottom}if(typeof(sConfig.string)!='undefined'){opts.clickstring=sConfig.string}if(typeof(sConfig.open)!='undefined'){opts.bAllopen=sConfig.open}}return this.each(function(){var temp_tfx=wrapText(this,opts.bounceclass);if(!opts.bBottom){temp_tfx.innerHTML=opts.clickstring+temp_tfx.innerHTML}else{temp_tfx.innerHTML+=opts.clickstring}var tfx={};tfx.elem=temp_tfx;tfx.elem.running=false;tfx.elem.jq=$(temp_tfx);tfx.elem.textarea=temp_tfx.childNodes;if(tfx.elem.textarea.length){if(!opts.bBottom){tfx.elem.textarea=tfx.elem.textarea[1]}else{tfx.elem.textarea=tfx.elem.textarea[0]}}else{return false}tfx.elem.textarea.jq=$(tfx.elem.textarea);tfx.elem.textarea.style.display='none';tfx.elem.bOpen=false;tfx.elem.style.height=opts.iMin+'px';tfx.elem.style.display='block';tfx.elem.jq.click(BounceEvent);tfx.elem.textarea.jq.click(function(ev){ev.cancelBubble=true;return false});opts.aBouncers.push(tfx.elem);if(opts.bAllopen){$.fn.bounceOpen(iTemps+1)}})};$.fn.bounce.opts={iMin:113,iMax:370,iDuration:1500,bounceclass:'mybounce',bBottom:true,bAllopen:false,aBouncers:new Array,clickstring:'&nbsp;',aTop:new Array};function wrapText(cThis,sClass){if(!cThis){return false}var oParent=cThis.parentNode;var oWrap=document.createElement('div');if(typeof(sClass)!='undefined'){oWrap.className=sClass}oWrap.appendChild(cThis.cloneNode(true));oParent.insertBefore(oWrap,cThis);oParent.removeChild(cThis);cThis=oWrap;oWrap=null;oParent=null;return cThis};function BounceEvent(){var opts=$.fn.bounce.opts;if(this.running){return false}if(this.bOpen){this.bOpen=false;$(this).height(opts.iMin);this.textarea.style.display='none';this.running=false}else{this.running=true;this.bOpen=true;this.textarea.style.display='block';var keep_this=this;$(this).animate({height:opts.iMax},{duration:opts.iDuration,easing:'easeOutElastic'});window.setTimeout(function(){keep_this.running=false},1500)}};$.fn.bounceOpen=function(){var opts=$.fn.bounce.opts;for(var iTemps=0;iTemps<arguments.length;iTemps++){var iBouncer=arguments[iTemps];if((iBouncer>0)&&(iBouncer<=opts.aBouncers.length)){var oThis=opts.aBouncers[iBouncer-1];if(!oThis.bOpen){oThis.textarea.style.display='block';oThis.bOpen=true;$(oThis).height(opts.iMax)}oThis=null}}}})(jQuery);