tmp=function(){var k,q,g,j,l,b,p,c,n,d,m,o,h,a,f;q="MediaTag";k=Core.lang.getLocalizer(q);g=Core.log.getLogger(q);j=kbook.model;l=j.container.root;b=kbook.model.container.sandbox.MENU_GROUP.sandbox.MENU;p=5;c="mark1";n=Fskin.kbookMenu.draw;m=function(J){var B,A,K,F,I,G,D,u,v,C,L,E,H,s,z,t,r;n.apply(this,arguments);try{if(this.width>this.height){return;}r=this.countRecords();z=this.offset;t=this.tabCount;u=this.getWindow();v=l.cutouts.markIcon;C=v.width;L=v.height;E=5;for(K=z,F=Math.min(z+t,r);K<F;K++){s=this.getRecord(K);if(s&&s.media&&s.media.mark1!==undefined){D=K-z;A=70+70*D;H=s.media.mark1.split(" ");switch(d.options.position){case"bottom":B=70;for(I=0,G=H.length;I<G;I++){v.draw(u,H[I],0,B+C*I,A+70-L-E,C,L);}break;case"right":B=600-70;for(I=H.length-1;I>=0;I--){v.draw(u,H[I],0,B-C*(H.length-I),A+E,C,L);}break;case"overIcon":B=70-C;for(I=0,G=H.length;I<G;I++){v.draw(u,H[I],0,B,A+(L-2)*I+E,C,L);}break;}}}}catch(M){g.error("draw",M);}};o=function(){Fskin.kbookMenu.draw=m;};d={name:q,title:k("TITLE"),icon:"BACK",onInit:o,optionDefs:[{name:"position",title:k("OPTION_POSITION"),defaultValue:"bottom",icon:"LIST",values:["overIcon","bottom","right"],valueTitles:{overIcon:k("VALUE_OVER_ICON"),bottom:k("VALUE_BOTTOM"),right:k("VALUE_RIGHT")}}]};a=function(x,u){var t,r,v,s;try{r=x[c];if(r!==undefined){t=r.split(" ");v=false;for(s=t.length-1;s>=0;s--){t[s]=Number(t[s]);if(t[s]===u){t.splice(s,1);v=true;}}if(!v){t.push(u);}if(t.length>0){t.sort();x[c]=t.join(" ");}else{delete x[c];}}else{x[c]=""+u;}}catch(w){Core.ui.doBlink();}};f=function(){var r,i;if(j.current&&j.current&&j.current.nodes&&j.current.nodes[b.selection]){if(j.current.nodes[b.selection].media){r=j.current.nodes[b.selection].media;i=this.tag;a(r,i);b.invalidateSelection();}}else{Core.ui.doBlink();}};d.actions=[];for(h=0;h<p;h++){d.actions.push({name:"mark"+h,tag:h,title:k("MARK_"+h),icon:"BACK",action:f});}Core.addAddon(d);};try{tmp();}catch(e){log.error("in MediaTag.js",e);}