(function(){varc=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){functione(i,j){if(j.keyCode===9){returna.cancel(j)}}functionh(l,p){varj,m,o,n,k;functionq(t){n=c.select(":input:enabled,*[tabindex]:not(iframe)");functions(v){returnv.nodeName==="BODY"||(v.type!="hidden"&&!(v.style.display=="none")&&!(v.style.visibility=="hidden")&&s(v.parentNode))}functioni(v){returnv.attributes.tabIndex.specified||v.nodeName=="INPUT"||v.nodeName=="TEXTAREA"}functionu(){returntinymce.isIE6||tinymce.isIE7}functionr(v){return((!u()||i(v)))&&v.getAttribute("tabindex")!="-1"&&s(v)}d(n,function(w,v){if(w.id==l.id){j=v;returnfalse}});if(t>0){for(m=j+1;m<n.length;m++){if(r(n[m])){returnn[m]}}}else{for(m=j-1;m>=0;m--){if(r(n[m])){returnn[m]}}}returnnull}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}returna.cancel(p)}}}f.onKeyUp.add(e);f.onKeyDown.add(h);if(tinymce.isGecko){f.onKeyPress.add(e)}},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)})();