(new TimerManager).addTimer(new Timer("bargain",config.cheap.delay,config.cheap.interval,function(){var n=JSON.parse($.ajax({url:config.urls.cheapNotice+encodeURIComponent(Storage.get("location")),async:!1}).responseText),t=Util.date.now(),i=parseInt(Storage.getWithDefault("lastCheapPopupTime","0"));n&&n.createTime*1e3>i&&!n.abandon&&n.expirationTime*1e3>t&&(Storage.set("showStage",{name:"bargainFound",data:n}),Storage.set("lastCheapPopupTime",t),Util.popup())}));(new TimerManager).addTimer(new Timer("flip",0,config.monitor.flip,function(){var n=document.getElementById("canvasWrap"),t=n.getContext("2d"),i=0,u=36,f=12,e=function(n){return(1-Math.sin(Math.PI/2+n*Math.PI))/2},o=function(){t.save();t.clearRect(0,0,n.width,n.height);t.translate(Math.ceil(n.width/2),Math.ceil(n.height/2));t.rotate(2*Math.PI*e(i));t.drawImage(document.getElementById("hasData"),-Math.ceil(n.width/2),-Math.ceil(n.height/2));t.restore();chrome.browserAction.setIcon({imageData:t.getImageData(0,0,n.width,n.height)})},r=function(){i+=1/u;o();i<=1?setTimeout(r,f):i=0};r()}))