-
Notifications
You must be signed in to change notification settings - Fork 95
/
virtualsky.min.js
8 lines (8 loc) · 92.3 KB
/
virtualsky.min.js
1
2
3
4
5
6
7
8
/*!
Virtual Sky
(c) Stuart Lowe, Las Cumbres Observatory Global Telescope
A browser planetarium using HTML5's <canvas>.
*/
!function(t){function i(t,i){return typeof t===i}stuQuery.prototype.val=function(i){return this[0]?void 0===i?this[0].value||t(this[0]).attr("value"):t(this[0]).attr("value",i||""):""},stuQuery.prototype.hide=function(){for(var i=0;i<this.length;i++)t(this[i]).css({display:"none"})},stuQuery.prototype.show=function(){for(var i=0;i<this.length;i++)t(this[i]).css({display:"block"})},stuQuery.prototype.animate=function(i,s,e){var a,n,o,r=new Array(this.length),h=new Array(this.length),l=JSON.stringify(i);for(n=0;n<this.length;n++)for(o in h[n]=t(this[n]),r[n]=JSON.parse(l),r[n])r[n][o]&&(r[n][o]=parseFloat(h[n].css(o)));var c=new Date,d=this;a=setInterval(function(){var t,n,o,l,p=new Date-c;for(l=p<s?p/s:1,t=0;t<d.length;t++){for(n in o=JSON.parse(JSON.stringify(r[t])))o[n]=l>=1?i[n].toFixed(4):(r[t][n]+l*(i[n]-r[t][n])).toFixed(4);h[t].css(o)}l>=1&&(clearInterval(a),"function"==typeof e&&e.call(d))},25)},stuQuery.prototype.fadeIn=function(t,i){return this.animate({opacity:1},t,i)},stuQuery.prototype.fadeOut=function(t,i){return this.animate({opacity:0},t,i)},t.query=function(){var t={length:0},i=location.search;return i&&"#"!=i&&i.replace(/^\?/,"").replace(/\&$/,"").split("&").forEach(function(i){var s=i.split("=")[0],e=i.split("=")[1];/^-?[0-9.]+$/.test(e)&&(e=parseFloat(e)),"true"==e&&(e=!0),"false"==e&&(e=!1),/^\?[0-9\.]+$/.test(e)&&(e=parseFloat(e)),t[s]=e}),t};var s={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",prefix:""},e="webkit moz o ms khtml".split(" ");if(void 0!==document.cancelFullScreen)s.supportsFullScreen=!0;else if(void 0!==document.msExitFullscreen)s.prefix="ms",s.supportsFullScreen=!0;else for(var a=0,n=e.length;a<n;a++)if(s.prefix=e[a],void 0!==document[s.prefix+"CancelFullScreen"]){s.supportsFullScreen=!0;break}
/*! VirtualSky */
function o(i){for(this.version="0.7.7",this.ie=!1,this.excanvas="undefined"!=typeof G_vmlCanvasManager,this.setDir=function(){var i=t("script[src*=virtualsky]").attr("src")[0].match(/^.*\//);this.dir=i&&i[0]||""},this.getDir=function(i){"string"!=typeof i&&(i="virtualsky");var s=t("script[src*="+i+"]").attr("src");return"string"==typeof s&&(s=[s]),s.length<1&&(s=[""]),(s=s[0].match(/^.*\//))&&s[0]||""},this.q=t.query(),this.setDir(),this.dir=this.getDir(),this.langurl=this.dir+"lang/%LANG%.json",this.id="",this.gradient=!0,this.magnitude=5,this.background="rgba(0,0,0,0)",this.color="",this.wide=0,this.tall=0,this.d2r=Math.PI/180,this.r2d=180/Math.PI,this.setLongitude(-119.86286),this.setLatitude(34.4326),this.spin=!1,this.cardinalpoints=!0,this.constellation={lines:!1,boundaries:!1,labels:!1},this.meteorshowers=!1,this.negative=!1,this.showgalaxy=!1,this.showstars=!0,this.showstarlabels=!1,this.showplanets=!0,this.showplanetlabels=!0,this.showorbits=!1,this.showdate=!0,this.showposition=!0,this.scalestars=1,this.ground=!1,this.grid={az:!1,eq:!1,gal:!1,step:30},this.gal={processed:!1,lineWidth:.75},this.ecliptic=!1,this.meridian=!1,this.keyboard=!0,this.mouse=!0,this.islive=!1,this.fullscreen=!1,this.transparent=!1,this.fps=10,this.credit=!("lco.global"==location.host&&location.href.indexOf("/embed")<0),this.callback={geo:"",mouseenter:"",mouseout:"",contextmenu:"",cursor:"",click:""},this.lookup={},this.keys=[],this.base="",this.az_step=0,this.az_off=0,this.ra_off=0,this.dc_off=0,this.fov=30,this.plugins=[],this.calendarevents=[],this.events={},this.projections={polar:{title:"Polar projection",azel2xy:function(t,i,s,e){var a=e/2,n=a*(Math.PI/2-i)/(Math.PI/2);return{x:s/2-n*Math.sin(t),y:a-n*Math.cos(t),el:i}},xy2azel:function(t,i,s,e){var a=e/2,n=s/2-t,r=a-i;o=Math.sqrt(n*n+r*r);var h=Math.PI/2-o*(Math.PI/2)/a;if(!(h<0))return[Math.atan2(n,r),h]},polartype:!0,atmos:!0},fisheye:{title:"Fisheye polar projection",azel2xy:function(t,i,s,e){var a=e/2,n=a*Math.sin((Math.PI/2-i)/2)/.70710678;return{x:s/2-n*Math.sin(t),y:a-n*Math.cos(t),el:i}},xy2azel:function(t,i,s,e){var a=e/2,n=s/2-t,r=a-i;if(!((o=Math.sqrt(n*n+r*r))>a)){var h=Math.PI/2-2*Math.asin(.70710678*o/a);return[Math.atan2(n,r),h]}},polartype:!0,atmos:!0},ortho:{title:"Orthographic polar projection",azel2xy:function(t,i,s,e){var a=e/2,n=a*Math.cos(i);return{x:s/2-n*Math.sin(t),y:a-n*Math.cos(t),el:i}},xy2azel:function(t,i,s,e){var a=e/2,n=s/2-t,r=a-i;if(!((o=Math.sqrt(n*n+r*r))>a)){var h=Math.acos(o/a);return[Math.atan2(n,r),h]}},polartype:!0,atmos:!0},stereo:{title:"Stereographic projection",azel2xy:function(t,i,s,e){var a=Math.cos(t-Math.PI),n=Math.sin(t-Math.PI),o=Math.sin(i),r=Math.cos(i),h=2/(1+0*o+1*r*a);return{x:s/2+.42*h*e*r*n,y:e-.42*h*e*(1*o-0*r*a),el:i}},xy2azel:function(t,i,s,e){var a=(t-s/2)/e,n=(e-i)/e,o=Math.sqrt(a*a+n*n),r=2*Math.atan2(o,.84),h=Math.asin(0*Math.cos(r)+n*Math.sin(r)*1/o);return[Math.PI+Math.atan2(a*Math.sin(r),1*o*Math.cos(r)-0*n*Math.sin(r)),h]},atmos:!0},lambert:{title:"Lambert projection",azel2xy:function(t,i,s,e){var a=Math.cos(t-Math.PI),n=Math.sin(t-Math.PI),o=Math.sin(i),r=Math.cos(i),h=Math.sqrt(2/(1+r*a));return{x:s/2+.6*e*h*r*n,y:e-.6*e*h*o,el:i}},xy2azel:function(t,i,s,e){var a=(t-s/2)/(.6*e),n=(e-i)/(.6*e),o=Math.sqrt(a*a+n*n);if(!(o>2||o<-2)){var r=2*Math.asin(o/2),h=Math.asin(n*Math.sin(r)/o);return[Math.PI+Math.atan2(a*Math.sin(r),o*Math.cos(r)),h]}},atmos:!0},gnomic:{title:"Gnomic projection",azel2xy:function(t,i){if(i>=0){var s=this.azel2radec(t,i);return this.radec2xy(s.ra*this.d2r,s.dec*this.d2r,[i,t])}return{x:-1,y:-1,el:i}},radec2xy:function(t,i,s){var e,a,n,o,h,l,c,d;return Math.abs(i-this.dc_off)>this.maxangle?{x:-1,y:-1,el:-1}:this.greatCircle(this.ra_off,this.dc_off,t,i)>this.maxangle?{x:-1,y:-1,el:-1}:(s||(s=this.coord2horizon(t,i)),this.ground&&s[0]<-1e-6?{x:-1,y:-1,el:s[0]*this.r2d}:(d=this.tall/this.fov,e=Math.cos(i),a=Math.cos(this.dc_off),n=Math.sin(i),o=Math.sin(this.dc_off),h=r(h=t-this.ra_off),l=e*Math.cos(h),c=d*this.r2d/(o*n+l*a),{x:this.wide/2-c*e*Math.sin(h),y:this.tall/2-c*(a*n-l*o),el:s[0]*this.r2d}))},xy2radec:function(t,i){var s=this.tall/this.fov,e=(this.wide/2-t)/(s*this.r2d),a=(this.tall/2-i)/(s*this.r2d),n=Math.sqrt(e*e+a*a),o=Math.atan(n),r=Math.asin(Math.cos(o)*Math.sin(this.dc_off)+a*Math.sin(o)*Math.cos(this.dc_off)/n),h=this.ra_off+Math.atan2(e*Math.sin(o),n*Math.cos(this.dc_off)*Math.cos(o)-a*Math.sin(this.dc_off)*Math.sin(o));if(!(Math.abs(r-this.dc_off)>this.maxangle)&&!(this.greatCircle(this.ra_off,this.dc_off,h,r)>this.maxangle)){var l=this.coord2horizon(h,r);if(!(this.ground&&l[0]<-1e-6))return{ra:h,dec:r}}},draw:function(){this.transparent||(this.ctx.fillStyle=this.hasGradient()?"rgba(0,15,30, 1)":this.negative?this.col.white:this.col.black,this.ctx.fillRect(0,0,this.wide,this.tall),this.ctx.fill())},isVisible:function(t){return!0},atmos:!1,fullsky:!0},equirectangular:{title:"Equirectangular projection",azel2xy:function(t,i,s,e){for(;t<0;)t+=2*Math.PI;return{x:((t%=2*Math.PI)-Math.PI)/(Math.PI/2)*e+s/2,y:e-i/(Math.PI/2)*e,el:i}},xy2azel:function(t,i,s,e){var a=Math.PI/2*(t-s/2)/e+Math.PI;if(!(a<0||a>2*Math.PI))return[a,Math.PI/2*(e-i)/e]},maxb:90,atmos:!0},mollweide:{title:"Mollweide projection",radec2xy:function(t,i){for(var s,e,a,n,o,r,h=Math.abs(i),l=Math.PI*Math.sin(Math.abs(i)),c=0;c<20&&(h+=s=-(h+Math.sin(h)-l)/(1+Math.cos(h)),!(s<1e-4));c++);return r=(t+this.d2r*this.az_off)%(2*Math.PI)-Math.PI,o=!1,(e=-2/Math.PI*r*Math.cos(h/2)*this.tall/2+this.wide/2)>this.wide&&(o=!0),a=-(i>=0?1:-1)*Math.sin(h/2)*this.tall/2+this.tall/2,n=this.coord2horizon(t,i),{x:o?-100:e%this.wide,y:a,el:n[0]*this.r2d}},xy2radec:function(t,i){var s=(this.wide/2-t)*Math.sqrt(2)*2/this.tall,e=(this.tall/2-i)*Math.sqrt(2)*2/this.tall,a=Math.asin(e/Math.sqrt(2)),n=Math.asin((2*a+Math.sin(2*a))/Math.PI);if(!(Math.abs(s)>2*Math.sqrt(2)*Math.cos(a)))return{ra:Math.PI-this.d2r*this.az_off+Math.PI*s/(2*Math.sqrt(2)*Math.cos(a)),dec:n}},draw:function(){var t=this.ctx;t.moveTo(this.wide/2,this.tall/2),t.beginPath();var i=this.wide/2-this.tall,s=2*this.tall,e=this.tall,a=s/2*.5522848,n=e/2*.5522848,o=i+s,r=0+e,h=i+s/2,l=0+e/2;t.moveTo(i,l),t.bezierCurveTo(i,l-n,h-a,0,h,0),t.bezierCurveTo(h+a,0,o,l-n,o,l),t.bezierCurveTo(o,l+n,h+a,r,h,r),t.bezierCurveTo(h-a,r,i,l+n,i,l),t.closePath(),this.transparent||(t.fillStyle=this.hasGradient()?"rgba(0,15,30, 1)":this.negative?this.col.white:this.col.black,t.fill())},altlabeltext:!0,fullsky:!0,atmos:!1},planechart:{title:"Planechart projection",radec2xy:function(t,i){return{x:-(((t=r(t))+this.d2r*this.az_off)%(2*Math.PI)-Math.PI)/(2*Math.PI)*this.tall*2+this.wide/2,y:-i/Math.PI*this.tall+this.tall/2,el:this.coord2horizon(t,i)[0]*this.r2d}},xy2radec:function(t,i){var s=2*(this.wide/2-t)*Math.PI/(2*this.tall);if(!(Math.abs(s)>Math.PI))return{ra:s+Math.PI-this.d2r*this.az_off,dec:Math.PI*(this.tall/2-i)/this.tall}},draw:function(){this.transparent||(this.ctx.fillStyle=this.hasGradient()?"rgba(0,15,30, 1)":this.negative?this.col.white:this.col.black,this.ctx.fillRect(this.wide/2-this.tall,0,2*this.tall,this.tall),this.ctx.fill())},fullsky:!0,atmos:!1}},this.stars=this.convertStarsToRadians([[677,2.1,2.097,29.09],[746,2.3,2.295,59.15],[765,3.9,2.353,-45.75],[1067,2.8,3.309,15.18],[1562,3.6,4.857,-8.82],[1599,4.2,5.018,-64.87],[1645,5.4,5.149,8.19],[2021,2.8,6.438,-77.25],[2072,3.9,6.551,-43.68],[2081,2.4,6.571,-42.31],[2484,4.4,7.886,-62.96],[2920,3.7,9.243,53.9],[3092,3.3,9.832,30.86],[3179,2.2,10.127,56.54],[3419,2,10.897,-17.99],[3760,5.9,12.073,7.3],[3821,3.5,12.276,57.82],[3881,4.5,12.454,41.08],[4427,2.1,14.177,60.72],[4436,3.9,14.188,38.5],[4577,4.3,14.652,-29.36],[4889,5.5,15.705,31.8],[4906,4.3,15.736,7.89],[5165,3.3,16.521,-46.72],[5348,3.9,17.096,-55.25],[5364,3.5,17.147,-10.18],[5447,2.1,17.433,35.62],[5742,4.7,18.437,24.58],[6193,4.7,19.867,27.26],[6537,3.6,21.006,-8.18],[6686,2.7,21.454,60.24],[6867,3.4,22.091,-43.32],[7007,4.8,22.546,6.14],[7083,3.9,22.813,-49.07],[7097,3.6,22.871,15.35],[7588,.5,24.429,-57.24],[7607,3.6,24.498,48.63],[7884,4.5,25.358,5.49],[8102,3.5,26.017,-15.94],[8198,4.3,26.348,9.16],[8645,3.7,27.865,-10.34],[8796,3.4,28.27,29.58],[8832,3.9,28.383,19.29],[8833,4.6,28.389,3.19],[8837,4.4,28.411,-46.3],[8886,3.4,28.599,63.67],[8903,2.6,28.66,20.81],[9007,3.7,28.989,-51.61],[9236,2.9,29.692,-61.57],[9347,4,30.001,-21.08],[9487,3.8,30.512,2.76],[9598,4,30.859,72.42],[9640,2.1,30.975,42.33],[9884,2,31.793,23.46],[10064,3,32.386,34.99],[10324,4.4,33.25,8.85],[10559,5.3,33.985,33.36],[10602,3.6,34.127,-51.51],[10826,6.5,34.837,-2.98],[11001,4.1,35.437,-68.66],[11345,4.9,36.488,-12.29],[11407,4.2,36.746,-47.7],[11484,4.3,37.04,8.46],[11767,2,37.955,89.26],[11783,4.7,38.022,-15.24],[12093,4.9,38.969,5.59],[12387,4.1,39.871,.33],[12390,4.8,39.891,-11.87],[12394,4.1,39.897,-68.27],[12413,4.7,39.95,-42.89],[12484,5.2,40.165,-54.55],[12486,4.1,40.167,-39.86],[12706,3.5,40.825,3.24],[12770,4.2,41.031,-13.86],[12828,4.3,41.236,10.11],[12843,4.5,41.276,-18.57],[13147,4.5,42.273,-32.41],[13209,3.6,42.496,27.26],[13254,4.2,42.646,38.32],[13268,3.8,42.674,55.9],[13531,3.9,43.564,52.76],[13701,3.9,44.107,-8.9],[13847,2.9,44.565,-40.3],[13954,4.7,44.929,8.91],[14135,2.5,45.57,4.09],[14146,4.1,45.598,-23.62],[14240,5.1,45.903,-59.74],[14328,2.9,46.199,53.51],[14354,3.3,46.294,38.84],[14576,2.1,47.042,40.96],[14668,3.8,47.374,44.86],[14879,3.8,48.019,-28.99],[15197,4.8,48.958,-8.82],[15474,3.7,49.879,-21.76],[15510,4.3,49.982,-43.07],[15863,1.8,51.081,49.86],[15900,3.6,51.203,9.03],[16083,3.7,51.792,9.73],[16228,4.2,52.267,59.94],[16537,3.7,53.233,-9.46],[16611,4.3,53.447,-21.63],[17358,3,55.731,47.79],[17378,3.5,55.812,-9.76],[17440,3.8,56.05,-64.81],[17448,3.8,56.08,32.29],[17499,3.7,56.219,24.11],[17529,3.8,56.298,42.58],[17573,3.9,56.457,24.37],[17651,4.2,56.712,-23.25],[17678,3.3,56.81,-74.24],[17702,2.9,56.871,24.11],[17797,4.3,57.149,-37.62],[17847,3.6,57.291,24.05],[17874,4.2,57.364,-36.2],[17959,4.6,57.59,71.33],[18246,2.8,58.533,31.88],[18505,5,59.356,63.07],[18532,2.9,59.463,40.01],[18543,3,59.507,-13.51],[18597,4.6,59.686,-61.4],[18614,4,59.741,35.79],[18724,3.4,60.17,12.49],[18907,3.9,60.789,5.99],[19343,4,62.165,47.71],[19747,3.9,63.5,-42.29],[19780,3.3,63.606,-62.47],[19893,4.3,64.007,-51.49],[19921,4.4,64.121,-59.3],[20042,3.5,64.474,-33.8],[20205,3.6,64.948,15.63],[20455,3.8,65.734,17.54],[20535,4,66.009,-34.02],[20648,4.3,66.372,17.93],[20885,3.8,67.144,15.96],[20889,3.5,67.154,19.18],[20894,3.4,67.166,15.87],[21060,5.1,67.709,-44.95],[21281,3.3,68.499,-55.04],[21393,3.8,68.888,-30.56],[21421,.9,68.98,16.51],[21444,3.9,69.08,-3.35],[21594,3.9,69.545,-14.3],[21770,4.4,70.14,-41.86],[21861,5,70.515,-37.14],[21881,4.3,70.561,22.96],[21949,5.5,70.767,-70.93],[22109,4,71.376,-3.25],[22449,3.2,72.46,6.96],[22509,4.3,72.653,8.9],[22549,3.7,72.802,5.61],[22701,4.4,73.224,-5.45],[22730,5.3,73.345,2.51],[22783,4.3,73.513,66.34],[22797,3.7,73.563,2.44],[22845,4.6,73.724,10.15],[23015,2.7,74.248,33.17],[23123,4.5,74.637,1.71],[23416,3,75.492,43.82],[23453,3.7,75.62,41.08],[23685,3.2,76.365,-22.37],[23767,3.2,76.629,41.23],[23875,2.8,76.962,-5.09],[23972,4.3,77.287,-8.75],[24244,4.5,78.075,-11.87],[24305,3.3,78.233,-16.21],[24327,4.4,78.308,-12.94],[24436,.2,78.634,-8.2],[24608,.1,79.172,46],[24674,3.6,79.402,-6.84],[24845,4.3,79.894,-13.18],[24873,5.3,79.996,-12.32],[25110,5.1,80.64,79.23],[120412],[25281,3.4,81.119,-2.4],[25336,1.6,81.283,6.35],[25428,1.6,81.573,28.61],[25606,2.8,82.061,-20.76],[25859,3.9,82.803,-35.47],[25918,5.2,82.971,-76.34],[25930,2.3,83.002,-.3],[25985,2.6,83.183,-17.82],[26069,3.8,83.406,-62.49],[26207,3.4,83.784,9.93],[26241,2.8,83.858,-5.91],[26311,1.7,84.053,-1.2],[26451,3,84.411,21.14],[26549,3.8,84.687,-2.6],[26634,2.6,84.912,-34.07],[26727,1.7,85.19,-1.94],[27072,3.6,86.116,-22.45],[27100,4.3,86.193,-65.74],[27288,3.5,86.739,-14.82],[27321,3.9,86.821,-51.07],[27366,2.1,86.939,-9.67],[27530,4.5,87.457,-56.17],[27628,3.1,87.74,-35.77],[27654,3.8,87.83,-20.88],[27673,4,87.872,39.15],[27890,4.7,88.525,-63.09],[27913,4.4,88.596,20.28],[27989,.5,88.793,7.41],[28103,3.7,89.101,-14.17],[28199,4.4,89.384,-35.28],[28328,4,89.787,-42.82],[28358,3.7,89.882,54.28],[28360,1.9,89.882,44.95],[28380,2.6,89.93,37.21],[28614,4.1,90.596,9.65],[28691,5.1,90.864,19.69],[28734,4.2,91.03,23.26],[28910,4.7,91.539,-14.94],[29038,4.4,91.893,14.77],[29151,5.7,92.241,2.5],[29426,4.5,92.985,14.21],[29651,4,93.714,-6.27],[29655,3.3,93.719,22.51],[29807,4.4,94.138,-35.14],[30060,4.4,94.906,59.01],[30122,3,95.078,-30.06],[30277,3.9,95.528,-33.44],[30324,2,95.675,-17.96],[30343,2.9,95.74,22.51],[30419,4.4,95.942,4.59],[30438,-.6,95.988,-52.7],[30867,3.8,97.204,-7.03],[30883,4.1,97.241,20.21],[31416,4.5,98.764,-22.96],[31592,4,99.171,-19.26],[31681,1.9,99.428,16.4],[31685,3.2,99.44,-43.2],[32246,3.1,100.983,25.13],[32349,-1.4,101.287,-16.72],[32362,3.4,101.322,12.9],[32607,3.2,102.048,-61.94],[32759,3.5,102.46,-32.51],[32768,2.9,102.484,-50.61],[33018,3.6,103.197,33.96],[33152,3.9,103.533,-24.18],[33160,4.1,103.547,-12.04],[33165,6.7,103.554,-23.93],[33347,4.4,104.034,-17.05],[33449,4.3,104.319,58.42],[33579,1.5,104.656,-28.97],[33856,3.5,105.43,-27.93],[33977,3,105.756,-23.83],[34045,4.1,105.94,-15.63],[34088,4,106.027,20.57],[34444,1.8,107.098,-26.39],[34481,3.8,107.187,-70.5],[34693,4.4,107.785,30.25],[34769,4.2,107.966,-.49],[35037,4,108.703,-26.77],[35228,4,109.208,-67.96],[35264,2.7,109.286,-37.1],[35350,3.6,109.523,16.54],[35550,3.5,110.031,21.98],[35904,2.5,111.024,-29.3],[36046,3.8,111.432,27.8],[36145,4.6,111.679,49.21],[36188,2.9,111.788,8.29],[36377,3.3,112.308,-43.3],[36850,1.6,113.649,31.89],[36962,4.1,113.981,26.9],[37229,3.8,114.708,-26.8],[37279,.4,114.825,5.22],[37447,3.9,115.312,-9.55],[37504,3.9,115.455,-72.61],[37677,3.9,115.952,-28.95],[37740,3.6,116.112,24.4],[37819,3.6,116.314,-37.97],[37826,1.2,116.329,28.03],[38146,5.3,117.257,-24.91],[38170,3.3,117.324,-24.86],[38414,3.7,118.054,-40.58],[38827,3.5,119.195,-52.98],[39429,2.2,120.896,-40],[39757,2.8,121.886,-24.3],[39794,4.3,121.982,-68.62],[39863,4.4,122.149,-2.98],[39953,1.8,122.383,-47.34],[40526,3.5,124.129,9.19],[40702,4,124.631,-76.92],[40843,5.1,125.016,27.22],[41037,1.9,125.628,-59.51],[41075,4.3,125.709,43.19],[41307,3.9,126.415,-3.91],[41312,3.8,126.434,-66.14],[41704,3.4,127.566,60.72],[42313,4.1,129.414,5.7],[42402,4.5,129.689,3.34],[42515,4,130.026,-35.31],[42536,3.6,130.073,-52.92],[42568,4.3,130.154,-59.76],[42570,3.8,130.157,-46.65],[42799,4.3,130.806,3.4],[42806,4.7,130.821,21.47],[42828,3.7,130.898,-33.19],[42911,3.9,131.171,18.15],[42913,1.9,131.176,-54.71],[43023,3.9,131.507,-46.04],[43103,4,131.674,28.76],[43109,3.4,131.694,6.42],[43234,4.3,132.108,5.84],[43409,4,132.633,-27.71],[43783,3.8,133.762,-60.64],[43813,3.1,133.848,5.95],[44066,4.3,134.622,11.86],[44127,3.1,134.802,48.04],[44248,4,135.16,41.78],[44382,4,135.612,-66.4],[44471,3.6,135.906,47.16],[44511,3.8,136.039,-47.1],[44700,4.6,136.632,38.45],[44816,2.2,136.999,-43.43],[45080,3.4,137.742,-58.97],[45101,4,137.82,-62.32],[45238,1.7,138.3,-69.72],[45336,3.9,138.591,2.31],[45556,2.2,139.273,-59.28],[45688,3.8,139.711,36.8],[45860,3.1,140.264,34.39],[45941,2.5,140.528,-55.01],[46390,2,141.897,-8.66],[46509,4.6,142.287,-2.77],[46651,3.6,142.675,-40.47],[46701,3.2,142.805,-57.03],[46733,3.6,142.882,63.06],[46776,4.5,142.996,-1.18],[46853,3.2,143.214,51.68],[46952,4.5,143.556,36.4],[47431,3.9,144.964,-1.14],[47508,3.5,145.288,9.89],[47854,3.7,146.312,-62.51],[47908,3,146.463,23.77],[48002,2.9,146.776,-65.07],[48319,3.8,147.747,59.04],[48356,4.1,147.87,-14.85],[48402,4.5,148.026,54.06],[48455,3.9,148.191,26.01],[48774,3.5,149.216,-54.57],[48926,5.2,149.718,-35.89],[49583,3.5,151.833,16.76],[49593,4.5,151.857,35.24],[49641,4.5,151.985,-.37],[49669,1.4,152.093,11.97],[49841,3.6,152.647,-12.35],[50099,3.3,153.434,-70.04],[50191,3.9,153.684,-42.12],[50335,3.4,154.173,23.42],[50371,3.4,154.271,-61.33],[50372,3.5,154.274,42.91],[50583,2,154.993,19.84],[50801,3.1,155.582,41.5],[50954,4,156.099,-74.03],[51069,3.8,156.523,-16.84],[51172,4.3,156.788,-31.07],[51232,3.8,156.97,-58.74],[51233,4.2,156.971,36.71],[51437,5.1,157.573,-.64],[51576,3.3,158.006,-61.69],[51624,3.8,158.203,9.31],[51839,4.1,158.867,-78.61],[51986,3.8,159.326,-48.23],[52419,2.7,160.739,-64.39],[52468,4.6,160.885,-60.57],[52727,2.7,161.692,-49.42],[52943,3.1,162.406,-16.19],[53229,3.8,163.328,34.21],[53253,3.8,163.374,-58.85],[53740,4.1,164.944,-18.3],[53910,2.3,165.46,56.38],[54061,1.8,165.932,61.75],[54463,3.9,167.147,-58.98],[54539,3,167.416,44.5],[54682,4.5,167.915,-22.83],[54872,2.6,168.527,20.52],[54879,3.3,168.56,15.43],[55203,3.8],[55219,3.5,169.62,33.09],[55282,3.6,169.835,-14.78],[55425,3.9,170.252,-54.49],[55687,4.8,171.152,-10.86],[55705,4.1,171.221,-17.68],[56211,3.8,172.851,69.33],[56343,3.5,173.25,-31.86],[56480,4.6,173.69,-54.26],[56561,3.1,173.945,-63.02],[56633,4.7,174.17,-9.8],[57283,4.7,176.191,-18.35],[57363,3.6,176.402,-66.73],[57380,4,176.465,6.53],[57399,3.7,176.513,47.78],[57632,2.1,177.265,14.57],[57757,3.6,177.674,1.76],[57936,4.3,178.227,-33.91],[58001,2.4,178.458,53.69],[58188,5.2,179.004,-17.15],[59196,2.6,182.09,-50.72],[59199,4,182.103,-24.73],[59316,3,182.531,-22.62],[59449,4,182.913,-52.37],[59747,2.8,183.786,-58.75],[59774,3.3,183.857,57.03],[59803,2.6,183.952,-17.54],[6e4,4.2,184.587,-79.31],[60030,5.9,184.668,-.79],[60129,3.9,184.976,-.67],[60260,3.6,185.34,-60.4],[60718,.8,186.65,-63.1],[60742,4.3,186.734,28.27],[60823,3.9,187.01,-50.23],[60965,2.9,187.466,-16.52],[61084,1.6,187.791,-57.11],[61174,4.3,188.018,-16.2],[61199,3.8,188.117,-72.13],[61281,3.9,188.371,69.79],[61317,4.2,188.436,41.36],[61359,2.6,188.597,-23.4],[61585,2.7,189.296,-69.14],[61622,3.9,189.426,-48.54],[61932,2.2,190.379,-48.96],[61941,2.7,190.415,-1.45],[62322,3,191.57,-68.11],[62434,1.3,191.93,-59.69],[62956,1.8,193.507,55.96],[63090,3.4,193.901,3.4],[63125,2.9,194.007,38.32],[63608,2.9,195.544,10.96],[63613,3.6,195.568,-71.55],[64166,4.9,197.264,-23.12],[64241,4.3,197.497,17.53],[64394,4.2,197.968,27.88],[64962,3,199.73,-23.17],[65109,2.8,200.149,-36.71],[65378,2.2,200.981,54.93],[65474,1,201.298,-11.16],[65477,4,201.306,54.99],[65936,3.9,202.761,-39.41],[66249,3.4,203.673,-.6],[66657,2.3,204.972,-53.47],[67301,1.9,206.885,49.31],[67459,4,207.369,15.8],[67464,3.4,207.376,-41.69],[67472,3.5,207.404,-42.47],[67927,2.7,208.671,18.4],[68002,2.5,208.885,-47.29],[68245,3.8,209.568,-42.1],[68282,3.9,209.67,-44.8],[68520,4.2,210.412,1.54],[68702,.6,210.956,-60.37],[68756,3.7,211.097,64.38],[68895,3.3,211.593,-26.68],[68933,2.1,211.671,-36.37],[69427,4.2,213.224,-10.27],[69673,-.1,213.915,19.18],[69701,4.1,214.004,-6],[69996,3.5,214.851,-46.06],[70576,4.3,216.545,-45.38],[70638,4.3,216.73,-83.67],[71053,3.6,217.957,30.37],[71075,3,218.019,38.31],[71352,2.3,218.877,-42.16],[71536,4,219.472,-49.43],[71681,1.4,219.896,-60.84],[71683,-0,219.902,-60.83],[71795,3.8,220.287,13.73],[71860,2.3,220.482,-47.39],[71908,3.2,220.627,-64.98],[71957,3.9,220.765,-5.66],[72105,2.4,221.247,27.07],[72220,3.7,221.562,1.89],[72370,3.8,221.965,-79.04],[72607,2.1,222.676,74.16],[72622,2.8,222.72,-16.04],[73273,2.7,224.633,-43.13],[73334,3.1,224.79,-42.1],[73555,3.5,225.487,40.39],[73714,3.3,226.018,-25.28],[73807,3.9,226.28,-47.05],[74376,3.9,227.984,-48.74],[74395,3.4,228.071,-52.1],[74666,3.5,228.876,33.31],[74785,2.6,229.252,-9.38],[74824,4.1,229.379,-58.8],[74946,2.9,229.727,-68.68],[75097,3,230.182,71.83],[75141,3.2,230.343,-40.65],[75177,3.6,230.452,-36.26],[75264,3.4,230.67,-44.69],[75323,4.5,230.844,-59.32],[75458,3.3,231.232,58.97],[75695,3.7,231.957,29.11],[76127,4.1,233.232,31.36],[76267,2.2,233.672,26.71],[76276,3.8,233.701,10.54],[76297,2.8,233.785,-41.17],[76333,3.9,233.882,-14.79],[76470,3.6,234.256,-28.14],[76552,4.3,234.513,-42.57],[76600,3.7,234.664,-29.78],[76952,3.8,235.686,26.3],[77055,4.3,236.015,77.79],[77070,2.6,236.067,6.43],[77233,3.6,236.547,15.42],[77450,4.1,237.185,18.14],[77512,4.6,237.399,26.07],[77516,3.5,237.405,-3.43],[77622,3.7,237.704,4.48],[77634,4,237.74,-33.63],[77760,4.6,238.169,42.45],[77853,4.1,238.456,-16.73],[77952,2.8,238.786,-63.43],[78072,3.9,239.113,15.66],[78104,3.9,239.221,-29.21],[78159,4.1,239.397,26.88],[78265,2.9,239.713,-26.11],[78384,3.4,240.031,-38.4],[78401,2.3,240.083,-22.62],[78493,5,240.361,29.85],[78527,4,240.472,58.57],[78639,4.7,240.804,-49.23],[78820,2.6,241.359,-19.81],[78933,3.9,241.702,-20.67],[78970,5.7,241.818,-36.76],[79509,5,243.37,-54.63],[79593,2.7,243.586,-3.69],[79664,3.9,243.859,-63.69],[79822,5,244.376,75.76],[79882,3.2,244.58,-4.69],[79992,3.9,244.935,46.31],[8e4,4,244.96,-50.16],[80112,2.9,245.297,-25.59],[80170,3.7,245.48,19.15],[80331,2.7,245.998,61.51],[80582,4.5,246.796,-47.55],[80763,1.1,247.352,-26.43],[80816,2.8,247.555,21.49],[80883,3.8,247.728,1.98],[81065,3.9,248.363,-78.9],[81126,4.2,248.526,42.44],[81266,2.8,248.971,-28.22],[81377,2.5,249.29,-10.57],[81693,2.8,250.322,31.6],[81833,3.5,250.724,38.92],[81852,4.2,250.769,-77.52],[82080,4.2,251.493,82.04],[82273,1.9,252.166,-69.03],[82363,3.8,252.446,-59.04],[82396,2.3,252.541,-34.29],[82514,3,252.968,-38.05],[82545,3.6,253.084,-38.02],[82671,4.7,253.499,-42.36],[82729,3.6,253.646,-42.36],[83e3,3.2,254.417,9.38],[83081,3.1,254.655,-55.99],[83207,3.9,255.072,30.93],[83895,3.2,257.197,65.71],[84012,2.4,257.595,-15.72],[84143,3.3,258.038,-43.24],[84345,2.8,258.662,14.39],[84379,3.1,258.758,24.84],[84380,3.2,258.762,36.81],[84606,4.6,259.418,37.29],[84880,4.3,260.207,-12.85],[84970,3.3,260.502,-25],[85112,4.2,260.921,37.15],[85258,2.8,261.325,-55.53],[85267,3.3,261.349,-56.38],[85670,2.8,262.608,52.3],[85693,4.4,262.685,26.11],[85696,2.7,262.691,-37.3],[85727,3.6,262.775,-60.68],[85755,4.8,262.854,-23.96],[85792,2.8,262.96,-49.88],[85822,4.3,263.054,86.59],[85829,4.9,263.067,55.17],[85927,1.6,263.402,-37.1],[86032,2.1,263.734,12.56],[86228,1.9,264.33,-43],[86263,3.5,264.397,-15.4],[86414,3.8,264.866,46.01],[86565,4.2,265.354,-12.88],[86670,2.4,265.622,-39.03],[86742,2.8,265.868,4.57],[86929,3.6,266.433,-64.72],[86974,3.4,266.615,27.72],[87072,4.5,266.89,-27.83],[87073,3,266.896,-40.13],[87108,3.8,266.973,2.71],[87261,3.2,267.465,-37.04],[87585,3.7,268.382,56.87],[87808,3.9,269.063,37.25],[87833,2.2,269.152,51.49],[87933,3.7,269.441,29.25],[88048,3.3,269.757,-9.77],[88192,3.9,270.161,2.93],[88635,3,271.452,-30.42],[88714,3.6,271.658,-50.09],[88771,3.7,271.837,9.56],[88794,3.8,271.886,28.76],[88866,4.3,272.145,-63.67],[89341,3.8,273.441,-21.06],[89642,3.1,274.407,-36.76],[89931,2.7,275.249,-29.83],[89937,3.5,275.264,72.73],[89962,3.2,275.328,-2.9],[90098,4.3,275.807,-61.49],[90139,3.9,275.925,21.77],[90185,1.8,276.043,-34.38],[90422,3.5,276.743,-45.97],[90496,2.8,276.993,-25.42],[90568,4.1,277.208,-49.07],[90595,4.7,277.299,-14.57],[90887,5.2,278.089,-39.7],[91117,3.9,278.802,-8.24],[91262,0,279.235,38.78],[91792,4,280.759,-71.43],[91875,5.1,280.946,-38.32],[91971,4.3,281.193,37.61],[92041,3.2,281.414,-26.99],[92175,4.2,281.794,-4.75],[92202,5.4,281.871,-5.71],[92420,3.5,282.52,33.36],[92609,4.2,283.054,-62.19],[92791,4.2,283.626,36.9],[92814,5.1,283.68,-15.6],[92855,2,283.816,-26.3],[92946,4.6,284.055,4.2],[92953,5.3,284.071,-42.71],[92989,5.4,284.169,-37.34],[93015,4.4,284.238,-67.23],[93085,3.5,284.433,-21.11],[93174,4.8,284.681,-37.11],[93194,3.3,284.736,32.69],[93244,4,284.906,15.07],[93506,2.6,285.653,-29.88],[93542,4.7,285.779,-42.1],[93683,3.8,286.171,-21.74],[93747,3,286.353,13.86],[93805,3.4,286.562,-4.88],[93825,4.2,286.605,-37.06],[93864,3.3,286.735,-27.67],[94005,4.6,287.087,-40.5],[94114,4.1,287.368,-37.9],[94141,2.9,287.441,-21.02],[94160,4.1,287.507,-39.34],[94376,3.1,288.139,67.66],[94779,3.8,289.276,53.37],[94820,4.9,289.409,-18.95],[95168,3.9,290.418,-17.85],[95241,4,290.66,-44.46],[95294,4.3,290.805,-44.8],[95347,4,290.972,-40.62],[95501,3.4,291.375,3.11],[95771,4.4,292.176,24.66],[95853,3.8,292.426,51.73],[95947,3,292.68,27.96],[96406,5.6,294.007,-24.72],[96757,4.4,295.024,18.01],[96837,4.4,295.262,17.48],[97165,2.9,296.244,45.13],[97278,2.7,296.565,10.61],[97365,3.7,296.847,18.53],[97433,3.8,297.043,70.27],[97649,.8,297.696,8.87],[97804,3.9,298.118,1.01],[98032,4.1,298.815,-41.87],[98036,3.7,298.828,6.41],[98110,3.9,299.077,35.08],[98337,3.5,299.689,19.49],[98412,4.4,299.934,-35.28],[98495,4,300.148,-72.91],[98543,4.7,300.275,27.75],[98688,4.4,300.665,-27.71],[98920,5.1,301.29,19.99],[99240,3.5,302.182,-66.18],[99473,3.2,302.826,-.82],[99675,3.8,303.408,46.74],[99848,4,303.868,47.71],[100064,3.6,304.514,-12.54],[100345,3,305.253,-14.78],[100453,2.2,305.557,40.26],[100751,1.9,306.412,-56.74],[101421,4,308.303,11.3],[101769,3.6,309.387,14.6],[101772,3.1,309.392,-47.29],[101958,3.8,309.91,15.91],[102098,1.3,310.358,45.28],[102281,4.4,310.865,15.07],[102395,3.4,311.24,-66.2],[102422,3.4,311.322,61.84],[102485,4.1,311.524,-25.27],[102488,2.5,311.553,33.97],[102532,4.3,311.665,16.12],[102618,3.8,311.919,-9.5],[102831,4.9,312.492,-33.78],[102978,4.1,312.955,-26.92],[103227,3.7,313.703,-58.45],[103413,3.9,314.293,41.17],[103738,4.7,315.323,-32.26],[104060,3.7,316.233,43.93],[104139,4.1,316.487,-17.23],[104521,4.7,317.585,10.13],[104732,3.2,318.234,30.23],[104858,4.5,318.62,10.01],[104887,3.7,318.698,38.05],[104987,3.9,318.956,5.25],[105140,4.7,319.485,-32.17],[105199,2.5,319.645,62.59],[105319,4.4,319.967,-53.45],[105515,4.3,320.562,-16.83],[105570,5.2,320.723,6.81],[105858,4.2,321.611,-65.37],[105881,3.8,321.667,-22.41],[106032,3.2,322.165,70.56],[106278,2.9,322.89,-5.57],[106481,4,323.495,45.59],[106985,3.7,325.023,-16.66],[107089,3.7,325.369,-77.39],[107310,4.5,326.036,28.74],[107315,2.4,326.046,9.88],[107354,4.1,326.161,25.65],[107556,2.9,326.76,-16.13],[107608,5,326.934,-30.9],[108085,3,328.482,-37.36],[108661,5.4,330.209,-28.45],[109074,3,331.446,-.32],[109111,4.5,331.529,-39.54],[109139,4.3,331.609,-13.87],[109176,3.8,331.753,25.35],[109268,1.7,332.058,-46.96],[109352,5.6,332.307,33.17],[109422,4.9,332.537,-32.55],[109427,3.5,332.55,6.2],[109492,3.4,332.714,58.2],[109937,4.1,333.992,37.75],[110003,4.2,334.208,-7.78],[110130,2.9,334.625,-60.26],[110395,3.9,335.414,-1.39],[110538,4.4,335.89,52.23],[110609,4.5,336.129,49.48],[110960,3.6,337.208,-.02],[110997,4,337.317,-43.5],[111022,4.3,337.383,47.71],[111104,4.5,337.622,43.12],[111123,4.8,337.662,-10.68],[111169,3.8,337.823,50.28],[111188,4.3,337.876,-32.35],[111497,4,338.839,-.12],[111954,4.2,340.164,-27.04],[112029,3.4,340.366,10.83],[112122,2.1,340.667,-46.88],[112158,2.9,340.751,30.22],[112405,4.1,341.515,-81.38],[112440,4,341.633,23.57],[112447,4.2,341.673,12.17],[112623,3.5,342.139,-51.32],[112716,4,342.398,-13.59],[112724,3.5,342.42,66.2],[112748,3.5,342.501,24.6],[112961,3.7,343.154,-7.58],[113136,3.3,343.663,-15.82],[113246,4.2,343.987,-32.54],[113368,1.2,344.413,-29.62],[113638,4.1,345.22,-52.75],[113726,3.6,345.48,42.33],[113881,2.4,345.944,28.08],[113963,2.5,346.19,15.21],[114131,4.3,346.72,-43.52],[114341,3.7,347.362,-21.17],[114421,3.9,347.59,-45.25],[114855,4.2,348.973,-9.09],[114971,3.7,349.291,3.28],[114996,4,349.357,-58.24],[115102,4.4,349.706,-32.53],[115438,4,350.743,-20.1],[115738,5,351.733,1.26],[115830,4.3,351.992,6.38],[116231,4.4,353.243,-37.82],[116584,3.8,354.391,46.46],[116727,3.2,354.837,77.63],[116771,4.1,354.988,5.63],[116928,4.5,355.512,1.78],[118268,4,359.828,6.86]]),this.starnames={},this.lookup.star=[],a=0;a<this.stars.length;a++)this.lookup.star.push({ra:this.stars[a][2],dec:this.stars[a][3],label:this.stars[a][0],mag:this.stars[a][1]});this.file={stars:this.dir+"stars.json",lines:this.dir+"lines_latin.json",boundaries:this.dir+"boundaries.json",showers:this.dir+"showers.json",galaxy:this.dir+"galaxy.json",planets:this.dir+"virtualsky-planets.js"},this.hipparcos={},this.updateClock(new Date),this.fullsky=!1,this.colours={normal:{txt:"rgb(255,255,255)",black:"rgb(0,0,0)",white:"rgb(255,255,255)",grey:"rgb(100,100,100)",stars:"rgb(255,255,255)",sun:"rgb(255,215,0)",moon:"rgb(150,150,150)",cardinal:"rgba(163,228,255, 1)",constellation:"rgba(180,180,255,0.8)",constellationboundary:"rgba(255,255,100,0.6)",showers:"rgba(100,255,100,0.8)",galaxy:"rgba(100,200,255,0.5)",az:"rgba(100,100,255,0.4)",eq:"rgba(255,100,100,0.4)",ec:"rgba(255,0,0,0.4)",gal:"rgba(100,200,255,0.4)",meridian:"rgba(25,255,0,0.4)",pointers:"rgb(200,200,200)"},negative:{txt:"rgb(0,0,0)",black:"rgb(0,0,0)",white:"rgb(255,255,255)",grey:"rgb(100,100,100)",stars:"rgb(0,0,0)",sun:"rgb(0,0,0)",moon:"rgb(0,0,0)",cardinal:"rgba(0,0,0,1)",constellation:"rgba(0,0,0,0.8)",constellationboundary:"rgba(0,0,0,0.6)",showers:"rgba(0,0,0,0.8)",galaxy:"rgba(0,0,0,0.5)",az:"rgba(0,0,255,0.6)",eq:"rgba(255,100,100,0.8)",ec:"rgba(255,0,0,0.6)",gal:"rgba(100,200,255,0.8)",meridian:"rgba(0,255,0,0.6)"}},this.input=i,this.init(i),this.language="string"==typeof this.q.lang?this.q.lang:"string"==typeof this.setlang?this.setlang:navigator?navigator.userLanguage||navigator.systemLanguage||navigator.language||browser.language:"";var s,e,n,o,h,l,c,d,p,u="string"==typeof this.q.lang||"string"==typeof this.setlang;function g(t){return"border-radius:"+t+";-moz-border-radius:"+t+";-webkit-border-radius:"+t+";"}if(this.langs={ar:{language:{name:"العربية",alignment:"right"}},cs:{language:{name:"Čeština",alignment:"left"}},de:{language:{name:"Deutsch",alignment:"left"}},en:{language:{name:"English",alignment:"left"}},es:{language:{name:"Español",alignment:"left"}},fr:{language:{name:"Français",alignment:"left"}},gl:{language:{name:"Galego",alignment:"left"}},it:{language:{name:"Italiano",alignment:"left"}},nl:{language:{name:"Nederlands",alignment:"left"}},pl:{language:{name:"Polski",alignment:"left"}},pt:{language:{name:"Português",alignment:"left"}}},this.lang=this.langs.en,void 0===this.polartype&&this.selectProjection("polar"),this.updateColours(),this.loadLanguage(this.language,"",u),s=".virtualsky",e="#f0f0f0",n="#fcfcfc",d=(c="background")+"-color",l="padding",this.padding=4,p="box-shadow:0px 0px 20px rgba(255,255,255,0.5);",o=g("0em"),h=g("3px"),t("head").append('<style type="text/css">'+s+"_help { "+l+":10px;"+d+":white;"+o+"} "+s+"_help ul { list-style:none;margin:0px;"+l+":0px; } "+s+"_infobox { "+d+":"+e+";color:black;"+l+":5px;"+o+p+"} "+s+"_infobox img {} "+s+"_infocredit {color:white;float:left;font-size:0.8em;"+l+":5px;position:absolute;} "+s+"form { position:absolute;z-index:20;display:block;overflow:hidden;"+d+":#ddd;"+l+":10px;"+p+o+" } "+s+"_dismiss { float:right;"+l+": 0 5px 0 5px;margin:0px;font-weight:bold;cursor:pointer;color:black;margin-right:-5px;margin-top:-5px; } "+s+"form input,"+s+"form .divider { display:inline-block;font-size:1em;text-align:center;margin-right:2px; } "+s+"form .divider { margin-top: 5px; "+l+": 2px;} "+s+"button { "+c+":#e9e9e9; width: 1.5em; line-height: 1.5em; color: "+e+"; cursor: pointer; display: block; padding: 0px; text-align: center; color: #000000; font-size: 1em; } "+s+"_help_key:active{ "+c+":#e9e9e9; } "+s+"_help_key:hover{ border-color: #b0b0b0; } "+s+"_help_key { cursor:pointer;display:inline-block;text-align:center;"+c+":"+e+";"+c+":-moz-linear-gradient(top,"+e+","+n+");"+c+":-webkit-gradient(linear,center top,center bottom,from("+e+"),to("+n+"));"+h+"-webkit-"+c+"-clip:"+l+"-box;-moz-"+c+"-clip:"+l+";"+c+"-clip:"+l+"-box;color:#303030;border:1px solid #e0e0e0;border-bottom-width:2px;white-space:nowrap;font-family:monospace;"+l+":1px 6px;font-size:1.1em;}</style>"),this.pointers=[],this.dragging=!1,this.x="",this.y="",this.theta=0,this.skygrad=null,this.infobox="virtualsky_infobox",this.container="",this.times=this.astronomicalTimes(),this.id&&this.createSky(),l=this.moonPos(this.times.JD),this.moon=l.moon,this.sun=l.sun,this.islive)window.setInterval(function(t){t.setClock("now")},1e3,this);return this}function r(t,i){if(i){for(;t<0;)t+=360;for(;t>360;)t-=360}else{for(var s=2*Math.PI;t<0;)t+=s;for(;t>s;)t-=s}return t}function h(t,i){return i?(t>=90&&(t=89.99999),t<=-90&&(t=-89.99999)):(t>=Math.PI/2&&(t=Math.PI/2*.999999),t<=-Math.PI/2&&(t=-Math.PI/2*.999999)),t}function l(t,i,s,e,a,n){var o,r,h,l;return h=t.ctx,"az"==i?l=t.azel2xy(s-t.az_off*t.d2r,e,t.wide,t.tall):"eq"==i?l=t.radec2xy(s,e):"ec"==i?l=t.ecliptic2xy(s,e,t.times.LST):"gal"==i&&(l=t.gal2xy(s,e)),o=l.x,r=l.y,("az"==i||!!t.isVisible(l.el))&&isFinite(o)&&isFinite(r)&&("az"==i?((!a.moved||Math.sqrt(Math.pow(a.x-o,2)+Math.pow(a.y-r,2))>t.tall/2)&&h.moveTo(o,r),h.lineTo(o,r),a.moved=!0):!a.moved||Math.sqrt(Math.pow(a.x-o,2)+Math.pow(a.y-r,2))>n?(h.moveTo(o,r),a.moved=!0):h.lineTo(o,r),a.x=o,a.y=r),a}s.supportsFullScreen&&(s.fullScreenEventName=s.prefix+"fullscreenchange",s.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;case"ms":return null!=document.msFullscreenElement;default:return document[this.prefix+"FullScreen"]}},s.requestFullScreen=function(t){return""===this.prefix?t.requestFullScreen():"ms"===this.prefix?t.msRequestFullscreen():t[this.prefix+"RequestFullScreen"]()},s.cancelFullScreen=function(t){switch(this.prefix){case"":return document.cancelFullScreen();case"ms":return document.msExitFullscreen();default:return document[this.prefix+"CancelFullScreen"]()}}),window.fullScreenApi=s,o.prototype.init=function(t){if(!t)return this;var s,e,a,n=location.search;if(n&&"#"!=n){var o=n.replace(/^\?|\&$/g,"").split("&");for(a=0;a<o.length;a++)s=o[a].split("=")[0],e=o[a].split("=")[1],/^-?[0-9.]+$/.test(e)&&(e=parseFloat(e)),"true"==e&&(e=!0),"false"==e&&(e=!1),void 0===t[s]&&(t[s]=e)}var r="number",h="string",l="boolean",c="object",d="function",p={id:h,gradient:l,cardinalpoints:l,negative:l,meteorshowers:l,showstars:l,scalestars:r,showstarlabels:l,starnames:c,showplanets:l,showplanetlabels:l,showorbits:l,showgalaxy:l,showdate:l,showposition:l,keyboard:l,mouse:l,ground:l,ecliptic:l,meridian:l,magnitude:r,clock:c,background:h,color:h,fov:r,objects:h,base:h,fullscreen:l,credit:l,transparent:l,plugins:c,lang:h};for(s in p)i(t[s],p[s])&&(this[s]=t[s]);return i(t.projection,h)&&this.selectProjection(t.projection),i(t.constellations,l)&&(this.constellation.lines=t.constellations),i(t.constellationboundaries,l)&&(this.constellation.boundaries=t.constellationboundaries),i(t.constellationlabels,l)&&(this.constellation.labels=t.constellationlabels),i(t.constellationwidth,r)&&(this.constellation.lineWidth=t.constellationwidth),i(t.constellationboundarieswidth,r)&&(this.constellation.boundaryWidth=t.constellationboundarieswidth),i(t.gridlines_az,l)&&(this.grid.az=t.gridlines_az),i(t.gridlines_eq,l)&&(this.grid.eq=t.gridlines_eq),i(t.gridlines_gal,l)&&(this.grid.gal=t.gridlines_gal),i(t.gridstep,r)&&(this.grid.step=t.gridstep),i(t.gridlineswidth,r)&&(this.grid.lineWidth=t.gridlineswidth),i(t.galaxywidth,r)&&(this.gal.lineWidth=t.galaxywidth),i(t.longitude,r)&&this.setLongitude(t.longitude),i(t.latitude,r)&&this.setLatitude(t.latitude),i(t.clock,h)&&this.updateClock(new Date(t.clock.replace(/%20/g," "))),i(t.az,r)&&(this.az_off=t.az%360-180),i(t.ra,r)&&this.setRA(t.ra),i(t.dec,r)&&this.setDec(t.dec),i(t.planets,h)&&(this.file.planets=t.planets),i(t.planets,c)&&(this.planets=t.planets),i(t.lines,h)&&(this.file.lines=t.lines),i(t.lines,c)&&(this.lines=t.lines),i(t.boundaries,h)&&(this.file.boundaries=t.boundaries),i(t.boundaries,c)&&(this.boundaries=t.boundaries),i(t.width,r)&&(this.wide=t.width),i(t.height,r)&&(this.tall=t.height),i(t.live,l)&&(this.islive=t.live),i(t.lang,h)&&2==t.lang.length&&(this.language=t.lang),i(t.fontfamily,h)&&(this.fntfam=t.fontfamily.replace(/%20/g," ")),i(t.fontsize,h)&&(this.fntsze=t.fontsize),i(t.lang,h)&&(this.setlang=t.lang),i(t.callback,c)&&(i(t.callback.geo,d)&&(this.callback.geo=t.callback.geo),i(t.callback.click,d)&&(this.callback.click=t.callback.click),i(t.callback.mouseenter,d)&&(this.callback.mouseenter=t.callback.mouseenter),i(t.callback.mouseout,d)&&(this.callback.mouseout=t.callback.mouseout),i(t.callback.cursor,d)&&(this.callback.cursor=t.callback.cursor),i(t.callback.contextmenu,d)&&(this.callback.contextmenu=t.callback.contextmenu)),this},o.prototype.loadLanguage=function(t,i,s){t=t||this.language;var e="";this.langs[t]&&(e=t),e||(t=t.indexOf("-")>0?t.substring(0,t.indexOf("-")):t.substring(0,2),s?e=t:this.langs[t]&&(e=t)),(t=e)||(t="en");var a=this.langurl.replace("%LANG%",t);return this.loadJSON(a,function(s){if(this.langcode=t,this.langs[t]=s,this.langs[t].loaded=!0,s.starnames)for(var e in s.starnames)s.starnames[e]&&(this.starnames[e]=s.starnames[e]);this.changeLanguage(t),"function"==typeof i&&i.call(this)},function(t){},function(s){"en"!=t&&this.loadLanguage("en",i)}),this},o.prototype.changeLanguage=function(t,i){return this.langs[t]?(this.langs[t].loaded?(this.lang=this.langs[t],this.langcode=t,this.drawImmediate(),"function"==typeof i&&i.call(this)):this.loadLanguage(t,i),this):(this.lang=this.langs.en,this)},o.prototype.htmlDecode=function(t){if(!t)return"";var i=document.createElement("div");return i.innerHTML=t,i.childNodes[0].nodeValue},o.prototype.getPhrase=function(t,s){if(void 0!==t)return"constellations"!==t?"planets"===t?this.lang.planets&&this.lang.planets[s]?this.htmlDecode(this.lang.planets[s]):this.htmlDecode(this.lang[s]):this.htmlDecode(this.lang[t])||this.htmlDecode(this.langs.en[t])||"":s&&i(this.lang.constellations[s],"string")?this.htmlDecode(this.lang.constellations[s]):void 0},o.prototype.resize=function(t,i){this.canvas&&(t&&i?this.container.css({width:t+"px",height:i+"px"}):this.fullscreen?(this.canvas.css({width:0,height:0}),t=window.innerWidth,i=window.innerHeight,this.canvas.css({width:t+"px",height:i+"px"})):(this.canvas.css({width:0,height:0}),t=this.container.outerWidth(),i=this.container.outerHeight(),this.canvas.css({width:t+"px",height:i+"px"})),t==this.wide&&i==this.tall||(this.setWH(t,i),this.positionCredit(),this.updateSkyGradient(),this.drawImmediate(),this.container.css({"font-size":this.fontsize()+"px"}),this.trigger("resize",{vs:this})))},o.prototype.setWH=function(t,i){t&&i&&(this.c.width=t,this.c.height=i,this.wide=t,this.tall=i,this.changeFOV(),this.canvas.css({width:t+"px",height:i+"px"}))},o.prototype.changeFOV=function(t){var i=this.fov;return t>0?i/=1.05:t<0&&(i*=1.05),this.setFOV(i)},o.prototype.setFOV=function(t){return this.fov=t>60||"number"!=typeof t?60:t<1?1:t,this.maxangle=this.d2r*this.fov*Math.max(this.wide,this.tall)/this.tall,this.maxangle=Math.min(this.maxangle,Math.PI/2),this},o.prototype.hide=function(){return this.container.hide(),this},o.prototype.show=function(){return this.container.show(),this},o.prototype.toggle=function(){return this.container.toggle(),this},o.prototype.convertStarsToRadians=function(t){for(var i=0;i<t.length;i++)t[i][2]*=this.d2r,t[i][3]*=this.d2r;return t},o.prototype.load=function(t,i,s){return this.loadJSON(i,function(i){if("stars"==t)for(this.starsdeep=!0,this.stars=this.stars.concat(this.convertStarsToRadians(i.stars)),this.lookup.star=[],a=0;a<this.stars.length;a++)this.lookup.star.push({ra:this.stars[a][2],dec:this.stars[a][3],label:this.stars[a][0],mag:this.stars[a][1]});else this[t]=i[t];this.draw(),this.trigger("loaded"+(t.charAt(0).toUpperCase()+t.slice(1)),{data:i})},s)},o.prototype.loadJSON=function(i,s,e,a){if("string"!=typeof i)return this;var n=i.match(/\.json$/i)?"json":"script";if("script"==n){var o=s;s=function(t){for(var i=0;i<this.plugins.length;++i)"function"==typeof this.plugins[i].init&&this.plugins[i].init.call(this);o.call(this,t)}}var r={dataType:n,this:this,success:s,complete:e||function(){},error:a||function(){}};return"json"==n&&(r.jsonp="onJSONPLoad"),"script"==n&&(r.cache=!0),t(document).ajax(this.base+i,r),this},o.prototype.debug=function(i){if(1==t("#debug").length){var s="debug-"+(new Date).valueOf();t("#debug").append('<span id="'+s+'">'+i+"</span> "),setTimeout(function(){t("#"+s).remove()},1e3)}return this},o.prototype.checkLoaded=function(){return!this.planets&&this.showplanets&&this.load("planets",this.file.planets),!this.lines&&this.constellation.lines&&this.load("lines",this.file.lines),!this.boundaries&&this.constellation.boundaries&&this.load("boundaries",this.file.boundaries),!this.showers&&this.meteorshowers&&this.load("showers",this.file.showers),!this.galaxy&&this.showgalaxy&&this.load("galaxy",this.file.galaxy),this},o.prototype.createSky=function(){this.container=t("#"+this.id),this.times=this.astronomicalTimes(),this.q.debug&&t("body").append('<div style="position: absolute;bottom:0px;right:0px;padding: 0.25em 0.5em;background-color:white;color:black;max-width: 50%;" id="debug"></div>'),this.fntfam&&this.container.css({"font-family":this.fntfam}),this.fntsze&&this.container.css({"font-size":this.fntsze}),0==this.container.length&&(t("body").append('<div id="'+this.id+'"></div>'),this.container=t("#"+this.id)),this.container.css("position","relative");var i,s,e,a,n=this;if(window.onresize=function(){n.resize()},this.checkLoaded(),this.changeMagnitude(0),this.objects){var o=this.objects.split(";");for(i=0;i<o.length;i++)o[i]=o[i].search(/\.json$/)>=0?{url:o[i],src:"file",type:"json"}:{url:"https://www.strudel.org.uk/lookUP/json/?name="+o[i],src:"lookup",type:"jsonp"};var r=0,l=!0;for(i=0;i<o.length;i++)"lookup"==o[i].src&&r++,r>5&&(l=!1),(l||"lookup"!=o[i].src)&&t(document).ajax(o[i].url,{dataType:o[i].type,this:this,success:function(t){void 0===t.length&&(t=[t]);for(var i=0;i<t.length;i++)t[i]&&t[i].dec&&t[i].ra&&this.addPointer({ra:t[i].ra.decimal,dec:t[i].dec.decimal,label:t[i].target.name,colour:this.col.pointers}),this.draw()}})}if(this.wide>0&&this.container.css({width:this.wide+"px"}),this.wide=this.container.width(),this.tall>0&&this.container.css({height:this.tall+"px"}),this.tall=this.container.height()-0,this.idinner=this.id+"_inner",this.container.html('<canvas id="'+this.idinner+'" style="display:block;"></canvas>'),this.canvas=t("#"+this.idinner),this.c=document.getElementById(this.idinner),this.excanvas&&(this.c=G_vmlCanvasManager.initElement(this.c)),this.c&&this.c.getContext){this.setWH(this.wide,this.tall);var c=this.ctx=this.c.getContext("2d");c.clearRect(0,0,this.wide,this.tall),c.beginPath();var d=this.fontsize();c.font=d+"px Helvetica",c.fillStyle="rgb(0,0,0)",c.lineWidth=1.5;c.fillText("Loading sky...",(c.wide-c.measureText("Loading sky...").width)/2,(this.tall-d)/2),c.fill();var p=this.callback.contextmenu?{longPressStart:function(t,i){p.longPressStop(),this.longPressTimer=window.setTimeout(function(){this.longPressTimer=void 0,this.dragging=!1,this.x="",this.y="",this.theta="",p.click(t,i)},400/** 400ms for long press */)}.bind(this),longPressStop:function(){void 0!==this.longPressTimer&&(window.clearTimeout(this.longPressTimer),this.longPressTimer=void 0)}.bind(this)}:void 0;function u(t,i){t.matched=i.whichPointer(t.x,t.y);var s=i.xy2radec(t.x,t.y);return s&&(t.ra=s.ra/i.d2r,t.dec=s.dec/i.d2r),t}function g(t,i,s,e){return e.x=i.pageX-s.offset().left-window.scrollX,e.y=i.pageY-s.offset().top-window.scrollY,u(e,t)}t("#"+this.idinner).on("click",{sky:this},function(i){i.data.sky.debug("click");var s=g(i.data.sky,i.originalEvent,this,i);s.matched&&i.data.sky.toggleInfoBox(s.matched),s.matched>=0&&t(i.data.sky.canvas).css({cursor:"pointer"}),i.data.sky.callback.click&&i.data.sky.callback.click.call(i.data.sky,g(i.data.sky,i.originalEvent,this,i))}).on("contextmenu",{sky:this},function(t){t.data.sky.callback.contextmenu&&(t.preventDefault(),t.data.sky.callback.contextmenu.call(t.data.sky,g(t.data.sky,t.originalEvent,this,t)))}).on("dblclick",{sky:this},function(t){t.data.sky.debug("dblclick"),t.data.sky.toggleFullScreen()}).on("mousemove",{sky:this},function(t){t.preventDefault(),t.data.sky.debug("mousemove");var i,s,e,a,n=t.data.sky,o=t.originalEvent.layerX,r=t.originalEvent.layerY;if(n.mouse&&n.canvas.css({cursor:"move"}),n.dragging&&n.mouse?(n.polartype?(i=Math.atan2(r-n.tall/2,o-n.wide/2),n.theta||(n.theta=i),n.az_off-=(n.theta-i)*n.r2d,n.theta=i):"gnomic"==n.projection.id?(s=n.fov*n.d2r*.0015,e=0,"number"==typeof n.x&&(e=Math.min(Math.abs(n.x-o)*s/Math.cos(n.dc_off),Math.PI/36)),"number"==typeof n.y&&(n.dc_off-=(n.y-r)*s),n.ra_off-=(n.x-o>0?1:-1)*e,n.dc_off=h(n.dc_off)):"number"==typeof n.x&&(n.az_off+=(n.x-o)/4),n.az_off=n.az_off%360,n.x=o,n.y=r,n.draw(),n.canvas.css({cursor:"-moz-grabbing"})):(a=n.whichPointer(o,r),n.toggleInfoBox(a)),"function"==typeof n.callback.cursor){var l=g(t.data.sky,t.originalEvent,this,t);t.data.sky.callback.cursor.call(this,l)}}).on("mousedown",{sky:this},function(t){1===t.originalEvent.buttons?(t.data.sky.debug("mousedown"),t.data.sky.dragging=!0):2===t.originalEvent.buttons&&this.trigger("contextmenu",t)}).on("mouseup",{sky:this},function(t){t.data.sky.debug("mouseup");var i=t.data.sky;i.dragging=!1,i.x="",i.y="",i.theta=""}).on("mouseout",{sky:this},function(t){t.data.sky.debug("mouseout");var i=t.data.sky;i.dragging=!1,i.mouseover=!1,i.x="",i.y="","function"==typeof i.callback.mouseout&&i.callback.mouseout.call(i)}).on("mouseenter",{sky:this},function(t){t.data.sky.debug("mouseenter");var i=t.data.sky;i.mouseover=!0,"function"==typeof i.callback.mouseenter&&i.callback.mouseenter.call(i)}).on("touchmove",{sky:this},function(t){t.preventDefault(),p&&p.longPressStop();var i,s,e,a=t.data.sky,n=t.originalEvent.touches[0].pageX,o=t.originalEvent.touches[0].pageY;t.data.sky.debug("touchmove "+n+","+o+" "+a.x+","+a.y),a.dragging&&(a.polartype?(i=Math.atan2(o-a.tall/2,n-a.wide/2),a.theta||(a.theta=i),a.az_off-=(a.theta-i)*a.r2d,a.theta=i):"gnomic"==a.projection.id?(s=a.fov*a.d2r*.0015,e=0,"number"==typeof a.x&&(e=Math.min(Math.abs(a.x-n)*s/Math.cos(a.dc_off),Math.PI/36)),"number"==typeof a.y&&(a.dc_off-=(a.y-o)*s),a.ra_off-=(a.x-n>0?1:-1)*e,a.dc_off=h(a.dc_off)):"number"==typeof a.x&&(a.az_off+=(a.x-n)/4),a.az_off=a.az_off%360,a.x=n,a.y=o,a.draw())}).on("touchstart",{sky:this},function(t){if(t.data.sky.debug("touchstart"),t.data.sky.dragging=!0,p){var i=t.originalEvent.touches[0].pageX,s=t.originalEvent.touches[0].pageY;i=i-this.offset().left-window.scrollX,s=s-this.offset().top-window.scrollY,p.longPressStart(i,s),t.data.sky.callback.click&&(t.x=i,t.y=s,t.data.sky.callback.click.call(t.data.sky,u(t,t.data.sky)))}}).on("touchend",{sky:this},function(t){t.data.sky.debug("touchend"),t.data.sky.dragging=!1,t.data.sky.x="",t.data.sky.y="",t.data.sky.theta="",p&&p.longPressStop()}).on((s="mousewheel",e=document.createElement("div"),(a=(s="on"+s)in e)||(e.setAttribute(s,"return;"),a="function"==typeof e[s]),e=null,a?"mousewheel":"wheel"),{sky:this},function(t){t.preventDefault(),t.data.sky.debug("mousewheel");var i=-(t.originalEvent.deltaY||t.originalEvent.wheelDelta);i||(i=0);var s=t.data.sky;return!s.mouse||"gnomic"!=s.projection.id||(s.changeFOV(i).draw(),!1)}),t(document).on("keypress",{sky:this},function(t,i){t||(t=window.event);var s=t.originalEvent,e=s.keyCode||s.charCode||s.which||0;t.data.sky.keypress(e,t.originalEvent)})}this.registerKey("a",function(){this.toggleAtmosphere()},"atmos"),this.registerKey("g",function(){this.toggleGround()},"ground"),this.registerKey("h",function(){this.cycleProjection()},"projection"),this.registerKey("i",function(){this.toggleNegative()},"neg"),this.registerKey(",",function(){this.toggleEcliptic()},"ec"),this.registerKey(";",function(){this.toggleMeridian()},"meridian"),this.registerKey("e",function(){this.toggleGridlinesEquatorial()},"eq"),this.registerKey("z",function(){this.toggleGridlinesAzimuthal()},"az"),this.registerKey("m",function(){this.toggleGridlinesGalactic()},"gal"),this.registerKey("M",function(){this.toggleGalaxy()},"galaxy"),this.registerKey("q",function(){this.toggleCardinalPoints()},"cardinal"),this.registerKey("s",function(){this.toggleStars()},"stars"),this.registerKey("S",function(){this.toggleStarLabels()},"starlabels"),this.registerKey("u",function(){this.togglePlanetLabels()},"sollabels"),this.registerKey("p",function(){this.togglePlanetHints()},"sol"),this.registerKey("o",function(){this.toggleOrbits()},"orbits"),this.registerKey("c",function(){this.toggleConstellationLines()},"con"),this.registerKey("v",function(){this.toggleConstellationLabels()},"names"),this.registerKey("b",function(){this.toggleConstellationBoundaries()},"conbound"),this.registerKey("R",function(){this.toggleMeteorShowers()},"meteorshowers"),this.registerKey("1",function(){this.toggleHelp()}),this.registerKey("8",function(){this.setClock("now").calendarUpdate()},"reset"),this.registerKey("j",function(){this.islive||this.spinIt("down")},"slow"),this.registerKey("k",function(){this.spinIt(0)},"stop"),this.registerKey("l",function(){this.islive||this.spinIt("up")},"fast"),this.registerKey("-",function(){this.setClock(-86400).calendarUpdate()},"subtractday"),this.registerKey("=",function(){this.setClock(86400).calendarUpdate()},"addday"),this.registerKey("[",function(){this.setClock(-604800).calendarUpdate()},"subtractweek"),this.registerKey("]",function(){this.setClock(604800).calendarUpdate()},"addweek"),this.registerKey(37,function(){this.az_off-=2,this.draw()},"azleft"),this.registerKey(39,function(){this.az_off+=2,this.draw()},"azright"),this.registerKey(38,function(){this.changeMagnitude(.25)},"magup"),this.registerKey(40,function(){this.changeMagnitude(-.25)},"magdown"),this.registerKey(63,function(){this.toggleHelp()}),this.drawImmediate()},o.prototype.changeMagnitude=function(t){return"number"!=typeof t?this:(this.magnitude+=t,!this.starsdeep&&this.magnitude>4?this.load("stars",this.file.stars):this.draw(),this)},o.prototype.toggleHelp=function(){var i="virtualsky";if(t("."+i+"_dismiss").length>0)t("."+i+"_dismiss").trigger("click");else{var s,e="";for(s=0;s<this.keys.length;s++)this.keys[s].txt&&(e+='<li><strong class="'+i+"_help_key "+i+"_"+this.keys[s].txt+'">'+this.keys[s].str+'</strong> → <a href="#" class="'+i+"_"+this.keys[s].txt+'" style="text-decoration:none;">'+this.getPhrase(this.keys[s].txt)+"</a></li>");this.container.append('<div class="'+i+'_help"><div class="'+i+'_dismiss" title="'+this.getPhrase("close")+'">×</div><div style="margin-bottom: 0.5em;">'+this.getPhrase("keyboard")+'</div><div class="'+i+'_helpinner"><ul></ul></div><div style="font-size:0.8em;margin-top: 0.5em;">'+this.lang.title+": "+this.version+"</div></div>");var a=t("."+i+"_help"),n=a.outerHeight();for(a.find("ul").html(e),t("."+i+"_helpinner").css({overflow:"auto","max-height":this.tall-n+"px"}),s=0;s<this.keys.length;s++)this.keys[s].txt&&t("."+i+"_"+this.keys[s].txt).on("click",{fn:this.keys[s].fn,me:this},function(t){t.preventDefault(),t.data.fn.call(t.data.me)});this.createLightbox(t("."+i+"_help")),t("."+i+"_help, ."+i+"_bg").on("mouseout",{sky:this},function(t){t.data.sky.mouseover=!1}).on("mouseenter",{sky:this},function(t){t.data.sky.mouseover=!0})}},o.prototype.registerKey=function(t,s,e){if(!i(s,"function"))return this;var a,n,o,r,h,l;for(i(t,"object")||(t=[t]),o=0;o<t.length;o++){if(h=!1,"string"==typeof t[o])0==t[o].indexOf("alt")?(l=t[o],h=!0,t[o]=t[o].substring(4)):l=t[o],n=t[o].charCodeAt(0);else{n=t[o];l=this.getPhrase({37:"left",38:"up",39:"right",40:"down"}[n])||String.fromCharCode(n)}for(a=!0,r=0;r<this.keys.length;r++)this.keys.charCode==n&&this.keys.altKey==h&&(a=!1);a&&this.keys.push({str:l,charCode:n,char:String.fromCharCode(n),fn:s,txt:e,altKey:h})}return this},o.prototype.keypress=function(t,i){if(i||(i={altKey:!1}),this.mouseover&&this.keyboard)for(var s=0;s<this.keys.length;s++)if(this.keys[s].charCode==t&&i.altKey==this.keys[s].altKey){this.keys[s].fn.call(this,{event:i});break}},o.prototype.nearestObject=function(t,i){var s,e,a,n,o,r;(e={}).matched=this.whichPointer(t,i);var h=this.xy2radec(t,i);for(a in h&&(e.ra=h.ra/this.d2r,e.dec=h.dec/this.d2r),n=1e100,r={},this.lookup)if(this.lookup[a])for(s=0;s<this.lookup[a].length;s++)(o=this.greatCircle(h.ra,h.dec,this.lookup[a][s].ra,this.lookup[a][s].dec))<n&&(r={distance:o,label:this.lookup[a][s].label+"",type:a,data:this.lookup[a][s]},n=o);return r.distance/=this.d2r,"star"==r.type&&(r.label=this.lang.starnames[r.label]||"HIP"+r.label),r},o.prototype.whichPointer=function(t,i){for(var s=0;s<this.pointers.length;s++)if(Math.abs(t-this.pointers[s].x)<5&&Math.abs(i-this.pointers[s].y)<5)return s;return-1},o.prototype.toggleInfoBox=function(i){if(0==this.pointers.length||i>=this.pointers.length||i>=0&&!this.pointers[i].html)return this;t("#"+this.id+"_"+this.infobox).length<=0&&this.container.append('<div id="'+this.id+"_"+this.infobox+'" class="'+this.infobox+'" style="display:none;"></div>');var s=t("#"+this.id+"_"+this.infobox);if(i>=0&&this.isVisible(this.pointers[i].el)&&this.pointers[i].x>0&&this.pointers[i].y>0&&this.pointers[i].x<this.wide&&this.pointers[i].y<this.tall){s.html(this.pointers[i].html);var e=Math.round(this.pointers[i].x-Math.round(s.outerWidth()/2))+"px",a=Math.round(this.pointers[i].y-Math.round(s.outerHeight()/2))+"px";s.css({position:"absolute",left:e,top:a,"z-index":10,display:"block"})}else s.css({display:"none"})},o.prototype.coord2horizon=function(t,i){var s,e,a,n,o,r;return s=Math.PI*this.times.LST/12-t,n=Math.sin(i),o=Math.sin(this.latitude.rad),r=Math.cos(this.latitude.rad),e=Math.asin(n*o+Math.cos(i)*r*Math.cos(s)),a=Math.acos((n-Math.sin(e)*o)/(Math.cos(e)*r)),Math.sin(s)>0&&(a=2*Math.PI-a),[e,a]},o.prototype.horizon2coord=function(t){function i(t){var i=2*Math.PI;return t<0?t-Math.floor(t/i)*i:t>=i?t-Math.floor(t/i)*i:t}function s(t){var s=i(t);return s>=Math.PI?s-2*Math.PI:s}const e=function(t){return{alt:s(Math.asin(t[0])),az:i(Math.atan2(t[1],t[2]))}}(function(t,i,s){const e=[[1,2],[0,2],[0,1]],a=e[i.id][0],n=e[i.id][1],o=Math.cos(s),r=Math.sin(s),h=JSON.parse(JSON.stringify(t));return h[a]=t[a]*o-t[n]*r,h[n]=t[n]*o+t[a]*r,h}(function(t){var i=Math.sin(t.alt);const s=Math.cos(t.alt);var e=s*Math.cos(t.az);return[i,s*Math.sin(t.az),e]}({az:t[1],alt:t[0]}),{id:1},Math.PI/2+this.latitude.rad));return{ra:s(e.az)+Math.PI*this.times.LST/12,dec:-e.alt}},o.prototype.selectProjection=function(i){if(this.projections[i]&&(this.projection=this.projections[i],this.projection.id=i,this.fullsky=1==this.projection.fullsky,this.polartype=1==this.projection.polartype,"function"==typeof this.projection.azel2xy?this.azel2xy=this.projection.azel2xy:this.azel2xy=function(t,i,s,e){return s||(s=this.wide),e||(e=this.tall),t<0&&(t+=360),{x:-1,y:-1,el:-1}},"function"==typeof this.projection.azel2radec?this.azel2radec=this.projection.azel2radec:this.azel2radec=function(t,i){var s,e,a,n;return n=this.latitude.rad,s=Math.asin(Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos(t)),(a=(Math.sin(i)-Math.sin(n)*Math.sin(s))/(Math.cos(n)*Math.cos(s)))>1&&(a=1),e=Math.acos(a),Math.sin(t)>0&&(e=2*Math.PI-e),s*=this.r2d,e*=this.r2d,{ra:e=(15*this.times.LST-e+360)%360,dec:s}},this.ctx&&this.updateSkyGradient(),this.updateColours(),this.container)){var s=this.lang.projections&&this.lang.projections[i]?this.lang.projections[i]:this.projections[i].title;t("."+this.id+"_projection").length>0&&t("."+this.id+"_projection").remove(),this.container.append('<div class="'+this.id+'_projection">'+s+"</div>");var e=t("."+this.id+"_projection");e.on("mouseover",{me:this},function(t){t.data.me.mouseover=!0}).css({position:"absolute",padding:0,height:"2em",top:"50%",left:"50%",transform:"translate3D(-50%,-50%,0)","text-align":"center","line-height":"2em","z-index":20,"font-size":"1.5em",display:"block",overflow:"hidden","background-color":"transparent",color:this.negative?this.col.black:this.col.white,opacity:1}),setTimeout(function(t){t.fadeOut(1e3,function(){this.remove()})},500,e)}},o.prototype.cycleProjection=function(){var t,i=!1,s=this.projection.id,e=0;for(var a in this.projections)if(this.projections[a]){if(0==e&&(t=a),i){s=a;break}a==this.projection.id&&(i=!0),e++}s==this.projection.id&&(s=t),this.drawImmediate(s)},o.prototype.updateColours=function(){this.col=JSON.parse(JSON.stringify(this.negative?this.colours.negative:this.colours.normal)),""==this.color?(this.polartype||this.projection.altlabeltext)&&(this.col.txt=this.col.grey):this.col.txt=this.color},o.prototype.isVisible=function(t){return"function"==typeof this.projection.isVisible?this.projection.isVisible.call(t):this.fullsky&&!this.ground||t>0},o.prototype.isPointBad=function(t){return-1==t.x&&-1==t.y},o.prototype.astronomicalTimes=function(t,i){var s,e,a,n,o;return t=t||this.clock,i=i||this.longitude.deg,s=this.getJD(t),(a=(6.697374558+2400.051336*(e=(Math.floor(s-.5)+.5-2451545)/36525)+25862e-9*e*e)%24)<0&&(a+=24),(n=(a+=1.002737909*(((t.getUTCMilliseconds()/1e3+t.getUTCSeconds())/60+t.getUTCMinutes())/60+t.getUTCHours()))%24)<0&&(n+=24),o=(n+i/15)/24,(o-=Math.floor(o))<0&&(o+=1),{GST:n,LST:24*o,JD:s}},o.prototype.moonPos=function(t,i){var s,e,a,n,o,r,h,l,c,d,p,u,g,f,y,m,v,b,x,w,k;return s=this.d2r,t=t||this.times.JD,e=91.929336,a=130.143076,n=291.682547,o=5.145396,.0549,(r=(13.1763966*(i=i||this.sunPos(t)).D+e)%360)<0&&(r+=360),(h=(r-.1114041*i.D-a)%360)<0&&(h+=360),(l=(n-.0529539*i.D)%360)<0&&(l+=360),c=r-i.lon,g=h+(d=1.2739*Math.sin((2*c-h)*s))-(u=.1858*(p=Math.sin(i.Mo*s)))-.37*p,m=((f=r+d+6.2886*Math.sin(g*s)-u+.214*Math.sin(2*g*s))+.6583*Math.sin(2*(f-i.lon)*s)-(y=l-.16*p))*s,b=(v=Math.sin(m))*Math.cos(o*s),x=Math.cos(m),w=Math.atan2(b,x)/s+y,k=Math.asin(v*Math.sin(o*s))/s,w>360&&(w-=360),{moon:{lon:w,lat:k},sun:i}},o.prototype.sunPos=function(t){var i,s,e,a,n,o;return s=283.112438,e=.016705,(a=360/365.242191*(i=t-2455196.5)%360)<0&&(a+=360),(n=(a+279.557208-s)%360)<0&&(n+=360),(o=n+360/Math.PI*e*Math.sin(n*Math.PI/180)+s)>360&&(o-=360),0,{lat:0,lon:o,Mo:n,D:i,N:a}},o.prototype.meanObliquity=function(t){var i,s;return t||(t=this.times.JD),(23.4392917-.0130041667*(i=(t-2451545)/36525)-1.6667e-7*(s=i*i)+5.027778e-7*(s*i))*this.d2r},o.prototype.ecliptic2azel=function(t,i,s,e){var a,n,o,r,h,l,c,d,p,u,g,f,y,m,v,b,x,w,k;return s||(this.times=this.astronomicalTimes(),s=this.times.LST),e||(e=this.latitude.rad),a=Math.sin(t),n=Math.cos(t),o=Math.sin(i),h=[n*(r=Math.cos(i)),a*r,o],l=this.meanObliquity(),p=[[1,0,0],[0,c=Math.cos(l),-(d=Math.sin(l))],[0,d,c]],u=this.vectorMultiply(p,h),g=15*s*this.d2r,m=[[f=Math.cos(g),y=Math.sin(g),0],[y,-f,0],[0,0,1]],v=this.vectorMultiply(m,u),w=[[-(b=Math.sin(e)),0,x=Math.cos(e)],[0,-1,0],[x,0,b]],k=this.vectorMultiply(w,v),{az:Math.atan2(k[1],k[0]),el:Math.asin(k[2])}},o.prototype.ecliptic2radec=function(t,i,s){var e=this.meanObliquity(),a=Math.sin(t),n=Math.cos(t),o=Math.sin(i),r=Math.cos(i),h=Math.tan(i),l=Math.sin(e),c=Math.cos(e),d=Math.atan2(a*c-h*l,n),p=Math.asin(o*c+r*l*a);return d<0&&(d+=Math.PI+Math.PI),{ra:d,dec:p}},o.prototype.ecliptic2xy=function(t,i,s){var e;if(s=s||this.times.LST,"function"==typeof this.projection.ecliptic2xy)return this.projection.ecliptic2xy.call(this,t,i,s);if(this.fullsky)return e=this.ecliptic2radec(t,i),this.radec2xy(e.ra,e.dec);var a=(e=this.ecliptic2azel(t,i,s)).el*this.r2d;return(e=this.azel2xy(e.az-this.az_off*this.d2r,e.el,this.wide,this.tall)).el=a,e},o.prototype.radec2xy=function(t,i){if("function"==typeof this.projection.radec2xy)return this.projection.radec2xy.call(this,t,i);var s=this.coord2horizon(t,i),e=this.azel2xy(s[1]-this.az_off*this.d2r,s[0],this.wide,this.tall);return{x:e.x,y:e.y,az:s[1]*this.r2d,el:s[0]*this.r2d}},o.prototype.xy2radec=function(t,i){if("function"==typeof this.projection.xy2radec)return this.projection.xy2radec.call(this,t,i);if("function"==typeof this.projection.xy2azel){var s=this.projection.xy2azel(t,i,this.wide,this.tall);if(void 0===s)return;var e=[s[1],s[0]+this.az_off*this.d2r];return this.horizon2coord(e)}},o.prototype.azel2xy=function(t,i,s,e){return{x:-1,y:-1}},o.prototype.azel2radec=function(t,i){return{ra:0,dec:0}},o.prototype.gal2xy=function(t,i){var s=this.gal2radec(t,i);return this.radec2xy(s[0],s[1])},o.prototype.gal2radec=function(t,i){return this.Transform([t,i],[-.054875539726,.494109453312,-.867666135858,-.87343710801,-.444829589425,-.198076386122,-.483834985808,.74698225181,.455983795705],!1)},o.prototype.Transform=function(t,i,s){s&&(t[0]*=this.d2r,t[1]*=this.d2r);var e=Math.cos(t[1]),a=[Math.cos(t[0])*e,Math.sin(t[0])*e,Math.sin(t[1])],n=[a[0]*i[0]+a[1]*i[1]+a[2]*i[2],a[0]*i[3]+a[1]*i[4]+a[2]*i[5],a[0]*i[6]+a[1]*i[7]+a[2]*i[8]],o=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]),r=Math.asin(n[2]/o),h=Math.cos(r),l=Math.atan2(n[1]/o/h,n[0]/o/h);return l<0&&(l+=2*Math.PI),s?[l*this.r2d,r*this.r2d]:[l,r]},o.prototype.fk1tofk5=function(t,i){return this.Transform([t,i],[.9995358730015703,-.02793693620138929,-.012147682028606801,.027936935758478665,.9996096732234282,-.00016976035344812515,.012147683047201562,-.00016968744936278707,.9999261997781408])},o.prototype.vectorMultiply=function(t,i){if(i.length>0)return i[0].length>0?[[t[0][0]*i[0][0]+t[0][1]*i[1][0]+t[0][2]*i[2][0],t[0][0]*i[0][1]+t[0][1]*i[1][1]+t[0][2]*i[2][1],t[0][0]*i[0][2]+t[0][1]*i[1][2]+t[0][2]*i[2][2]],[t[1][0]*i[0][0]+t[1][1]*i[1][0]+t[1][2]*i[2][0],t[1][0]*i[0][1]+t[1][1]*i[1][1]+t[1][2]*i[2][1],t[1][0]*i[0][2]+t[1][1]*i[1][2]+t[1][2]*i[2][2]],[t[2][0]*i[0][0]+t[2][1]*i[1][0]+t[2][2]*i[2][0],t[2][0]*i[0][1]+t[2][1]*i[1][1]+t[2][2]*i[2][1],t[2][0]*i[0][2]+t[2][1]*i[1][2]+t[2][2]*i[2][2]]]:[t[0][0]*i[0]+t[0][1]*i[1]+t[0][2]*i[2],t[1][0]*i[0]+t[1][1]*i[1]+t[1][2]*i[2],t[2][0]*i[0]+t[2][1]*i[1]+t[2][2]*i[2]]},o.prototype.setFont=function(){this.ctx.font=this.fontsize()+"px "+this.canvas.css("font-family")},o.prototype.fontsize=function(){if(this.fntsze)return parseInt(this.fntsze);var t=Math.min(this.wide,this.tall);return t<600?t<500?t<350?t<300?t<250?9:10:11:12:14:parseInt(this.container.css("font-size"))},o.prototype.positionCredit=function(){this.container.find("."+this.id+"_credit").css({position:"absolute",top:parseFloat(this.tall)-this.padding-this.fontsize()+"px",left:this.padding+"px"})},o.prototype.updateSkyGradient=function(){var t=null;return this.ctx&&this.hasGradient()&&(this.projection.polartype?"function"==typeof this.ctx.createRadialGradient&&((t=this.ctx.createRadialGradient(this.wide/2,this.tall/2,0,this.wide/2,this.tall/2,this.tall/2)).addColorStop(0,"rgba(0,0,0,1)"),t.addColorStop(.7,"rgba(0,0,0,0.2)"),t.addColorStop(1,"rgba(0,50,80,0.3)")):((t=this.ctx.createLinearGradient(0,0,0,this.tall)).addColorStop(0,"rgba(0,30,50,0.1)"),t.addColorStop(.7,"rgba(0,30,50,0.35)"),t.addColorStop(1,"rgba(0,50,80,0.6)"))),this.skygrad=t,this},o.prototype.draw=function(){void 0===this.pendingRefresh&&(this.pendingRefresh=window.setTimeout(this.drawImmediate.bind(this),20))},o.prototype.drawImmediate=function(i){if(void 0!==this.pendingRefresh&&(window.clearTimeout(this.pendingRefresh),this.pendingRefresh=void 0),this.wide<=0||this.tall<=0)return this;if(!this.c||!this.c.getContext)return this;void 0!==i&&this.selectProjection(i);var s,e,a,n,o,r,h=this.col.white,l=this.col.black,c=this.ctx,d=this.container;for(c.moveTo(0,0),c.clearRect(0,0,this.wide,this.tall),c.fillStyle=this.polartype||this.fullsky?this.background:this.negative?h:l,c.fillRect(0,0,this.wide,this.tall),c.fill(),this.polartype?(c.moveTo(this.wide/2,this.tall/2),c.closePath(),c.beginPath(),c.arc(this.wide/2,this.tall/2,this.tall/2-.5,0,2*Math.PI,!0),c.closePath(),this.transparent||(c.fillStyle=this.hasGradient()?"rgba(0,15,30, 1)":this.negative?h:l,c.fill()),c.lineWidth=.5,c.strokeStyle=l,c.stroke()):"function"==typeof this.projection.draw&&this.projection.draw.call(this),this.hasGradient()&&(this.skygrad?(c.beginPath(),c.fillStyle=this.skygrad,this.projection.polartype?(c.arc(this.wide/2,this.tall/2,this.tall/2,0,2*Math.PI,!1),c.fill()):c.fillRect(0,0,this.wide,this.tall),c.closePath()):this.updateSkyGradient()),this.startClip().drawGridlines("az").drawGridlines("eq").drawGridlines("gal").drawGalaxy().drawConstellationLines().drawConstellationBoundaries().drawStars().drawEcliptic().drawMeridian().drawPlanets().drawMeteorShowers().endClip().drawCardinalPoints(),s=0;s<this.pointers.length;s++)this.highlight(s);var p=""!=this.color?this.color:this.col.txt,u=this.fontsize();if(c.fillStyle=p,c.lineWidth=1.5,this.setFont(),this.container.css({"font-size":this.fontsize()+"px",position:"relative"}),this.showdate&&(a=this.clock.toLocaleDateString(this.langcode,{weekday:"long",year:"numeric",month:"long",day:"numeric"})+" "+this.clock.toLocaleTimeString(this.langcode),n=this.drawText(a,this.padding,this.padding+u)),this.showposition&&(o=Math.abs(this.latitude.deg).toFixed(2)+(this.latitude.rad>0?this.getPhrase("N"):this.getPhrase("S"))+", "+Math.abs(this.longitude.deg).toFixed(2)+(this.longitude.rad>0?this.getPhrase("E"):this.getPhrase("W")),r=this.drawText(o,this.padding,this.padding+u+u)),this.credit){var g=this.getPhrase("power"),f=this.drawText(g,this.padding,this.tall-this.padding);0==d.find("."+this.id+"_credit").length&&d.append('<div class="'+this.id+'_credit"><a href="http://slowe.github.io/VirtualSky/" target="_parent" title="Las Cumbres Observatory">'+this.getPhrase("powered")+"</a></div>"),d.find("."+this.id+"_credit").css({padding:0,"z-index":20,display:"block",overflow:"hidden","background-color":"transparent"}),d.find("."+this.id+"_credit a").css({display:"block",width:Math.ceil(f)+"px",height:u+"px"}),this.positionCredit()}if(this.showhelp){0==d.find("."+this.id+"_help").length&&d.append('<div class="'+this.id+'_help"><a href="#">?</a></div>').find("."+this.id+"_help").css({position:"absolute",padding:this.padding+"px","z-index":20,display:"block",overflow:"hidden","background-color":"transparent",right:"0px",top:"0px"}).find("a").css({"text-decoration":"none",color:p}).on("click",{me:this},function(t){t.data.me.toggleHelp()}),d.find("."+this.id+"_help").find("a").css({color:p})}return 0==this.container.find("."+this.id+"_btn_help").length&&(this.container.append('<div class="'+this.id+'_btn_help virtualskybutton" title="'+this.getPhrase("help")+'">?</div>'),e=t("#"+this.idinner).position(),this.container.find("."+this.id+"_btn_help").css({position:"absolute",top:e.top+this.padding+"px",right:this.padding+"px","z-index":20}).on("click",{me:this},function(t){t.data.me.toggleHelp()})),0==this.container.find("."+this.id+"_clock").length&&(this.container.append('<div class="'+this.id+'_clock" title="'+this.getPhrase("datechange")+'">'+a+"</div>"),e=t("#"+this.idinner).position(),this.container.find("."+this.id+"_clock").css({position:"absolute",padding:"0px",width:Math.round(n)+"px",cursor:"pointer",top:e.top+this.padding+"px",left:e.left+this.padding+"px","z-index":20,display:"block",overflow:"hidden","background-color":"transparent",color:"transparent"}).on("click",{sky:this},function(i){var s=i.data.sky,e=s.id,a="#"+e,n="virtualsky";if(0==t(a+"_calendar").length){var o=280;s.wide<o&&(o=s.wide),s.container.append('<div id="'+e+'_calendar" class="'+n+'form"><div style="" id="'+e+'_calendar_close" class="'+n+'_dismiss" title="'+s.getPhrase("close")+'">×</div><div style="text-align:center;margin:2px;">'+s.getPhrase("date")+'</div><div style="text-align:center;"><input type="date" id="'+e+'_date" value="'+s.clock.getFullYear()+"-"+(s.clock.getMonth()<9?"0":"")+(s.clock.getMonth()+1)+"-"+(s.clock.getDate()<10?"0":"")+s.clock.getDate()+'" /><input type="time" id="'+e+'_time" value="'+(s.clock.getHours()<10?"0":"")+s.clock.getHours()+":"+(s.clock.getMinutes()<10?"0":"")+s.clock.getMinutes()+'" /></div></div>'),t(a+"_calendar").css({width:o}),t(a+"_calendar input").on("change",{sky:s},function(i){var s=t("#"+e+"_date").val(),a=t("#"+e+"_time").val();i.data.sky.updateClock(new Date(parseInt(s.substr(0,4)),parseInt(s.substr(5,2))-1,parseInt(s.substr(8,2)),parseInt(a.substr(0,2)),parseInt(a.substr(3,2)),0,0)),i.data.sky.calendarUpdate(),i.data.sky.draw()})}s.createLightbox(t(a+"_calendar")),t(a+"_year").val(s.clock.getFullYear()),t(a+"_month").val(s.clock.getMonth()+1),t(a+"_day").val(s.clock.getDate()),t(a+"_hours").val(s.clock.getHours()),t(a+"_mins").val(s.clock.getMinutes())})),0==t("."+this.id+"_position").length&&(this.container.append('<div class="'+this.id+'_position" title="'+this.getPhrase("positionchange")+'">'+o+"</div>"),t("."+this.id+"_position").on("click",{sky:this},function(i){var s=i.data.sky,e=s.id,a="#"+e,n="virtualsky";if(0==t(a+"_geo").length){var o=310,r="";s.wide<o&&(r='<br style="clear:both;margin-top:20px;" />',o/=2),s.container.append('<div id="'+e+'_geo" class="'+n+'form"><div id="'+e+'_geo_close" class="'+n+'_dismiss" title="'+s.getPhrase("close")+'">×</div><div style="text-align:center;margin:2px;">'+s.getPhrase("position")+'</div><div style="text-align:center;"><input type="text" id="'+e+'_lat" value="" style="padding-right:10px!important;"><div class="divider">'+s.getPhrase("N")+"</div>"+r+'<input type="text" id="'+e+'_long" value="" /><div class="divider">'+s.getPhrase("E")+"</div></div></div>"),t(a+"_geo").css({width:o+"px",align:"center"}),t(a+"_geo input").css({width:"6em"})}s.createLightbox(t(a+"_geo"),{close:function(i){this.vs&&this.vs.setGeo(t(a+"_lat").val()+","+t(a+"_long").val()).setClock(0).draw()}}),t(a+"_lat").val(s.latitude.deg),t(a+"_long").val(s.longitude.deg),"function"==typeof s.callback.geo&&s.callback.geo.call(s)})),e=t("#"+this.idinner).position(),t("."+this.id+"_position").css({position:"absolute",padding:0,width:Math.round(r)+"px",cursor:"pointer",top:e.top+this.padding+u+"px",left:e.left+this.padding+"px","z-index":20,display:"block",overflow:"hidden","background-color":"transparent",color:"transparent"}),this},o.prototype.startClip=function(){return this.polartype&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(this.wide/2,this.tall/2,this.tall/2-.5,0,2*Math.PI,!0),this.ctx.clip()),this},o.prototype.endClip=function(){return this.polartype&&this.ctx.restore(),this},o.prototype.createLightbox=function(i,s){if(!i.length)return this;function e(t,i,s){this.lb=t,this.vs=i,this.opts=s||{};var e="virtualsky_bg";0==this.vs.container.find("."+e).length&&this.vs.container.append('<div class="'+e+'" style="position:absolute;z-index:99;left:0px;top:0px;right:0px;bottom:0px;background-color:rgba(0,0,0,0.7);"></div>');var a=this.vs.container.find("."+e);return a.length>0&&a.show(),this.bg=a,this.vs.container.find(".virtualsky_dismiss").on("click",{lb:this},function(t){t.data.lb.close()}),a.on("click",{lightbox:this},function(t){t.data.lightbox.close()}),this.vs.on("resize",function(t){this.lightbox&&this.lightbox.resize()}),this.resize(),this}return s||(s={}),e.prototype.resize=function(){return function(i,s){this.lb.css({width:"100%"}),this.lb.find("ul").css({width:""}).find("li").css({display:"inline-block","margin-left":"0px",width:""});for(var e=this.lb.parent().width(),a=this.lb.find("ul li"),n=1,o=0;o<a.length;o++)n=Math.max(n,t(a[o]).outerWidth());var r=Math.floor(e/(n+24));r>1?(r>3&&(r=3),this.lb.find("li").css({width:100/r+"%","border-left":Math.floor(12)+"px solid transparent","box-sizing":"border-box"}),this.lb.find("li:nth-child("+r+"n+1)").css({"margin-left":"0px"})):this.lb.find("li").css({display:"block",width:""}),this.lb.find("ul").css({width:"100%"}).parent().css({width:e<=500?"100%":Math.min(e-24,(n+12)*r+24)+"px"}),this.lb.css({width:e<=500?"100%":""})}.call(this,this.vs.wide,this.vs.tall),this.lb.css({position:"relative",left:"50%",top:"50%",transform:"translate3d(-50%,-50%,0)","max-height":"100%","box-sizing":"border-box","z-index":100,position:"absolute"}),this},e.prototype.close=function(){return"function"==typeof this.opts.close&&this.opts.close.call(this),this.lb.remove(),this.bg.remove(),this.vs.lightbox=null,this},this.lightbox=new e(i,this,s),this},o.prototype.drawStars=function(){if(!this.showstars&&!this.showstarlabels)return this;var t,i,s,e,a,n,o=this.ctx;o.beginPath(),o.fillStyle=this.col.stars,this.az_off=(this.az_off+360)%360,a=this.hasAtmos(),n=Math.sqrt(30/this.fov);var r=1;for(this.negative&&(r*=1.4),"number"==typeof this.scalestars&&1!=this.scalestars&&(r*=this.scalestars),"gnomic"===this.projection.id&&(r*=n),i=0;i<this.stars.length;i++)this.stars[i][1]<this.magnitude&&(t=this.stars[i][1],s=this.radec2xy(this.stars[i][2],this.stars[i][3]),!this.isVisible(s.el)||isNaN(s.x)||this.isPointBad(s)||(e=.8*Math.max(3-t/2.1,.5),a&&(e*=Math.exp(.01*-(90-s.el))),e*=r,o.moveTo(s.x+e,s.y),this.showstars&&o.arc(s.x,s.y,e,0,2*Math.PI,!0),this.showstarlabels&&this.starnames[this.stars[i][0]]&&this.drawLabel(s.x,s.y,e,"",this.htmlDecode(this.starnames[this.stars[i][0]]))));return o.fill(),this},o.prototype.hasAtmos=function(){return"boolean"==typeof this.projection.atmos&&this.gradient?this.projection.atmos:this.gradient},o.prototype.hasGradient=function(){return!(!this.hasAtmos()||this.fullsky||this.negative)},o.prototype.interpolate=function(t,i){for(var s,e,a,n,o,r,h=t,l=0,c=0;c<i.length;c+=4){var d=t-i[c];Math.abs(d)<Math.abs(h)&&(h=d,l=c)}return h>=0?(n=l+1+4,o=l+1,r=h/Math.abs(i[n-1]-i[o-1])):(n=l+1,o=l+1-4,r=1+h/Math.abs(i[n-1]-i[o-1])),n>i.length||o<0?(s=i[l+1],e=i[l+2],a=i[l+3]):(s=Math.abs(i[n]-i[o])>180?(i[o]+(i[n]+360-i[o])*r)%360:(i[o]+(i[n]-i[o])*r)%360,e=i[o+1]+(i[n+1]-i[o+1])*r,a=i[o+2]+(i[n+2]-i[o+2])*r),{ra:s,dec:e,mag:a}},o.prototype.drawPlanets=function(){if(!this.showplanets&&!this.showplanetlabels&&!this.showorbits)return this;if(!this.planets||this.planets.length<=0)return this;var t,i,s,e,n,o=this.ctx,r=this.jd;this.jd=this.times.JD;var h=this.col.grey,l=this.maxLine();for(this.lookup.planet=[],n=0;n<this.planets.length;n++)if(this.planets[n]){if(3==this.planets[n].length){if(this.planets[n][2].length%4==0){if(!(this.jd>this.planets[n][2][0]&&this.jd<this.planets[n][2][this.planets[n][2].length-4]))continue;var c=this.interpolate(this.jd,this.planets[n][2]);t=c.ra,i=c.dec,s=c.mag}}else t=this.planets[n][2],i=this.planets[n][3];if(this.lookup.planet.push({ra:t*this.d2r,dec:i*this.d2r,label:this.lang.planets?this.lang.planets[this.planets[n][0]]:"?"}),e=this.radec2xy(t*this.d2r,i*this.d2r),this.negative||(h=this.planets[n][1]),"string"==typeof h&&(o.strokeStyle=h),(this.showplanets||this.showplanetlabels)&&this.isVisible(e.el)&&s<this.magnitude&&!this.isPointBad(e)){var d=0;void 0!==s&&(d=.8*Math.max(3-s/2,.5),this.hasAtmos()&&(d*=Math.exp(-(90-e.el)*this.d2r*.6))),d<1.5&&(d=1.5),this.drawPlanet(e.x,e.y,d,h,this.planets[n][0])}if(this.showorbits&&s<this.magnitude){o.beginPath(),o.lineWidth=.5,this.setFont(),o.lineWidth=1;var p={x:-1,y:-1,el:-1};for(a=0;a<this.planets[n][2].length-4;a+=4){var u=this.radec2xy(this.planets[n][2][a+1]*this.d2r,this.planets[n][2][a+2]*this.d2r);p.x>0&&p.y>0&&this.isVisible(u.el)&&(o.moveTo(p.x,p.y),Math.abs(u.x-p.x)<l&&o.lineTo(u.x,u.y)),p=u}o.stroke()}}return(this.showplanets||this.showplanetlabels)&&(r!=this.jd&&(n=this.moonPos(this.jd),this.moon=n.moon,this.sun=n.sun),this.sun&&(e=this.ecliptic2xy(this.sun.lon*this.d2r,this.sun.lat*this.d2r,this.times.LST),this.isVisible(e.el)&&!this.isPointBad(e)&&(this.drawPlanet(e.x,e.y,5,this.col.sun,"sun"),this.lookup.sun=[this.ecliptic2radec(this.sun.lon*this.d2r,this.sun.lat*this.d2r,this.times.LST)],this.lookup.sun[0].label=this.lang.sun)),this.moon&&(e=this.ecliptic2xy(this.moon.lon*this.d2r,this.moon.lat*this.d2r,this.times.LST),this.isVisible(e.el)&&!this.isPointBad(e)&&(this.drawPlanet(e.x,e.y,5,this.col.moon,"moon"),this.lookup.moon=[this.ecliptic2radec(this.moon.lon*this.d2r,this.moon.lat*this.d2r,this.times.LST)],this.lookup.moon[0].label=this.lang.moon))),this},o.prototype.drawPlanet=function(t,i,s,e,a){var n=this.ctx;return n.beginPath(),n.fillStyle=e,n.strokeStyle=e,n.moveTo(t+s,i+s),this.showplanets&&n.arc(t,i,s,0,2*Math.PI,!0),a=this.getPhrase("planets",a),this.showplanetlabels&&this.drawLabel(t,i,s,e,a),n.fill(),this},o.prototype.drawText=function(t,i,s){return this.ctx.beginPath(),this.ctx.fillText(t,i,s),this.ctx.measureText(t).width},o.prototype.drawLabel=function(t,i,s,e,a){if(void 0===a)return this;var n=this.ctx;e.length>0&&(n.fillStyle=e),n.lineWidth=1.5;var o=s;return this.polartype&&n.measureText&&(o=-n.measureText(a).width-3),this.polartype&&t<this.wide/2&&(o=s),n.fillText(a,t+o,i-(s+2)),this},o.prototype.drawConstellationLines=function(t){if(!this.constellation.lines&&!this.constellation.labels)return this;t||(t=this.col.constellation);var i=this.ctx;i.beginPath(),i.strokeStyle=t,i.fillStyle=t,i.lineWidth=this.constellation.lineWidth||.75;var s,e,a,n,o,r,h,l,c,d=this.fontsize();if(this.setFont(),"object"!=typeof this.lines)return this;for(var p=this.maxLine(),u=0;u<this.lines.length;u++){if(this.constellation.lines)for(r=3;r<this.lines[u].length;r+=2){if(n=-1,o=-1,h=""+this.lines[u][r],l=""+this.lines[u][r+1],!this.hipparcos[h])for(c=0;c<this.stars.length;c++)if(this.stars[c][0]==this.lines[u][r]){this.hipparcos[h]=c;break}if(!this.hipparcos[l])for(c=0;c<this.stars.length;c++)if(this.stars[c][0]==this.lines[u][r+1]){this.hipparcos[l]=c;break}n=this.hipparcos[h],o=this.hipparcos[l],n>=0&&o>=0&&n<this.stars.length&&o<this.stars.length&&(e=this.radec2xy(this.stars[n][2],this.stars[n][3]),a=this.radec2xy(this.stars[o][2],this.stars[o][3]),this.isVisible(e.el)&&this.isVisible(a.el)&&(this.isPointBad(e)||this.isPointBad(a)||Math.abs(e.x-a.x)<p&&Math.abs(e.y-a.y)<p&&(i.moveTo(e.x,e.y),i.lineTo(a.x,a.y))))}if(this.constellation.labels&&(s=this.radec2xy(this.lines[u][1]*this.d2r,this.lines[u][2]*this.d2r),this.isVisible(s.el))){var g=this.getPhrase("constellations",this.lines[u][0]),f=i.measureText?-i.measureText(g).width/2:0;i.fillText(g,s.x+f,s.y-d/2),i.fill()}}return i.stroke(),this},o.prototype.drawConstellationBoundaries=function(t){if(!this.constellation.boundaries)return this;if(t||(t=this.col.constellationboundary),this.ctx.beginPath(),this.ctx.strokeStyle=t,this.ctx.fillStyle=t,this.ctx.lineWidth=this.constellation.boundaryWidth||.75,this.ctx.lineCap="round","object"!=typeof this.boundaries)return this;var i,s,e,a,n,o,r,h,l,c,d,p,u,g,f,y,m;h="",l="";var v=5,b=this.maxLine(5);this.constellation.bpts||(this.constellation.bpts=new Array(this.boundaries.length));var x=[];for(o=0;o<this.boundaries.length;o++)if("string"!=typeof this.boundaries&&o<this.boundaries.length){if(this.constellation.bpts[o])m=this.constellation.bpts[o];else{for(m=[],n=1;n<this.boundaries[o].length;n+=2){if(a=[this.boundaries[o][n],this.boundaries[o][n+1]],e&&(h=e[0]+","+e[1]+"-"+a[0]+","+a[1],l=a[0]+","+a[1]+"-"+e[0]+","+e[1]),n>1)for(void 0===(c=x[h]||x[l])&&(c=!0),(u=(a[0]-e[0])%360)>180&&(u-=360),u<-180&&(u+=360),g=a[1]-e[1],u/2>(v=c?5:2)&&(v=parseInt(u)),g/2>v&&(v=parseInt(g)),f=u/v,y=g/v,d=1;d<=v;d++)(u=e[0]+d*f)<0&&(u+=360),g=e[1]+d*y,r=this.fk1tofk5(u*this.d2r,g*this.d2r),m.push([r[0],r[1],c]);x[h]=!0,x[l]=!0,e=a}this.constellation.bpts[o]=m}for(i=null,d=0;d<=m.length;d++)p=d==m.length?0:d,s=this.radec2xy(m[p][0],m[p][1]),i&&this.isVisible(i.el)&&this.isVisible(s.el)&&m[p][2]&&(this.isPointBad(i)||this.isPointBad(s)||Math.abs(i.x-s.x)<b&&Math.abs(i.y-s.y)<b&&(this.ctx.moveTo(i.x,i.y),this.ctx.lineTo(s.x,s.y))),i=s}return x=[],this.ctx.stroke(),this},o.prototype.drawGalaxy=function(t){if(!this.galaxy||!this.showgalaxy)return this;var i,s,e,a,n,o,r,h;for(t||(t=this.col.galaxy),this.ctx.beginPath(),this.ctx.strokeStyle=t,this.ctx.fillStyle=t,this.ctx.lineWidth=this.gal.lineWidth||.75,this.ctx.lineJoin="round",o=this.maxLine(5),n=0;n<this.galaxy.length;n++){if(!this.gal.processed)for(a=1;a<this.galaxy[n].length;a++)this.galaxy[n][a]*=this.d2r;for((i=this.galaxy[n].slice(0)).shift(),s=null,a=0;a<i.length;a+=2)e=this.radec2xy(i[a],i[a+1]),0==a?this.ctx.moveTo(e.x,e.y):(r=Math.abs(s.x-e.x),h=Math.abs(s.y-e.y),isNaN(r)||isNaN(h)?this.ctx.moveTo(e.x,e.y):((r>=o||h>=o)&&this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(e.x,e.y))),s=e}return this.gal.processed=!0,this.ctx.stroke(),this},o.prototype.drawMeteorShowers=function(t){if(!this.meteorshowers||"string"==typeof this.showers)return this;var i,s,e,a,n,o,r,h,l,c,d;t||(t=this.col.showers),(a=this.ctx).beginPath(),a.strokeStyle=t,a.fillStyle=t,a.lineWidth=this.grid.lineWidth||.75;var p=this.fontsize();this.setFont();var u=this.clock.getFullYear();for(var g in this.lookup.meteorshower=[],this.showers)this.showers[g]&&(n=this.showers[g].date,o=this.showers[g].pos,(r=new Date(u,n[0][0]-1,n[0][1]))>(h=new Date(u,n[1][0]-1,n[1][1]))&&this.clock<r&&(r=new Date(u-1,n[0][0]-1,n[0][1])),this.clock>r&&this.clock<h&&(l=o[1][0]-o[0][0],c=o[1][1]-o[0][1],d=(this.clock-r)/(h-r),i=this.radec2xy((this.showers[g].pos[0][0]+l*d)*this.d2r,(this.showers[g].pos[0][1]+c*d)*this.d2r),this.isVisible(i.el)&&(s=this.htmlDecode(this.showers[g].name),e=a.measureText?-a.measureText(s).width/2:0,a.moveTo(i.x+2,i.y),a.arc(i.x,i.y,2,0,2*Math.PI,!0),a.fillText(s,i.x+e,i.y-p/2),this.lookup.meteorshower.push({ra:(this.showers[g].pos[0][0]+l*d)*this.d2r,dec:(this.showers[g].pos[0][1]+c*d)*this.d2r,label:s}))));return a.fill(),this},o.prototype.drawEcliptic=function(t){if(!this.ecliptic)return this;t&&"string"==typeof t||(t=this.col.ec);var i=this.ctx,s=2*this.d2r;i.beginPath(),i.strokeStyle=t,i.lineWidth=3;for(var e=this.maxLine(),a={x:-1,y:-1,moved:!1},n=0;n<2*Math.PI;n+=s)a=l(this,"ec",n,0,a,e);return i.stroke(),this},o.prototype.drawMeridian=function(t){if(!this.meridian)return this;t&&"string"==typeof t||(t=this.col.meridian);var i,s=this.ctx,e="number"==typeof this.projection.maxb?this.projection.maxb*this.d2r:Math.PI/2,a=2*this.d2r,n=this.maxLine();s.beginPath(),s.strokeStyle=t,s.lineWidth=2;var o={x:-1,y:-1,moved:!1};for(i=0,0;i<=e;i+=a)o=l(this,"az",Math.PI,i,o,n);for(i=e,0;i>=0;i-=a)o=l(this,"az",0,i,o,n);return s.stroke(),this},o.prototype.drawGridlines=function(t,i,s){if(!t||!this.grid[t])return this;var e,a,n,o,r,h,c,d;for("string"!=typeof s&&(s=this.col[t]),"number"!=typeof i&&(i=this.grid.step),0,0,(c=this.ctx).beginPath(),c.strokeStyle=s,c.lineWidth=this.grid.lineWidth||1,d=2,"az"==t?(e="number"==typeof this.projection.maxb?this.projection.maxb:90-d,a=0):a=-(e=90-d),n=this.maxLine(5),o={x:-1,y:-1,moved:!1},i*=this.d2r,d*=this.d2r,a*=this.d2r,e*=this.d2r,r=0;r<2*Math.PI;r+=i)for(o.moved=!1,h=a;h<=e;h+=d)o=l(this,t,r,h,o,n);for(c.stroke(),c.beginPath(),"az"==t?(a=0,e=90-d*this.r2d):(a=i*this.r2d-90,e=90),a*=this.d2r,e*=this.d2r,o={x:-1,y:-1,moved:!1},h=a;h<e;h+=i)for(o.moved=!1,r=0;r<=2*Math.PI;r+=d)o=l(this,t,r,h,o,n);return c.stroke(),this},o.prototype.drawCardinalPoints=function(){if(!this.cardinalpoints)return this;var t,i,s,e,a,n,o,r,h=new Array(0,90,180,270),l=[this.getPhrase("N"),this.getPhrase("E"),this.getPhrase("S"),this.getPhrase("W")],c=this.ctx;c.beginPath(),c.fillStyle=this.col.cardinal;var d=this.fontsize();for(t=0;t<h.length;t++)r=c.measureText&&(o=c.measureText(l[t])).width>d?o.width/2:d/2,a=(h[t]-this.az_off)*this.d2r,this.polartype?(i=-(n=this.tall/2-1.5*r)*Math.sin(a),s=-n*Math.cos(a),i=isFinite(i)?this.wide/2+i-r:0,s=isFinite(s)?this.tall/2+s+r:0):(e=this.azel2xy(a,0,this.wide,this.tall),i=isFinite(e.x)?e.x-r:0,s=isFinite(e.y)?e.y-7.5:0,(i<0||i>this.wide-15)&&(i=-r)),i>0&&c.fillText(l[t],i,s);return c.fill(),this},o.prototype.highlight=function(t,i){var s=this.pointers[t];if(this.pointers[t].ra&&this.pointers[t].dec){i=s.colour||i||"rgba(255,0,0,1)",this.negative&&(i=this.getNegative(i));var e=this.radec2xy(s.ra*this.d2r,s.dec*this.d2r),a=this.ctx;this.isVisible(e.el)&&(s.az=e.az,s.el=e.el,s.x=e.x,s.y=e.y,a.fillStyle=i,a.strokeStyle=i,a.beginPath(),a.fillRect(s.x-s.d/2,s.y-s.d/2,s.d,s.d),a.fill(),this.drawLabel(s.x,s.y,s.d,i,s.label))}return this},o.prototype.maxLine=function(t){return"gnomic"===this.projection.id?this.tall:("number"!=typeof t&&(t=3),this.tall/t)},o.prototype.setGeo=function(t){return"string"!=typeof t?this:(t=t.split(","),this.setLatitude(t[0]),this.setLongitude(t[1]),this)},o.prototype.setLatitude=function(t){return this.latitude={deg:parseFloat(t),rad:h(parseFloat(t)*this.d2r)},this},o.prototype.setLongitude=function(t){for(this.longitude={deg:parseFloat(t),rad:parseFloat(t)*this.d2r};this.longitude.rad<=-Math.PI;)this.longitude.rad+=2*Math.PI;for(;this.longitude.rad>Math.PI;)this.longitude.rad-=2*Math.PI;return this},o.prototype.toggleFullScreen=function(){return s.isFullScreen()?(s.cancelFullScreen(this.container[0]),this.fullscreen=!1,this.container.removeClass("fullscreen")):(s.requestFullScreen(this.container[0]),this.fullscreen=!0,this.container.addClass("fullscreen")),this},o.prototype.setRADec=function(t,i){return this.setRA(t).setDec(i)},o.prototype.setRA=function(t){return this.ra_off=t%360*this.d2r,this},o.prototype.setDec=function(t){return this.dc_off=t*this.d2r,this},o.prototype.panTo=function(t,i,s){return s||(s=1e3),"number"!=typeof t||"number"!=typeof i?this:(this.panning={s:{ra:this.ra_off*this.r2d,dec:this.dc_off*this.r2d},e:{ra:t,dec:i},duration:s,start:new Date},this.panning.dr=this.panning.e.ra-this.panning.s.ra,this.panning.dd=this.panning.e.dec-this.panning.s.dec,this.panning.dr>180&&(this.panning.dr=-(360-this.panning.dr)),this.panning.dr<-180&&(this.panning.dr=360+this.panning.dr),this.panStep())},window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},o.prototype.panStep=function(){var t,i,s=(new Date-this.panning.start)/this.panning.duration;if(t=this.panning.s.ra+this.panning.dr*s,i=this.panning.s.dec+this.panning.dd*s,s<1){this.setRADec(t,i).draw();var e=this;requestAnimFrame(function(){e.panStep()})}else this.setRADec(this.panning.e.ra,this.panning.e.dec).draw();return this},o.prototype.liveSky=function(t){return this.islive=!this.islive,this.islive?interval=window.setInterval(function(t){t.setClock("now")},1e3,this):void 0!==interval&&clearInterval(interval),this},o.prototype.start=function(){this.islive=!0,void 0!==interval&&clearInterval(interval),interval=window.setInterval(function(t){t.setClock("now")},1e3,this)},o.prototype.stop=function(){this.islive=!1,void 0!==interval&&clearInterval(interval)},o.prototype.advanceTime=function(t,i){if(void 0===t)this.updateClock(new Date);else{t=parseFloat(t),i||(i=1e3/this.fps);clearInterval(this.interval_time),clearInterval(this.interval_calendar),this.interval_time=window.setInterval(function(t,i){t.setClock(i)},i,this,t),this.interval_calendar=window.setInterval(function(t){t.calendarUpdate()},1e3,this)}return this},o.prototype.updateClock=function(t){this.clock=t,this.times=this.astronomicalTimes()},o.prototype.calendarUpdate=function(){for(var t=0;t<this.calendarevents.length;t++)i(this.calendarevents[t],"function")&&this.calendarevents[t].call(this);return this},o.prototype.setClock=function(t){return void 0===t?this:("string"==typeof t?(t=function(t){var i={A:1,ACDT:10.5,ACST:9.5,ADT:-3,AEDT:11,AEST:10,AKDT:-8,AKST:-9,AST:-4,AWST:8,B:2,BST:1,C:3,CDT:-5,CEDT:2,CEST:2,CET:1,CST:-6,CXT:7,D:4,E:5,EDT:-4,EEDT:3,EEST:3,EET:2,EST:-5,F:6,G:7,GMT:0,H:8,HAA:-3,HAC:-5,HADT:-9,HAE:-4,HAP:-7,HAR:-6,HAST:-10,HAT:-2.5,HAY:-8,HNA:-4,HNC:-6,HNE:-5,HNP:-8,HNR:-7,HNT:-3.5,HNY:-9,I:9,IST:9,JST:9,K:10,L:11,M:12,MDT:-6,MESZ:2,MEZ:1,MST:-7,N:-1,NDT:-2.5,NFT:11.5,NST:-3.5,O:-2,P:-3,PDT:-7,PST:-8,Q:-4,R:-5,S:-6,T:-7,U:-8,UTC:0,UT:0,V:-9,W:-10,WEDT:1,WEST:1,WET:0,WST:8,X:-11,Y:-12,Z:0},s=t.lastIndexOf(" ");if(s>0&&i[t.substr(s+1)])return t.substring(0,s)+" "+function(t){var i=t>=0?"+":"-",s=60*((t=Math.abs(t))-Math.floor(t));return t=Math.floor(t),i+(t<10?"0"+t:t)+(s<10?"0"+s:s)}(i[t.substr(s+1)]);return t}(t),this.input.clock?(this.updateClock("string"==typeof this.input.clock?this.input.clock.replace(/%20/g," "):this.input.clock),"string"==typeof this.clock&&this.updateClock(new Date(this.clock))):"now"===t?this.updateClock(new Date):this.updateClock(new Date(t))):"object"==typeof t?this.updateClock(t):this.updateClock(new Date(this.clock.getTime()+1e3*t)),this.draw(),this)},o.prototype.toggleAtmosphere=function(){return this.gradient=!this.gradient,this.draw(),this},o.prototype.toggleStars=function(){return this.showstars=!this.showstars,this.draw(),this},o.prototype.toggleStarLabels=function(){return this.showstarlabels=!this.showstarlabels,this.draw(),this},o.prototype.toggleNegative=function(){return this.negative=!this.negative,this.col=this.colours[this.negative?"negative":"normal"],this.draw(),this},o.prototype.toggleConstellationLines=function(){return this.constellation.lines=!this.constellation.lines,this.checkLoaded(),this.draw(),this},o.prototype.toggleConstellationBoundaries=function(){return this.constellation.boundaries=!this.constellation.boundaries,this.checkLoaded(),this.draw(),this},o.prototype.toggleConstellationLabels=function(){return this.constellation.labels=!this.constellation.labels,this.checkLoaded(),this.draw(),this},o.prototype.toggleCardinalPoints=function(){return this.cardinalpoints=!this.cardinalpoints,this.draw(),this},o.prototype.toggleGridlinesAzimuthal=function(){return this.grid.az=!this.grid.az,this.draw(),this},o.prototype.toggleGridlinesEquatorial=function(){return this.grid.eq=!this.grid.eq,this.draw(),this},o.prototype.toggleGridlinesGalactic=function(){return this.grid.gal=!this.grid.gal,this.draw(),this},o.prototype.toggleEcliptic=function(){return this.ecliptic=!this.ecliptic,this.draw(),this},o.prototype.toggleMeridian=function(){return this.meridian=!this.meridian,this.draw(),this},o.prototype.toggleGround=function(){return this.ground=!this.ground,this.draw(),this},o.prototype.toggleGalaxy=function(){return this.showgalaxy=!this.showgalaxy,this.checkLoaded(),this.draw(),this},o.prototype.toggleMeteorShowers=function(){return this.meteorshowers=!this.meteorshowers,this.checkLoaded(),this.draw(),this},o.prototype.togglePlanetHints=function(){return this.showplanets=!this.showplanets,this.draw(),this},o.prototype.togglePlanetLabels=function(){return this.showplanetlabels=!this.showplanetlabels,this.draw(),this},o.prototype.toggleOrbits=function(){return this.showorbits=!this.showorbits,this.draw(),this},o.prototype.toggleAzimuthMove=function(t){return 0===this.az_step?(this.az_step="number"==typeof t?t:-1,this.moveIt()):(this.az_step=0,void 0!==this.timer_az&&clearTimeout(this.timer_az)),this},o.prototype.addPointer=function(t){for(var s,e,a,n,o,r,h=-1,l=0;l<this.pointers.length;l++)this.pointers[l].ra==t.ra&&this.pointers[l].dec==t.dec&&this.pointers[l].label==t.label&&(h=l);return h<0&&(t.ra*=1,t.dec*=1,l=this.pointers.length,(r=t).d=i(r.d,"number")?r.d:5,"string"!=typeof r.html&&(s=r.style||"width:128px;height:128px;",e=r.url||"http://server1.wikisky.org/v2?ra="+r.ra/15+"&de="+r.dec+"&zoom=6&img_source=DSS2",a=r.img||"http://server7.sky-map.org/imgcut?survey=DSS2&w=128&h=128&ra="+r.ra/15+"&de="+r.dec+"&angle=0.25&output=PNG",n=r.credit||"View in Wikisky",o=r.credit||"DSS2/Wikisky",r.html=r.html||'<div class="virtualsky_infocredit"><a href="'+e+'" style="color: white;">'+o+'</a></div><a href="'+e+'" style="display:block;'+s+'"><img src="'+a+'" style="border:0px;'+s+'" title="'+n+'" /></a>'),this.pointers[l]=r),this.pointers.length},o.prototype.changeAzimuth=function(t){return this.az_off+="number"==typeof t?t:5,this.draw(),this},o.prototype.moveIt=function(){return this.timer_az=window.setTimeout(function(t){t.az_off+=t.az_step,t.draw(),t.moveIt()},100,this),this},o.prototype.spinIt=function(t,i){if("number"==typeof t)this.spin=0==t?0:this.spin+t;else{var s=1/this.fps,e=2;0==this.spin?this.spin="up"==t?s:-s:(Math.abs(this.spin)<1&&(e*=2),this.spin>0?this.spin="up"==t?this.spin*e:this.spin/e:this.spin<0&&(this.spin="up"==t?this.spin/e:this.spin*e),this.spin<s&&this.spin>-s&&(this.spin=0))}return void 0!==this.interval_time&&clearInterval(this.interval_time),0!=this.spin&&this.advanceTime(this.spin,i),this},o.prototype.getOffset=function(t){for(var i=0,s=0;t&&!isNaN(t.offsetLeft)&&!isNaN(t.offsetTop);)i+=t.offsetLeft-t.scrollLeft,s+=t.offsetTop-t.scrollTop,t=t.parentNode;return{top:s,left:i}},o.prototype.getJD=function(t){return t||(t=this.clock),t.getTime()/864e5+2440587.5},o.prototype.getNegative=function(t){var i=0==t.indexOf("rgb")?t.lastIndexOf(")"):0;if(0==i)return t;var s=t.substring(t.indexOf("(")+1,i).split(",");return 3==s.length?"rgb("+(255-s[0])+","+(255-s[1])+","+(255-s[2])+")":"rgba("+(255-s[0])+","+(255-s[1])+","+(255-s[2])+","+s[3]+")"},o.prototype.greatCircle=function(t,i,s,e){return Math.acos(Math.cos(i)*Math.cos(e)*Math.cos(t-s)+Math.sin(i)*Math.sin(e))},o.prototype.on=function(t,i){return"string"!=typeof t||"function"!=typeof i?this:(this.events[t]?this.events[t].push(i):this.events[t]=[i],this)},o.prototype.bind=function(t,i){return this.on(t,i)},o.prototype.trigger=function(t,i){if("string"==typeof t){"object"!=typeof i&&(i={});var s=[];if("object"==typeof this.events[t])for(a=0;a<this.events[t].length;a++)"function"==typeof this.events[t][a]&&s.push(this.events[t][a].call(this,i));return s.length>0?s:void 0}},t.virtualsky=function(i,s){return"object"==typeof s?s.container=i:s="string"==typeof i?{container:i}:i,s||(s={}),s.plugins=t.virtualsky.plugins,new o(s)},t.virtualsky.plugins=[]}(S);