(function(){var e={};var l=null;var a=null;var n=null;var c=null;var p={};var g={color:"#ff0084",background:"#bbb",shadow:"#fff",fallback:false};var o=window.devicePixelRatio>1;var b=(function(){var q=navigator.userAgent.toLowerCase();return function(r){return q.indexOf(r)!==-1}}());var i={ie:b("msie"),chrome:b("chrome"),webkit:b("chrome")||b("safari"),safari:b("safari")&&!b("chrome"),mozilla:b("mozilla")&&!b("chrome")&&!b("safari")};var d=function(){var r=document.getElementsByTagName("link");for(var s=0,q=r.length;s0){t.beginPath();t.moveTo(r.width/2,r.height/2);t.arc(r.width/2,r.height/2,Math.min(r.width/2,r.height/2)-2,(-0.5)*Math.PI,(-0.5+2*q/100)*Math.PI,false);t.lineTo(r.width/2,r.height/2);t.fillStyle=p.color;t.fill()}h(r.toDataURL())}};if(!u.match(/^data/)){s.crossOrigin="anonymous"}s.src=u};var k=function(q){if(q>0){document.title="("+q+"%) "+n}else{document.title=n}};e.setOptions=function(r){p={};for(var q in g){p[q]=r.hasOwnProperty(q)?r[q]:g[q]}return this};e.setProgress=function(r){if(!n){n=document.title}if(!a||!l){var q=d();a=l=q?q.getAttribute("href"):"/favicon.ico"}if(!isNaN(parseFloat(r))&&isFinite(r)){if(!m().getContext||i.ie||i.safari||p.fallback===true){return k(r)}else{if(p.fallback==="force"){k(r)}}return j(r)}return false};e.reset=function(){if(n){document.title=n}if(a){l=a;h(l)}};e.setOptions(g);window.Piecon=e})();