!function(){var e=tinymce.DOM,n=tinymce.dom.Event,t=tinymce.each,i=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(o,c){function u(e,t){if(9===t.keyCode)return n.cancel(t)}function r(o,c){var u,r,a,d;function s(n){function i(e){return"BODY"===e.nodeName||"hidden"!=e.type&&!("none"==e.style.display)&&!("hidden"==e.style.visibility)&&i(e.parentNode)}function c(e){return(!(tinymce.isIE6||tinymce.isIE7)||function(e){return e.attributes.tabIndex.specified||"INPUT"==e.nodeName||"TEXTAREA"==e.nodeName}(e))&&"-1"!=e.getAttribute("tabindex")&&i(e)}if(a=e.select(":input:enabled,*[tabindex]:not(iframe)"),t(a,(function(e,n){if(e.id==o.id)return u=n,!1})),n>0){for(r=u+1;r<a.length;r++)if(c(a[r]))return a[r]}else for(r=u-1;r>=0;r--)if(c(a[r]))return a[r];return null}if(9===c.keyCode&&(1==(d=i(o.getParam("tab_focus",o.getParam("tabfocus_elements",":prev,:next")))).length&&(d[1]=d[0],d[0]=":prev"),a=c.shiftKey?":prev"==d[0]?s(-1):e.get(d[0]):":next"==d[1]?s(1):e.get(d[1])))return a.id&&(o=tinymce.get(a.id||a.name))?o.focus():window.setTimeout((function(){tinymce.isWebKit||window.focus(),a.focus()}),10),n.cancel(c)}o.onKeyUp.add(u),tinymce.isGecko?(o.onKeyPress.add(r),o.onKeyDown.add(u)):o.onKeyDown.add(r)},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}}),tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)}();
