// Generated by CoffeeScript 1.6.1
(function(){var e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q,R,U,z,W,X,V,$,J,K,Q,G,Y,Z,et,tt,nt,rt,it,st,ot,ut,at,ft,lt,ct,ht,pt,dt,vt,mt,gt,yt,bt,wt,Et,St,xt,Tt,Nt,Ct,kt,Lt;v=[],R=0,wt=function(e){var t,n,r,i,s;e===0&&(e=65535),t=0,v=[],s=[];for(r=0,i=data.length;r<i;r++)n=data[r],s.push(function(n){return n[3]=!1,e&1<<t&&(v.push(n),n[3]=!0),t+=1}(n));return s},Z=function(){var e,t,n,r,i,s;e=0,n=0,r=function(t){return t[3]&&(n+=1<<e),e+=1};for(i=0,s=data.length;i<s;i++)t=data[i],r(t);return n.toString(36)},C=function(){var e,t,n;t=new Date,e=t.getDate(),n=t.getUTCDate();if(n===e)return 0;if(n===e+1||n===1)return 1440;if(n===e-1)return-1440},z={},rt=function(){var e,t,n;return n=new Date,e=n.getUTCHours()*60+n.getUTCMinutes(),t=e-720+C(),z={date:n,offset:t,cities:65535}},rt(),Tt=function(){var e,t,n,r,i;if(location.hash==="")return;return i=location.hash.slice(1).split(","),n=i[0],r=i[1],t=i[2],e=n.split("-"),z.date=new Date(e[0],e[1]-1,e[2]),z.offset=parseInt(r),z.cities=parseInt(t,36)},navigator.standalone==null&&!navigator.standalone&&Tt(),wt(z.cities),R=z.offset,M=!1,e=function(e){return document.getElementById(e)},A=function(t,n){return n==null&&(n=""),(e(t)||t).innerHTML=n},b=function(t,n){return(e(t)||t).style.cssText+=";"+n},bt=navigator.userAgent,_=bt.match(/(iPhone\sOS)\s([\d_]+)/)||bt.match(/(iPad\sOS)\s([\d_]+)/),kt=bt.indexOf("AppleWebKit/")>-1,q=bt.indexOf("Gecko")>-1&&!kt,U=bt.indexOf("Opera")>-1,O=bt.indexOf("MSIE")>-1,d=bt.indexOf("Chrome")>-1,n=bt.match(/(Android)\s+([\d.]+)/)&&kt,r=bt.match(/(Android)\s+4([\d.]+)/)&&kt,mt=kt?"webkitTransform":O?"msTransform":q?"MozTransform":U?"OTransform":"transform",gt=kt?"-webkit-transform":O?"-ms-transform":q?"-moz-transform":U?"-o-transform":void 0,dt=kt?"-webkit-transition":O?"-ms-transition":q?"-moz-transition":U?"-o-transition":void 0,i=function(e,t,n,r){return n==null&&(n=1),r==null&&(r=.5),b(e,""+dt+":all "+r+"s; "+gt+":    "+t+"; opacity:"+n)},vt=function(t,n,r){r==null&&(r=!1);if(isNaN(n))return;return t=e(t),r&&(t.style.cssText+=";"+dt+":all 0.4s;"),t.style[mt]=kt&&ot?"translate3d("+n+"px,0,0)":"translate3d("+n+"px,0,0)"},ft="left",F="January February March April May June July August September October November December".split(" "),Date.prototype.addDays=function(e){return new Date(this.getTime()+e*1e3*60*60*24)},Function.prototype.delay=function(e){return setTimeout(this,e*1e3)},ot=document.createTouch!=null,W=window.devicePixelRatio||1,f=e("body"),p=e("canvas"),y=p.getContext("2d"),W>1&&(y.webkitBackingStorePixelRatio||1)>1&&(W=1),Lt=L=a=u=G=D=null,E=t=B=Q=lt=l=null,w=j=ut=null,o=at=null,y.save(),ot&&(f.className="supports-touch"),d&&(f.className="chrome"),_&&(f.className="supports-touch with-initial-animation"),tt=function(e,t,n){return e.setAttribute("width",t*W),e.setAttribute("height",n*W),b(e,"height:"+n+"px; width:"+t+"px")},it=function(){var t,r,i,s;i=function(){var t,n,r,i,s,o;i=e("select_timezones"),t=-1;for(s=0,o=data.length;s<o;s++)n=data[s],r=n[1],n[2]!==""&&(r+=" "+n[2]),i.appendChild(new Option(r,t+=1,!1,n[3]));return i.onchange=function(){var e,t,n,r,s,o;e=0,n=0,r=function(t){return i.options[e].selected&&(n+=1<<e),e+=1};for(s=0,o=data.length;s<o;s++)t=data[s],r(t);return wt(n),$(),Ct()}},s=function(e){return document.adoptNode((new DOMParser).parseFromString(e,"text/xml").firstChild)},t=function(e){var t;return t='  <svg class="action" width="12px" height="10px" viewBox="0 0 12 10" version="1.1" xmlns="http://www.w3.org/2000/svg">\n<g><path d="M12,3.5L8,0v2.25c0,0-5,0.75-5,5C4.5,5,8,4.75,8,4.75V7L12,3.5z"/></g>\n<g><polygon points="10,7 9,8 9,9 1,9 1,3 3.5,3 4.5,2 0,2 0,10 10,10"/></g>\n</svg>',e.appendChild(s(t))},r=function(e){var t;return t='      <svg class="action" width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg">\n        <path fill="#FFFFFF" d="M23.077,10.154h-1.106c-0.508,0-1.047-0.397-1.198-0.883l-0.636-1.545c-0.239-0.447-0.141-1.107,0.216-1.467\nl0.788-0.785c0.359-0.359,0.359-0.947,0-1.307l-1.309-1.305c-0.358-0.359-0.945-0.359-1.305,0l-0.788,0.785\nc-0.356,0.358-1.019,0.457-1.467,0.217l-1.543-0.637c-0.483-0.149-0.881-0.688-0.881-1.197V0.924C13.849,0.417,13.432,0,12.924,0\nh-1.847c-0.508,0-0.924,0.417-0.924,0.924v1.107c0,0.509-0.396,1.048-0.881,1.197L7.728,3.865c-0.449,0.24-1.106,0.143-1.466-0.217\nL5.474,2.863c-0.359-0.359-0.945-0.359-1.304,0L2.864,4.168c-0.36,0.359-0.36,0.947,0,1.307L3.647,6.26\nc0.36,0.359,0.459,1.02,0.217,1.467L3.229,9.273c-0.152,0.484-0.688,0.881-1.197,0.881H0.924C0.416,10.154,0,10.568,0,11.077v1.846\nc0,0.509,0.416,0.925,0.924,0.925h1.108c0.509,0,1.045,0.396,1.195,0.881l0.637,1.547c0.241,0.447,0.144,1.109-0.217,1.467\nl-0.785,0.785c-0.358,0.359-0.358,0.947,0,1.307l1.308,1.307c0.358,0.357,0.944,0.357,1.304,0l0.788-0.787\nc0.357-0.357,1.017-0.455,1.462-0.213l1.549,0.635c0.485,0.152,0.881,0.689,0.881,1.197v1.105c0,0.506,0.416,0.922,0.924,0.922\nh1.847c0.508,0,0.925-0.416,0.925-0.922v-1.105c0-0.508,0.397-1.045,0.881-1.197l1.548-0.635c0.446-0.242,1.107-0.145,1.467,0.213\nl0.783,0.787c0.359,0.357,0.946,0.357,1.305,0l1.309-1.307c0.359-0.359,0.359-0.947,0-1.307l-0.788-0.785\nc-0.356-0.357-0.455-1.02-0.216-1.467l0.636-1.547c0.151-0.484,0.693-0.881,1.198-0.881h1.106c0.509,0,0.923-0.414,0.923-0.923\nv-1.848C24,10.568,23.586,10.154,23.077,10.154 M16.619,11.999c0,2.55-2.066,4.614-4.615,4.614c-2.552,0-4.617-2.064-4.617-4.614\nc0-2.549,2.065-4.615,4.617-4.615C14.553,7.384,16.619,9.45,16.619,11.999"/>\n      </svg>',e.appendChild(s(t))},t(e("action_icon")),r(e("edit_icon")),navigator.standalone&&(f.className+=" standalone"),i();if(!ot)return A("shortcut_link","link to this page");A("shortcut_link","tap &amp; hold to share");if(n)return e("tap_to_add").style.display="none"},st=function(){var e,n,r,i,s,o,f,c,h,p;E=y.createLinearGradient(0,0,a*W,0),t=y.createLinearGradient(0,0,a*W,0),B=y.createLinearGradient(0,0,a*W,0),Q=y.createLinearGradient(0,0,0,u*W),lt=y.createLinearGradient(0,0,0,u*W),l=y.createLinearGradient(0,u*W,0,0),c=[[0,"#4b4c4d"],[.2499,"#4b4c4d"],[.25,"#575b5c"],[.3299,"#575b5c"],[.33,"#6b7071"],[.7499,"#6b7071"],[.75,"#575b5c"],[.9099,"#575b5c"],[.91,"#4b4c4d"],[1,"#4b4c4d"]];for(n=0,s=c.length;n<s;n++)e=c[n],E.addColorStop(e[0],e[1]);h=[[0,"#5485b1"],[.2499,"#5485b1"],[.25,"#3cafc5"],[.3299,"#3cafc5"],[.33,"#55c8e4"],[.7499,"#55c8e4"],[.75,"#3cafc5"],[.9099,"#3cafc5"],[.91,"#5485b1"],[1,"#5485b1"]];for(r=0,o=h.length;r<o;r++)e=h[r],t.addColorStop(e[0],e[1]);p=[[0,"#8abb29"],[.2499,"#8abb29"],[.25,"#a5df3b"],[.3299,"#a5df3b"],[.33,"#b8ff41"],[.7499,"#b8ff41"],[.75,"#a5df3b"],[.9099,"#a5df3b"],[.91,"#8abb29"],[1,"#8abb29"]];for(i=0,f=p.length;i<f;i++)e=p[i],B.addColorStop(e[0],e[1]);return Q.addColorStop(0,"rgba(0,0,0,0)"),Q.addColorStop(1,"rgba(0,0,0,0.4)"),lt.addColorStop(0,"rgba(255,255,255,0.3)"),lt.addColorStop(.025,"rgba(255,255,255,0)"),l.addColorStop(0,"rgba(255,255,255,0.3)"),l.addColorStop(.025,"rgba(255,255,255,0)")},K=function(e,t,n,r){return r==null&&(r=y),r.beginPath(),r.moveTo(n,0),r.lineTo(e-n,0),r.quadraticCurveTo(e,0,e,n),r.lineTo(e,t-n),r.quadraticCurveTo(e,t,e-n,t),r.lineTo(n,t),r.quadraticCurveTo(0,t,0,t-n),r.lineTo(0,n),r.quadraticCurveTo(0,0,n,0),r.fill()},c={},x=function(e,n,r){var i,s,o,f,h;return r==null&&(r=E),r===E&&(o="default"),r===t&&(o="active"),r===B&&(o="local"),c[o]||(i=document.createElement("canvas"),tt(i,a*W,u*W),s=i.getContext("2d"),h=(a-2)*W,f=u*W,s.fillStyle=r,s.clearRect(0,0,h,f),K(h,f,f/2.5,s),s.fillStyle=Q,K(h,f,f/2.5,s),s.fillStyle=lt,K(h,f,f/2.5,s),s.fillStyle=l,K(h,f,f/2.5,s),c[o]=i),y.clearRect(e,n,a,u),y.drawImage(c[o],e,n,a*W,u*W)},nt=function(e){return e==null&&(e=z.date),w=e,j=-(w.getTimezoneOffset()/60),ut=w.getUTCHours()*60+w.getUTCMinutes()},X=function(){var e;return e=[window.innerWidth,v.length*60+350],Lt=e[0],L=e[1],a=Lt/3,Lt>480&&(L-=100),G=60,u=24,D=Lt/2-a*3/2,tt(p,Lt,L),y.restore(),y.save(),y.scale(W,W),y.clearRect(0,0,Lt,L),b("header","width:"+a*3+"px;left:"+(Lt/2-a*3/2)+"px"),b("line","height:"+(L-82-100)+"px"),b("cline","height:"+(L-82-100)+"px"),b("wrapper","height:"+L+"px")},k=function(e,n){var r;return r=n+12,r>=0&&r<24?e===j?B:t:E},V=function(){var t,n,r,i,s,u,f,l,c,h,p,d,m,g;l=115,i=0,t=Lt/2-a/2,f="",r="",s="",o=[],at=[],c=function(e){var n,u;return n=-e[0]/24*a,u=i*G+l,o.push([{left:n+t-a*2,top:u+20,gradient:k(e[0],e[0]+48+R/60)},{left:n+t-a,top:u+20,gradient:k(e[0],e[0]+24+R/60)},{left:n+t,top:u+20,gradient:k(e[0],e[0]+R/60)},{left:n+t+a,top:u+20,gradient:k(e[0],e[0]-24+R/60)},{left:n+t+a*2,top:u+20,gradient:k(e[0],e[0]-48+R/60)}]),at.push({offset:e[0]}),x(o[i][1].left,o[i][1].top,o[i][1].gradient),x(o[i][2].left,o[i][2].top,o[i][2].gradient),x(o[i][3].left,o[i][3].top,o[i][3].gradient),f+="<div style='left:"+D+"px;top:"+(u-2)+"px'>"+e[1]+" <small>"+e[2]+"</small></div>",s+="<div id='time_"+i+"' style='top:"+(u-2)+"px'></div>",r+="<div style='left:"+o[i][1].left+"px;top:"+o[i][1].top+"px;width:"+a+"px'>\n  "+T(w.addDays(-1))+"\n</div>\n<div style='left:"+o[i][2].left+"px;top:"+o[i][2].top+"px;width:"+a+"px'>\n  "+T(w.addDays(0))+"\n</div>\n<div style='left:"+o[i][3].left+"px;top:"+o[i][3].top+"px;width:"+a+"px'>\n  "+T(w.addDays(1))+"\n</div>",i+=1};for(h=0,d=v.length;h<d;h++)n=v[h],c(n);A("timezones",f),A("dates",r),A("times",s),i=0,g=[];for(p=0,m=at.length;p<m;p++)u=at[p],g.push(function(t){return t.timeEl=e("time_"+i),i+=1}(u));return g},J=function(){var e,t,n,r,i;t=0,i=[];for(n=0,r=v.length;n<r;n++)e=v[n],i.push(function(e){var n,r,i,s,u,a;return n=o[t],r=k(e[0],e[0]+48+R/60),i=k(e[0],e[0]+24+R/60),s=k(e[0],e[0]+R/60),u=k(e[0],e[0]-24+R/60),a=k(e[0],e[0]-48+R/60),n[1].gradient!==i&&x(n[1].left,n[1].top,n[1].gradient=i),n[2].gradient!==s&&x(n[2].left,n[2].top,n[2].gradient=s),n[3].gradient!==u&&x(n[3].left,n[3].top,n[3].gradient=u),t+=1}(e));return i},$=function(){return c={},X(),st(),V(),J(),Nt(),Et()},window.onorientationchange=$,window.onresize=$,S=!1,T=function(e){return""+F[e.getMonth()]+" "+e.getDate()},N=function(e){var t,n,r;return e<0&&(e=24-Math.abs(e%24)),e>=24&&(e%=24),t=Math.abs(e*60%60|0),t<10&&(t="0"+t),e|=0,n="am",e>=12&&(r=[e%12,"pm"],e=r[0],n=r[1]),e===0&&(e=12),""+e+":"+t+" "+n},Et=function(e){var t,n,r,i,s,o;i=new Date,o=C(),t=i.getUTCHours()*60+i.getUTCMinutes(),n=t-720+o,r=-(i.getTimezoneOffset()/60),s=Lt/2+n/60/24*a,b("cnow","left:"+s+"px"),A("clocaltime",N(n/60+j+12));if(e)return b("now","left:"+s+"px"),A("localtime",N(n/60+j+12))},xt=null,St=function(e){var t,n,r,i;if(!e&&xt===R)return;xt=R,A("localtime",N(R/60+12+j)),i=[];for(n=0,r=at.length;n<r;n++)t=at[n],i.push(function(e){return e.timeEl.innerHTML=N(R/60+12+e.offset)}(t));return i},et=function(){return""+w.getFullYear()+"-"+(w.getMonth()+1)+"-"+w.getDate()+","+R+","+Z()},Nt=function(e){var t,n;e==null&&(e=R),t=Lt/2+e/60/24*a,b("now","left:"+t+"px"),n=t,t>Lt-100&&(n-=85),b("times","left:"+n+"px"),t<200&&ft==="left"&&(vt("timezones",Lt-(Lt<=480?120:200),!0),ft="right");if(t>Lt-(Lt<=480?200:300)&&ft==="right")return vt("timezones",0,!0),ft="left"},Ct=function(){var t;return t=et(),M=!0,location.hash=t,e("shortcut_link").setAttribute("href","http://everytimezone.com/#"+t)},ht=pt=-1,P=H=-1,ct=Y=-1,h=!1,I=function(e){var t,r;if(!S)return;r=e.pageX,e.touches!=null&&(r=P),r<50&&(r=50),r>Lt-50&&(r=Lt-50),R=Math.round((r-Lt/2)/a*24*60),t=R,R-=R%15,J(),Nt(t),n||St();if(e.touches!=null)return e.preventDefault()},key("left",function(){R-=15,R-=R%15,J(),Nt();if(!n)return St()}),key("right",function(){R+=15,R-=R%15,J(),Nt();if(!n)return St()}),f[ot?"ontouchstart":"onmousedown"]=function(e){var t,n;t=e.target,t.nodeType!==1&&(t=t.parentNode);if(t.tagName==null||(n=t.tagName)!=="A"&&n!=="IMG"&&n!=="SELECT"&&n!=="INPUT"){if(e.touches!=null){Y=document.body.scrollTop,ct=Date.now(),ht=P=e.touches[0].pageX,pt=H=e.touches[0].pageY;if(e.touches[0].pageY<50)return}return S=!0}return},f[ot?"ontouchmove":"onmousemove"]=function(e){var t;if(e.touches!=null){P=e.touches[0].pageX,H=e.touches[0].pageY;if(!!h||document.body.scrollTop!==Y){h=!0;return}if(Date.now()-ct<50)return;if(-10<(t=ht-P)&&t<10)return}return I(e)},f[ot?"ontouchend":"onmouseup"]=function(e){return ot?!h&&Y===document.body.scrollTop&&I(e):I(e),ht=pt=P=H=ct=Y=-1,h=!1,S=!1,Ct()},e("footer").onclick=function(){return location.href="http://letsfreckle.com/"},window.onhashchange=function(){if(M){M=!1;return}return Tt(),wt(z.cities),R=z.offset,nt(),Nt(),St(!0),$()},it(),nt(),$(),Et(!0),St(!0),Nt(),setInterval(Et,1e3),n&&setInterval(St,350),scrollTo(0,1),_&&function(){return i("wrapper","scale(1)")}.delay(.5),window.applicationCache!=null&&(s=window.applicationCache,s.addEventListener("updateready",function(){if(confirm("There's a newer version of Every Time Zone available, reload now?"))return s.swapCache(),location.reload()},!1));if(navigator.onLine==null||navigator.onLine)yt=document.createElement("script"),yt.innerHTML='!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs")',m=document.createElement("script"),m.src="//static.getclicky.com/js",e("body").appendChild(yt),e("body").appendChild(m),g=setInterval(function(){if(typeof clicky=="undefined"||clicky===null)return;clearInterval(g);try{return clicky.init(204109)}catch(e){}},1e3)}).call(this);