(function(){var a=document.createElement("input"),c=document.createElement("span");var b=function(){this.N=a.cloneNode(1);this.T=a.cloneNode(1);this.N.setAttribute("size",6);this.T.setAttribute("size",1);this.M=c.cloneNode(1);var d=this;this.N.onkeyup=function(){var j=0,l=d.N.value,g=l.length,e=g;for(var f=0;f<e;f++){var h=parseInt(l.charAt(f));if(!h){j+=9;g--}else{j+=h}}j=parseInt((j/g)*100)/100;setTimeout(function(){d.M.innerHTML=" "+j},10);if(d.T.value){setTimeout(function(){d.T.onkeyup()},10)}};this.T.onkeyup=function(){var e=d.T.value||"0";if(e=="0"){d.N.onkeyup()}else{var f=parseFloat(d.M.innerHTML);f=(3*f+parseInt(e))/4;f=parseInt(f*100)/100;setTimeout(function(){d.M.innerHTML=" "+f},10)}}};(function(){var d=new b();var f=document.createElement("p");f.style.backgroundColor="#448";f.style.color="#FFF";f.style.fontWeight="bold";f.style.fontSize="12px";f.style.width="220px";var e=c.cloneNode(1);e.innerHTML="Note";f.appendChild(e);f.appendChild(d.N);e=c.cloneNode(1);e.innerHTML="Teza";f.appendChild(e);f.appendChild(d.T);f.appendChild(d.M);document.getElementById("bookml").appendChild(f)})()})();
