(function(){tinymce.create('tinymce.plugins.AutoResizePlugin',{init:function(ed,url){var t=this,oldSize=0;if(ed.getParam('fullscreen_is_enabled'))
return;function resize(){var d=ed.getDoc(),b=d.body,de=d.documentElement,DOM=tinymce.DOM,resizeHeight=t.autoresize_min_height,myHeight;myHeight=tinymce.isIE?b.scrollHeight:d.body.offsetHeight;if(myHeight>t.autoresize_min_height)
resizeHeight=myHeight;if(t.autoresize_max_height&&myHeight>t.autoresize_max_height){resizeHeight=t.autoresize_max_height;ed.getBody().style.overflowY="auto";}else
ed.getBody().style.overflowY="hidden";if(resizeHeight!==oldSize){DOM.setStyle(DOM.get(ed.id+'_ifr'),'height',resizeHeight+'px');oldSize=resizeHeight;}
if(t.throbbing){ed.setProgressState(false);ed.setProgressState(true);}};t.editor=ed;t.autoresize_min_height=parseInt(ed.getParam('autoresize_min_height',ed.getElement().offsetHeight));t.autoresize_max_height=parseInt(ed.getParam('autoresize_max_height',0));ed.onInit.add(function(ed){ed.dom.setStyle(ed.getBody(),'paddingBottom',ed.getParam('autoresize_bottom_margin',50)+'px');});ed.onChange.add(resize);ed.onSetContent.add(resize);ed.onPaste.add(resize);ed.onKeyUp.add(resize);ed.onPostRender.add(resize);if(ed.getParam('autoresize_on_init',true)){ed.onInit.add(function(ed,l){ed.setProgressState(true);t.throbbing=true;ed.getBody().style.overflowY="hidden";});ed.onLoadContent.add(function(ed,l){resize();setTimeout(function(){resize();ed.setProgressState(false);t.throbbing=false;},1250);});}
ed.addCommand('mceAutoResize',resize);},getInfo:function(){return{longname:'Auto Resize',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('autoresize',tinymce.plugins.AutoResizePlugin);})();