var dir=0,warmup=0,MyLat=0,MyLon=0,locinf="Please enter your location",firstrun=true,srh=6,ssh=18,img=new Image,mask=new Image;mask.src="mask.png";var rotation=0,TimeX=new Date,TDT,iphone=navigator.userAgent.toLowerCase().search("ipod")>-1||navigator.userAgent.toLowerCase().search("iphone")>-1;
window.onload=function(){setTimeout("scrollad()",100);$("date").value=TimeX.format("yyyy.mm.dd");$("time").value=TimeX.format("HH:MM");console.log("Version 1.001");if(window.localStorage){if(localStorage.MyLat){MyLat=localStorage.MyLat;$("latitude").value=(1*MyLat).toFixed(2)}if(localStorage.MyLon){MyLon=localStorage.MyLon;$("longitude").value=(1*MyLon).toFixed(2)}if(localStorage.locinf)locinf=localStorage.locinf;if(localStorage.NSloc)$("location").innerHTML=localStorage.NSloc;if(!navigator.onLine){if(localStorage.NSDate)$("date").value=
localStorage.NSDate;if(localStorage.NSTime)$("time").value=localStorage.NSTime}}setTimeout("orient()",100);window.onorientationchange=orient;setTimeout("window.scrollTo(0, 1)",200);touch_init();if(!iphone){$("touch").style.opacity=0;$("touch").style.visibility="hidden";$("touch").style.zIndex=-5000}if(navigator.onLine)navigator.geolocation?gpsloc():iploc();else getstars();window.applicationCache&&window.applicationCache.addEventListener("updateready",updateCache,false)};
function updateCache(){console.log("Updating cache");window.applicationCache.swapCache();if(confirm("New version available.\nReload now to\nupdate cached webapp?"))document.location="index.html"}function touch_init(){$("stars").ontouchstart=onstart;$("stars").ontouchmove=onmove;$("stars").ontouchend=onend}var w=0;
function orient(){if(iphone)if(w!=document.body.offsetWidth){w=document.body.offsetWidth;$("stars").style.webkitTransitionDuration="0";$("stars").style.webkitTransform="rotate(0deg)";setTimeout('$("stars").style.webkitTransitionDuration = "1s"',200);rotation=0;$("stars").style.left=(document.body.offsetWidth-640)/2+"px";$("stars").style.top=0;scrollToBottom();setTimeout("orient()",1E3)}}var lastfx=0,startfx=0,topx=0,startleft=0,lastfy=0,startfy=0,topy=0,starttop=0,tapstart=0;
function onstart(a){startfx=a.touches[0].pageX;startfy=a.touches[0].pageY;lastfx=a.touches[0].pageX;lastfy=a.touches[0].pageY;a.preventDefault();startleft=a.target.offsetLeft;starttop=a.target.offsetTop;tapstart=(new Date).getTime()}
function onmove(a){a.preventDefault();lastfx=a.touches[0].pageX;lastfy=a.touches[0].pageY;topx=startleft+(lastfx-startfx);if(topx>0)topx=0;if(topx+640<document.body.offsetWidth)topx=document.body.offsetWidth-640;$("stars").style.left=topx+"px";topy=starttop+(lastfy-startfy);if(topy<0)topy=0;if(topy>640-window.innerHeight)topy=640-window.innerHeight;$("stars").style.top=topy+"px"}
function onend(){var a=(new Date).getTime();a=a-tapstart;if(a<400&&Math.abs(lastfx-startfx)+Math.abs(lastfy-startfy)<100)if(startfy>window.pageYOffset+window.innerHeight/2){if(startfx>window.innerWidth/2)rotation+=90;else rotation-=90;$("stars").style.webkitTransform="rotate("+rotation+"deg)";$("stars").style.left=(document.body.offsetWidth-640)/2+"px";$("stars").style.top=0;scrollToBottom()}else startfx>window.innerWidth/2?deltatime(1):deltatime(-1);else window.pageYOffset<420&&window.scrollTo(0,
740)}function deltatime(a){if(navigator.onLine){TDT+=a*0.0416666667;url="sky.php?lat="+MyLat+"&lon="+MyLon+"&TDT="+TDT;img.onload=sky;img.src=url;$("stars").style.opacity=0;a=new Date;a.setTime((TDT-40587)*864E5);$("date").value=a.format("yyyy.mm.dd");$("time").value=a.format("HH")+":00";bubble(150,10,100,100,$("time").value+"<br><br>"+$("date").value,1,0);if(window.localStorage){localStorage.NSDate=$("date").value;localStorage.NSTime=$("time").value}}else alert("Not available offline")}
function scrollToBottom(){if(warmup){document.body.offsetWidth>320?window.scrollTo(0,800):window.scrollTo(0,740);return true}return false}function gpsloc(){navigator.geolocation?navigator.geolocation.getCurrentPosition(showLocation,showError):alert("GPS is not available")}function showError(a){a.code==1?iploc():alert("Geolocation error: "+a.code+"\n"+a.message)}
function showLocation(a){MyLat=(Math.floor(1E5*a.coords.latitude)/1E5).toFixed(2);$("latitude").value=(1*MyLat).toFixed(2);MyLon=(Math.floor(1E5*a.coords.longitude)/1E5).toFixed(2);$("longitude").value=(1*MyLon).toFixed(2);locinf="GPS Location";getloc()}function iploc(){if(navigator.onLine){var a=new XMLHttpRequest;a.open("POST","loc.php?ip",true);a.onreadystatechange=receiveloc;a.send();locinf="IP address location"}}
function getloc(){var a=new XMLHttpRequest;a.open("POST","loc.php?lat="+MyLat+"&lon="+MyLon,true);a.onreadystatechange=receiveloc;a.send();locinf="GPS location"}
function receiveloc(){if(this.readyState==4)if(this.status==200){$("location").innerHTML=xml("loc",this.responseText);MyLat=xml("lat",this.responseText);$("latitude").value=(1*MyLat).toFixed(2);MyLon=xml("lon",this.responseText);$("longitude").value=(1*MyLon).toFixed(2);var a=xml("sunrise",this.responseText).substr(0,5);srh=a.substr(0,2);var b=xml("sunset",this.responseText).substr(0,5);ssh=(1*b.substr(0,2)+1)%24;$("location").innerHTML=xml("loc",this.responseText)+"<br>Sunrise: "+a+" &nbsp Sunset: "+
b;if(firstrun){a=parseInt($("time").value.substr(0,2),10);if(a>srh&&a<ssh)$("time").value=ssh.toFixed(2)+":00"}firstrun=false;getstars()}}function setloc(){MyLat=1*$("latitude").value;MyLon=1*$("longitude").value;if(MyLat<-90||MyLat>90)MyLat=0;if(MyLon<-180||MyLon>180)MyLon=0;$("location").innerHTML="";locinf="User entered location";getloc()}
function getstars(){if(!navigator.onLine&&localStorage.skygif.length>1E4)url=localStorage.skygif;else{var a=$("date").value,b=$("time").value;$("date").value=TimeX.format("yyyy.mm.dd");$("time").value=TimeX.format("HH:MM");a=new Date(a.substring(0,4),1*a.substring(5,7)-1,a.substring(8,10),b.substring(0,2),b.substring(3,5),0);$("date").value=a.format("yyyy.mm.dd");$("time").value=a.format("HH:MM");TDT=40587+a.getTime()/864E5;url="sky.php?lat="+MyLat+"&lon="+MyLon+"&TDT="+TDT;if(window.localStorage){localStorage.MyLat=
MyLat;localStorage.MyLon=MyLon;localStorage.locinf="Saved "+$("date").value;localStorage.NSDate=$("date").value;localStorage.NSTime=$("time").value;localStorage.NSloc=$("location").innerHTML}}img.onload=sky;img.src=url;scrollToBottom()&&bubble(150,10,100,100,$("time").value+"<br><br>"+$("date").value,1,0)}
function sky(){var a=$("stars").getContext("2d");a.clearRect(0,0,640,640);a.drawImage(img,0,0);if(navigator.onLine){a.drawImage(mask,0,0);a.setAlpha(0.5);a.setFillColor("#ffff00");a.setStrokeColor("#ffff00");a.beginPath();a.moveTo(300,320);a.lineTo(340,320);a.moveTo(320,340);a.lineTo(320,300);a.stroke();a.beginPath();a.moveTo(320,300);a.lineTo(317,305);a.lineTo(323,305);a.closePath();a.fill();a.stroke();a.moveTo(480,320);a.arc(320,320,160,0,6.28318531,true);a.stroke();a.setAlpha(1);CanvasTextFunctions.enable(a);
a.drawTextRight(0,12,150,605,$("latitude").value);a.drawTextRight(0,12,150,630,$("longitude").value);a.drawTextRight(0,12,540,630,$("date").value);a.drawTextRight(0,12,540,605,$("time").value)}$("touch").style.visibility="hidden";$("touch").style.zIndex=-500;$("stars").style.opacity=1;$("stars").style.zIndex=1E3;$("stars").style.webkitTransform="rotate(0deg)";$("stars").style.left=(document.body.offsetWidth-640)/2+"px";warmup=1;scrollToBottom();newimage=true;try{if(window.localStorage&&navigator.onLine){var b;
b=$("stars").toDataURL();localStorage.skygif=b;console.log("localStorage.skygif: "+b.length)}}catch(d){console.log("sky: "+d.message)}}function map(){document.location.href="http://maps.google.com?q="+MyLat+","+MyLon}function $(a){return document.getElementById(a)}function xml(a,b){a=new RegExp("<"+a+"[^>]*>(.*?)</"+a+">");return b=a.exec(b)[1]}
function canvasclick(){if(event.y>window.pageYOffset+window.innerHeight/2){if(event.x>window.pageXOffset+window.innerWidth/2)rotation+=90;else rotation-=90;$("stars").style.webkitTransform="rotate("+rotation+"deg)";$("stars").style.left=(document.body.offsetWidth-640)/2+"px";$("stars").style.top=0}else event.x>window.pageXOffset+window.innerWidth/2?deltatime(1):deltatime(-1)}function locinfo(){confirm(locinf+"\n\nSelect OK to check on map.")&&map()}
function bubble(a,b,d,e,c,f,k){$("bubble").style.top=a+window.pageYOffset;$("bubble").style.left=b+window.pageXOffset;$("bubble").style.width=e;if(k){$("bubble").innerHTML='<span class="point"></span>'+c;$("bubble").firstChild.style.top=d+10}else $("bubble").innerHTML=c;$("bubble").style.visibility="visible";$("bubble").style.opacity=0.9;$("bubble").style.zIndex=5E4;f&&setTimeout("hide_bubble()",3E3)}function hide_bubble(){$("bubble").style.opacity=0;setTimeout("hide_bubble2()",500)}
function hide_bubble2(){$("bubble").style.visibility="hidden";$("bubble").style.zIndex=-500}function scrollad(){if(navigator.onLine){newtop=++dir%2?60-$("adcontents").scrollHeight:-20;$("adcontents").style.top=newtop+"px"}else $("ad").style.opacity=0;setTimeout("scrollad()",35E3)}var CanvasTextFunctions={};
CanvasTextFunctions.letters={" ":{width:16,points:[]},"!":{width:10,points:[[5,21],[5,7],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},'"':{width:16,points:[[4,21],[4,14],[-1,-1],[12,21],[12,14]]},"#":{width:21,points:[[11,25],[4,-7],[-1,-1],[17,25],[10,-7],[-1,-1],[4,12],[18,12],[-1,-1],[3,6],[17,6]]},$:{width:20,points:[[8,25],[8,-4],[-1,-1],[12,25],[12,-4],[-1,-1],[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,
3]]},"%":{width:24,points:[[21,21],[3,0],[-1,-1],[8,21],[10,19],[10,17],[9,15],[7,14],[5,14],[3,16],[3,18],[4,20],[6,21],[8,21],[10,20],[13,19],[16,19],[19,20],[21,21],[-1,-1],[17,7],[15,6],[14,4],[14,2],[16,0],[18,0],[20,1],[21,3],[21,5],[19,7],[17,7]]},"&":{width:26,points:[[23,12],[23,13],[22,14],[21,14],[20,13],[19,11],[17,6],[15,3],[13,1],[11,0],[7,0],[5,1],[4,2],[3,4],[3,6],[4,8],[5,9],[12,13],[13,14],[14,16],[14,18],[13,20],[11,21],[9,20],[8,18],[8,16],[9,13],[11,10],[16,3],[18,1],[20,0],[22,
0],[23,1],[23,2]]},"'":{width:10,points:[[5,19],[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]]},"(":{width:14,points:[[11,25],[9,23],[7,20],[5,16],[4,11],[4,7],[5,2],[7,-2],[9,-5],[11,-7]]},")":{width:14,points:[[3,25],[5,23],[7,20],[9,16],[10,11],[10,7],[9,2],[7,-2],[5,-5],[3,-7]]},"*":{width:16,points:[[8,21],[8,9],[-1,-1],[3,18],[13,12],[-1,-1],[13,18],[3,12]]},"+":{width:26,points:[[13,18],[13,0],[-1,-1],[4,9],[22,9]]},",":{width:10,points:[[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"-":{width:26,
points:[[4,9],[22,9]]},".":{width:10,points:[[5,2],[4,1],[5,0],[6,1],[5,2]]},"/":{width:22,points:[[20,25],[2,-7]]},"0":{width:20,points:[[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]]},"1":{width:20,points:[[6,17],[8,18],[11,21],[11,0]]},"2":{width:20,points:[[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]]},"3":{width:20,points:[[5,21],[16,21],[10,13],[13,13],[15,12],
[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},"4":{width:20,points:[[13,21],[3,7],[18,7],[-1,-1],[13,21],[13,0]]},"5":{width:20,points:[[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},"6":{width:20,points:[[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]]},"7":{width:20,points:[[17,21],[7,
0],[-1,-1],[3,21],[17,21]]},"8":{width:20,points:[[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]]},"9":{width:20,points:[[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]]},":":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,
-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},",":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"<":{width:24,points:[[20,18],[4,9],[20,0]]},"=":{width:26,points:[[4,12],[22,12],[-1,-1],[4,6],[22,6]]},">":{width:24,points:[[4,18],[20,9],[4,0]]},"?":{width:18,points:[[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],[-1,-1],[9,2],[8,1],[9,0],[10,1],[9,2]]},"@":{width:27,points:[[18,13],[17,
15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],[-1,-1],[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],[-1,-1],[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],[-1,-1],[19,16],[18,8],[18,6],[19,5]]},A:{width:18,points:[[9,21],[1,0],[-1,-1],[9,21],[17,0],[-1,-1],[4,7],[14,7]]},B:{width:21,points:[[4,21],[4,0],[-1,
-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[-1,-1],[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]]},C:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]]},D:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]]},E:{width:19,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,
11],[12,11],[-1,-1],[4,0],[17,0]]},F:{width:18,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11]]},G:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8]]},H:{width:22,points:[[4,21],[4,0],[-1,-1],[18,21],[18,0],[-1,-1],[4,11],[18,11]]},I:{width:8,points:[[4,21],[4,0]]},J:{width:16,points:[[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]]},K:{width:21,
points:[[4,21],[4,0],[-1,-1],[18,21],[4,7],[-1,-1],[9,12],[18,0]]},L:{width:17,points:[[4,21],[4,0],[-1,-1],[4,0],[16,0]]},M:{width:24,points:[[4,21],[4,0],[-1,-1],[4,21],[12,0],[-1,-1],[20,21],[12,0],[-1,-1],[20,21],[20,0]]},N:{width:22,points:[[4,21],[4,0],[-1,-1],[4,21],[18,0],[-1,-1],[18,21],[18,0]]},O:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]]},P:{width:21,points:[[4,21],
[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]]},Q:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[12,4],[18,-2]]},R:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],[-1,-1],[11,11],[18,0]]},S:{width:20,points:[[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],
[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},T:{width:16,points:[[8,21],[8,0],[-1,-1],[1,21],[15,21]]},U:{width:22,points:[[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]]},V:{width:18,points:[[1,21],[9,0],[-1,-1],[17,21],[9,0]]},W:{width:24,points:[[2,21],[7,0],[-1,-1],[12,21],[7,0],[-1,-1],[12,21],[17,0],[-1,-1],[22,21],[17,0]]},X:{width:20,points:[[3,21],[17,0],[-1,-1],[17,21],[3,0]]},Y:{width:18,points:[[1,21],[9,11],[9,0],[-1,
-1],[17,21],[9,11]]},Z:{width:20,points:[[17,21],[3,0],[-1,-1],[3,21],[17,21],[-1,-1],[3,0],[17,0]]},"[":{width:14,points:[[4,25],[4,-7],[-1,-1],[5,25],[5,-7],[-1,-1],[4,25],[11,25],[-1,-1],[4,-7],[11,-7]]},"\\":{width:14,points:[[0,21],[14,-3]]},"]":{width:14,points:[[9,25],[9,-7],[-1,-1],[10,25],[10,-7],[-1,-1],[3,25],[10,25],[-1,-1],[3,-7],[10,-7]]},"^":{width:16,points:[[6,15],[8,18],[10,15],[-1,-1],[3,12],[8,17],[13,12],[-1,-1],[8,17],[8,0]]},_:{width:16,points:[[0,-2],[16,-2]]},"`":{width:10,
points:[[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]]},a:{width:19,points:[[15,14],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},b:{width:19,points:[[4,21],[4,0],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},c:{width:18,points:[[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},d:{width:19,points:[[15,21],[15,0],[-1,-1],
[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},e:{width:18,points:[[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},f:{width:12,points:[[10,21],[8,21],[6,20],[5,17],[5,0],[-1,-1],[2,14],[9,14]]},g:{width:19,points:[[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},h:{width:19,
points:[[4,21],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},i:{width:8,points:[[3,21],[4,20],[5,21],[4,22],[3,21],[-1,-1],[4,14],[4,0]]},j:{width:10,points:[[5,21],[6,20],[7,21],[6,22],[5,21],[-1,-1],[6,14],[6,-3],[5,-6],[3,-7],[1,-7]]},k:{width:17,points:[[4,21],[4,0],[-1,-1],[14,14],[4,4],[-1,-1],[8,8],[15,0]]},l:{width:8,points:[[4,21],[4,0]]},m:{width:30,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],[-1,-1],[15,10],[18,13],[20,14],[23,
14],[25,13],[26,10],[26,0]]},n:{width:19,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},o:{width:19,points:[[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]]},p:{width:19,points:[[4,14],[4,-7],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},q:{width:19,points:[[15,14],[15,-7],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,
6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},r:{width:13,points:[[4,14],[4,0],[-1,-1],[4,8],[5,11],[7,13],[9,14],[12,14]]},s:{width:17,points:[[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]]},t:{width:12,points:[[5,21],[5,4],[6,1],[8,0],[10,0],[-1,-1],[2,14],[9,14]]},u:{width:19,points:[[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0]]},v:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0]]},w:{width:22,points:[[3,
14],[7,0],[-1,-1],[11,14],[7,0],[-1,-1],[11,14],[15,0],[-1,-1],[19,14],[15,0]]},x:{width:17,points:[[3,14],[14,0],[-1,-1],[14,14],[3,0]]},y:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]]},z:{width:17,points:[[14,14],[3,0],[-1,-1],[3,14],[14,14],[-1,-1],[3,0],[14,0]]},"{":{width:14,points:[[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],
[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]]},"|":{width:8,points:[[4,25],[4,-7]]},"}":{width:14,points:[[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]]},"~":{width:24,points:[[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,
8],[21,10],[-1,-1],[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]]}};CanvasTextFunctions.letter=function(a){return CanvasTextFunctions.letters[a]};CanvasTextFunctions.ascent=function(a,b){return b};CanvasTextFunctions.descent=function(a,b){return 7*b/25};CanvasTextFunctions.measure=function(a,b,d){a=0;var e=d.length;for(i=0;i<e;i++){var c=CanvasTextFunctions.letter(d.charAt(i));if(c)a+=c.width*b/25}return a};
CanvasTextFunctions.draw=function(a,b,d,e,c,f){b=0;var k=f.length;d=d/25;a.save();a.lineCap="round";a.lineWidth=2*d;for(i=0;i<k;i++){var l=CanvasTextFunctions.letter(f.charAt(i));if(l){a.beginPath();var g=1;for(j=0;j<l.points.length;j++){var h=l.points[j];if(h[0]==-1&&h[1]==-1)g=1;else if(g){a.moveTo(e+h[0]*d,c-h[1]*d);g=false}else a.lineTo(e+h[0]*d,c-h[1]*d)}a.stroke();e+=l.width*d}}a.restore();return b};
CanvasTextFunctions.enable=function(a){a.drawText=function(b,d,e,c,f){return CanvasTextFunctions.draw(a,b,d,e,c,f)};a.measureText=function(b,d,e){return CanvasTextFunctions.measure(b,d,e)};a.fontAscent=function(b,d){return CanvasTextFunctions.ascent(b,d)};a.fontDescent=function(b,d){return CanvasTextFunctions.descent(b,d)};a.drawTextRight=function(b,d,e,c,f){var k=CanvasTextFunctions.measure(b,d,f);return CanvasTextFunctions.draw(a,b,d,e-k,c,f)};a.drawTextCenter=function(b,d,e,c,f){var k=CanvasTextFunctions.measure(b,
d,f);return CanvasTextFunctions.draw(a,b,d,e-k/2,c,f)}};
var dateFormat=function(){var a=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,b=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,d=/[^-+\dA-Z]/g,e=function(c,f){c=String(c);for(f=f||2;c.length<f;)c="0"+c;return c};return function(c,f,k){var l=dateFormat;if(arguments.length==1&&Object.prototype.toString.call(c)=="[object String]"&&!/\d/.test(c)){f=c;c=undefined}c=c?new Date(c):new Date;if(isNaN(c))throw SyntaxError("invalid date");
f=String(l.masks[f]||f||l.masks["default"]);if(f.slice(0,4)=="UTC:"){f=f.slice(4);k=true}var g=k?"getUTC":"get",h=c[g+"Date"](),q=c[g+"Day"](),n=c[g+"Month"](),r=c[g+"FullYear"](),m=c[g+"Hours"](),s=c[g+"Minutes"](),t=c[g+"Seconds"]();g=c[g+"Milliseconds"]();var p=k?0:c.getTimezoneOffset(),u={d:h,dd:e(h),ddd:l.i18n.dayNames[q],dddd:l.i18n.dayNames[q+7],m:n+1,mm:e(n+1),mmm:l.i18n.monthNames[n],mmmm:l.i18n.monthNames[n+12],yy:String(r).slice(2),yyyy:r,h:m%12||12,hh:e(m%12||12),H:m,HH:e(m),M:s,MM:e(s),
s:t,ss:e(t),l:e(g,3),L:e(g>99?Math.round(g/10):g),t:m<12?"a":"p",tt:m<12?"am":"pm",T:m<12?"A":"P",TT:m<12?"AM":"PM",Z:k?"UTC":(String(c).match(b)||[""]).pop().replace(d,""),o:(p>0?"-":"+")+e(Math.floor(Math.abs(p)/60)*100+Math.abs(p)%60,4),S:["th","st","nd","rd"][h%10>3?0:(h%100-h%10!=10)*h%10]};return f.replace(a,function(o){return o in u?u[o]:o.slice(1,o.length-1)})}}();
dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};
dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(a,b){return dateFormat(this,a,b)};