-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseh-app.min.js
4 lines (4 loc) · 112 KB
/
seh-app.min.js
1
2
3
4
function Cdraw(e,t){var n,a,r,o,i,s=e||"canvas",l="normal 16px sans-serif",c="normal 11px sans-serif",m="#000",h="globalAlpha,globalCompositeOperation,lineCap,lineJoin,miterLimit,shadowBlur,shadowColor,shadowOffsetX,shadowOffsetY";if(n=document.getElementById(s),n||(n=document.createElement("canvas"),n.id=s,n.style.top=0,n.style.left=0,t&&t.hasOwnProperty("parent")&&(i=document.getElementById(t.parent)),i||(i=document.getElementsByTagName("body")[0]),i.appendChild(n)),!n.getContext)return null;if(a=n.getContext("2d"),!a.fillText)return null;this.setheight=function(e){isNumber(e)&&(n.height=e,o=e)},this.setwidth=function(e){isNumber(e)&&(n.width=e,r=e)},this.setsize=function(e){"object"==typeof e&&e.hasOwnProperty("h")&&e.hasOwnProperty("w")&&(n.width=e.w,n.height=e.h,r=e.w,o=e.h)},this.setfont=function(e){e&&(l=e)},this.setexpfont=function(e){e&&(c=e)},this.setcolor=function(e){e&&(m=e)},this.setclip=function(e,t,n,r){a.beginPath(),a.rect(e,t,n,r),a.clip()},this.setclipcircle=function(e,t,n){a.beginPath(),a.arc(Math.round(e)+.5,Math.round(t)+.5,n,0,2*Math.PI,!0),a.clip()},this.setviewport=function(e,t){a.translate(e,t),r-=e,o-=t},this.setparam=function(e,t){-1!=h.search(e)&&(a[e]=t,this[e]=t)};this.line=function(e,t,n,r,o,i){a.strokeStyle=o||m,a.lineWidth=i||"0.5",a.beginPath(),a.moveTo(Math.round(e)+.5,Math.round(t)+.5),a.lineTo(Math.round(n)+.5,Math.round(r)+.5),a.stroke()},this.hline=function(e,t,n,a,o){var i=n||r;this.line(e,t,e+i,t,a,o)},this.vline=function(e,t,n,a,r){var i=n||o;this.line(e,t,e,t+i,a,r)},this.vtick=function(e,t,n,a,r){var o=n||4;this.line(e,t-o,e,t+o,a,r)},this.htick=function(e,t,n,a,r){var o=n||4;this.line(e-o,t,e+o,t,a,r)},this.cross=function(e,t,n,a,r){this.hline(e-n-1.5,t-.5,n,a,r),this.hline(e+.5,t-.5,n,a,r),this.vline(e-.5,t-n-1.5,n,a,r),this.vline(e-.5,t+.5,n,a,r)},this.dashline=function(e,t,n,a,r,o,i){for(var s=i||[4,4],l=Math.atan2(n-e,a-t),c=Math.sqrt(Math.pow(a-t,2)+Math.pow(n-e,2)),m=e,h=t,d=0,u=0,f=0;Math.sqrt(Math.pow(t-h,2)+Math.pow(e-m,2))<c;)d=m+Math.sin(l)*s[f],u=h+Math.cos(l)*s[f],f%2==0&&this.line(m,h,d,u,r,o),m=d,h=u,f=f==s.length-1?0:f+1},this.setdash=function(e){a.setLineDash&&(e?a.setLineDash(e):a.setLineDash([0]))},this.text=function(e,t,n,r,o,i,s){var c,h;if(e)if(e=e.toString(),a.font=r||l,a.textAlign=o||"left",a.fillStyle=i||m,a.textBaseline=s||"alphabetic",-1!=e.search(/\n/g))for(c=e.match(/[^\n]+/g),h=0;h<c.length;h++)a.fillText(c[h],Math.round(t)+.5,n+16*h);else a.fillText(e,Math.round(t)+.5,n)},this.vtext=function(e,t,n,r,o,i,s){var l;l=s?Math.PI*s/180:1.5*Math.PI,a.save(),a.translate(t,n),a.rotate(l),this.text(e,0,0,r,o,i),a.restore()},this.label=function(e,t,n,a,r,o,i){var s=i||m,l=r||"NE",c="center",h="middle",d=0,u=0,f=this.relPos(l,a);d=f.x,u=f.y,h=f.v,c=f.h,this.text(e,t+d,n+u,o,c,s,h)},this.relPos=function(e,t){var n,a=0,r=0,o="middle",i="center";if(!e||!t||!isNumber(t)||t<=1)return{x:0,y:0,h:i,v:o};switch(n=Math.round(t/2),e.toUpperCase()){case"N":r-=t+n;break;case"NE":r-=t-n,a+=t-n;break;case"E":a+=t+n;break;case"SE":r+=t-n,a+=t-n;break;case"S":r+=t+n;break;case"SW":r+=t-n,a-=t-n+2;break;case"W":a-=t+n;break;case"NW":r-=t-n,a-=t-n+2}return-1!=e.search(/N/g)&&(o="bottom"),-1!=e.search(/S/g)&&(o="top"),-1!=e.search(/E/g)&&(i="left"),-1!=e.search(/W/g)&&(i="right"),{x:a,y:r,h:i,v:o}},this.number=function(e,t,n,r,o,i){var s,l,m,h=o||"left";if(!(s=parseFloat(e).toExponential().match(/(\d*)[eE]\+?(-?\d*)/)))return void this.text(e,t,n,r,o,i);if(l=s[1],"1"!=l?l+="×10":l="10",m=s[2],"right"==h)a.font=c,this.text(l,t-a.measureText(m).width-1,n,r,h,i),this.text(m,t,n-4,c,h,i);else if("center"==h){a.font=c;var d=a.measureText(m).width;a.font=r;var u=a.measureText(l).width,f=t-(u+d)/2;this.text(l,f,n,r,"left",i),this.text(m,f+u+1,n-4,c,"left",i)}else this.text(l,t,n,r,h,i),this.text(m,t+a.measureText(l).width+1,n-5,c,h,i)},this.index=function(e,t,n,r,o,i,s){var l,m,h,d,u=o||"left";if(!(l=e.toString().match(/(.*)([<>])(.*)/)))return void this.text(l,t,n,r,o,i,s);m=l[1],h=l[3],d=l[2].search(/>/)>=0?-4:4,"right"==u?(a.font=c,this.text(m,t-a.measureText(h).width-1,n,r,u,i,s),this.text(h,t,n+d,c,u,i,s)):"center"==u?(this.text(m,t,n,r,"right",i,s),this.text(h,t,n+d,c,"left",i,s)):(this.text(m,t,n,r,u,i,s),this.text(h,t+a.measureText(m).width+1,n+d,c,u,i,s))},this.textwidth=function(e,t){return a.font=t||l,a.measureText(e).width},this.fillrect=function(e,t,n,r,o){a.fillStyle=o||m,a.fillRect(e,t,n,r)},this.strokerect=function(e,t,n,r,o,i){a.strokeStyle=o||m,a.lineWidth=i||"0.5",a.strokeRect(Math.round(e)+.5,Math.round(t)+.5,n,r)},this.filldiamond=function(e,t,n,r,o){a.fillStyle=o||m,a.beginPath(),a.moveTo(e-n,t),a.lineTo(e,t-r),a.lineTo(e+n,t),a.lineTo(e,t+r),a.closePath(),a.fill()},this.roundedrect=function(e,t,n,r,o,i,s){a.strokeStyle=i||m,a.lineWidth=s||"0.5",a.beginPath(),a.moveTo(e,t+o),a.lineTo(e,t+r-o),a.quadraticCurveTo(e,t+r,e+o,t+r),a.lineTo(e+n-o,t+r),a.quadraticCurveTo(e+n,t+r,e+n,t+r-o),a.lineTo(e+n,t+o),a.quadraticCurveTo(e+n,t,e+n-o,t),a.lineTo(e+o,t),a.quadraticCurveTo(e,t,e,t+o),a.stroke()},this.fillcircle=function(e,t,n,r){a.fillStyle=r||m,a.beginPath(),a.arc(Math.round(e)+.5,Math.round(t)+.5,n,0,2*Math.PI,!0),a.closePath(),a.fill()},this.fillellipsis=function(e,t,n,r,o){var i;a.fillStyle=o||m,i=r||1,a.save(),a.scale(1,1/i),a.beginPath(),a.arc(Math.round(e)+.5,Math.round(t*i)+.5,n,0,2*Math.PI,!0),a.closePath(),a.fill(),a.restore()},this.strokecircle=function(e,t,n,r,o){a.strokeStyle=r||m,a.lineWidth=o||"0.5",a.beginPath(),a.arc(Math.round(e)+.5,Math.round(t)+.5,n,0,2*Math.PI,!0),a.closePath(),a.stroke()},this.filltriangle=function(e,t,n,r){a.fillStyle=r||m;var o=Math.sqrt(n);a.beginPath(),a.moveTo(e,t-o),a.lineTo(e+o,t+o),a.lineTo(e-o,t+o),a.closePath(),a.fill()},this.arc=function(e,t,n,r,o,i,s,l){a.strokeStyle=s||m,a.lineWidth=l||"0.5",a.beginPath(),a.arc(e,t,n,r,o,i),a.arc(e,t,n,o,r,!i),a.closePath(),a.stroke()},this.gradient=function(e,t,n,a,r){var o=this.makegradient(e,n,t,n,r);e<t?this.fillrect(e,n,t-e,a,o):this.fillrect(t,n,e-t,a,o)},this.makegradient=function(e,t,n,r,o){var i=a.createLinearGradient(e,t,n,r);if("object"==typeof o&&o.constructor==Array)for(var s=0;s<o.length;s++)i.addColorStop(o[s].pos,o[s].col);return i},this.makeradialgradient=function(e,t,n,r,o,i,s){var l=a.createRadialGradient(e,t,n,r,o,i);if("object"==typeof s&&s.constructor==Array)for(var c=0;c<s.length;c++)l.addColorStop(s[c].pos,s[c].col);return l},this.image=function(e,t,n,r,o,i,s,l,c){var m;if(e&&-1!=(typeof e).search(/object|string/)){if(e.constructor==String)m=new Image,m.src=e;else{if(!e.src)return;m=e}i?a.drawImage(m,t,n,r,o,i,s,l,c):r?a.drawImage(m,t,n,r,o):a.drawImage(m,t,n)}},this.createpattern=function(e,t){return a.createPattern(e,t)},this.save=function(){a.save()},this.restore=function(){a.restore()},this.scale=function(e,t){a.scale(e,t)},this.rotate=function(e,t,n){var r,o,i;r=e?Math.PI*e/180:0,o=t||0,i=n||0,a.translate(o,i),a.rotate(r)},this.startp=function(e,t,n,r,o){a.fillStyle=n||m,a.strokeStyle=o||a.fillStyle,a.lineWidth=r||"0.5",a.beginPath(),a.moveTo(e,t)},this.movep=function(e,t){a.lineTo(e,t)},this.arcp=function(e,t,n,r,o,i){a.arc(e,t,n,r,o,i)},this.endp=function(e,t,n){var r=n||!1;e&&t&&a.lineTo(e,t),a.closePath(),r&&a.fill(),a.stroke()},this.termp=function(e,t){e&&t&&a.lineTo(e,t),a.stroke()},this.clear=function(){a.clearRect(0,0,r,o)},this.Width=function(){return r},this.Height=function(){return o},function(e){var t,i;for(t in e)if(e.hasOwnProperty(t))switch(i=e[t],t){case"width":isNumber(i)&&(n.width=i,r=i);break;case"height":isNumber(i)&&(n.height=i,o=i);break;case"top":case"left":n.style[t]=i;break;case"className":n.className=i;break;case"font":l=i;break;case"color":m=i;break;default:-1!=h.search(t)&&(a[t]=i,this[t]=i)}}(t),r=n.width,o=n.height}function Round(e,t){return Math.round(Math.pow(10,t)*e)/Math.pow(10,t)}function sign(e){return e?e<0?-1:1:0}function prefix(e){return SI.hasOwnProperty(e)?SI[e]:1}function w2f(e){return 299792458/e}function e2f(e){return 0xdbea334f7fe3*e}function isNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}function isArray(e){return"[object Array]"===Object.prototype.toString.call(e)}function logError(e,t){console.log(e,t)}function px(e){return e+"px"}function Mission(e,t){var n,a,r,o=missions[e],i=e,s=null,l={},c={},m=function(){var e,t,n,a,r,o,c,m,h,d,u,f,p=[],g=19,C=1,S=0;if(f=document.createDocumentFragment(),a=Create.div(f,"infoBox",i+"info",{w:SSEH.BOXWIDTH}),Create.closex(a),r=Create.div(a,"col",null,{w:230}),o=Create.div(a,"col",null,{w:230}),c=Create.div(a,"rcol",null,{w:120}),Create.span(r,l.title[0],"missionTitle"),l.names)for(Create.br(r),C++,e=0;e<l.names.length;e++)e>0&&Create.text(r,", "),2==e&&(Create.br(r),C++),Create.span(r,l.names[e]);if(l.fam&&(C++,Create.field(r,l.fam,"fam")),l.id)for(Create.br(r),C++,Create.span(r,Common.names.find("tid"),"category"),e=0;e<l.id.length;e++)e>0&&Create.text(r," "),Create.a(r,l.id[e],"");if(l.dim&&(Create.field(r,l.dim[0],"dim"),S++),l.url)for(Create.br(r),C++,Create.span(r,Common.names.find("turl"),"category"),e=0;e<l.url.length;e++)e>0&&Create.text(r,", "),l.url[e].k?Create.asymbol(r,l.url[e],"symLnk"):Create.aimg(r,l.url[e]);for(e=0;e<l.ctry.length;e++)Create.asymbol(o,l.ctry[e],"missionFlag");if(l.ag)for(e=l.ag.length-1;e>=0;e--)Create.asymbol(o,l.ag[e],"missionAgency");for(S++,e=0;e<l.goal.length;e++)Create.br(o),Create.span(o,l.goal[e],"missionType"),S++;if(l.spec)for(e=0;e<l.spec.length;e++)Create.br(o),Create.span(o,l.spec[e]),S++;for(l.m&&(Create.field(o,l.m,"lmass",null,"/"),S++),l.m0&&(Create.field(o,l.m0,"dmass",null,"/"),S++),l.lv&&(n=Create.field(o,l.lv[0],"lv"),l.lv[0].id&&(n.id=l.lv[0].id,n.className="missionLnk",n.onclick=SSEH.showLV),S++),C=Math.max(C,S),Create.span(c,l.stat[0],"missionStatus status"+l.stat[0].n),e=0;e<l.icon.length;e++)u=Create.img(c,l.icon[e],""),isNumber(u.height)&&u.height>0?g+=u.height:g+=120,t=l.sc[l.icon[e].p],e>0&&t<1&&(u.style.width=px(120*t),u.style.marginRight=px(60*(1-t)),u.style.height="auto"),Create.br(c);for(m=Create.div(a,"tblHead col",null,{w:456}),h=[86,120,250],e=0;e<3;e++)p[e]=Create.div(m,"col",null,{w:h[e]});for(Create.span(p[0],Common.names.find("thdate")),Create.span(p[1],Common.names.find("thevent")),Create.span(p[2],Common.names.find("thdetail")),C++,e=0;e<l.ev.length;e++){for(d=!1,m=Create.div(a,"tblRow col ",null,{w:456}),g&&g>0&&19*C>g&&(m.style.width=px(576),h[2]=370),e%2!=0&&(m.style.background="rgba(241,241,214,0.6)"),C++,t=0;t<3;t++)p[t]=Create.div(m,"col",null,{w:h[t]});if(l.ev[e].date?(e>0&&l.ev[e-1].date&&l.ev[e].date[0].n.length>6&&l.ev[e].date[0].n==l.ev[e-1].date[0].n?Create.span(p[0],{n:" ="},"eventRpDate"):Create.span(p[0],l.ev[e].date[0],"eventDate"),l.ev[e].date[0].w&&(d=!0,p[0].style.width=px(h[0]+h[1]),p[1].style.width=0,p[2].style.width=px(h[2]))):Create.span(p[0],{n:" -"},"eventRpDate"),l.ev[e].type)if(0===l.ev[e].type.length&&!1===d)Create.br(p[1]);else{var y=d?2:1;for(t=0;t<l.ev[e].type.length;t++)Create.text(p[y]," "),Create.span(p[y],l.ev[e].type[t],"eventLoc")}for(t=0;t<l.ev[e].loc.length;t++)(p[2].children.length>0&&!1===d||t>0)&&Create.text(p[2],": "),n=Create.span(p[2],l.ev[e].loc[t]),l.ev[e].loc[t].hasOwnProperty("id")&&(n.id=l.ev[e].loc[t].id,n.className="missionLnk",n.onclick=SSEH.showLC);if(l.ev[e].desc)for(t=0;t<l.ev[e].desc.length;t++)(p[2].children.length>0||t>0)&&(l.ev[e].desc[t].v?Create.text(p[2],l.ev[e].desc[t].v):Create.text(p[2],"; ")),Create.span(p[2],l.ev[e].desc[t]),l.ev[e].desc[t].d&&Create.text(p[2],": "+l.ev[e].desc[t].d);Create.br(p[2])}return s.appendChild(f),a},h=function(e){var t,n=[];if(t=Read.data(o.name))return n.push(Read.string(t[0],e)),e&&(n[0].u="-"),n},d=function(e){var t=null,n=[];if(e&&""!==e)return t=Common.names.findLV(e),t?n.push({n:e,id:"lnk"+t}):n.push({n:e}),n},u=function(){var e,t,n;return e=o.hasOwnProperty("stat")?o.stat:o.parts[0].stat,e=p(e),t=a[0].d,n=R("ctry",!0),n=n.join(),{s:e,c:n,l:t}},f=function(e,t,n,a){var r;if(!e)return!1;for(r=0;r<e.length;r++)if(e[r].t==t&&e[r].d1==n&&e[r].d2==a)return!0;return!1},p=function(e){var t;if("f"!=e)return e;for(t=0;t<=1&&!(t>o.events.length-1);t++)if(-1!=o.events[t].type.search(/^l|toi|oi$/)&&-1!=o.events[t].desc.search(/fail/))return"lf";return e},g=function(e){var t,n,a,r=[];if(e&&""!==e){for(n=e.split(","),t=0;t<n.length;t++)!0!==C(n[t])&&(a=Common.names.find(n[t]),a.k=n[t],a.u&&(a.u="http://"+a.u,a.t="_blank"),r.push(a));return r}},C=function(e){var t;for(t=0;t<l.ag.length;t++)if(l.ag[t].k==e)return!0;return!1},S=function(e){var t,n,a=[];if(e&&""!==e){for(t=e.split(","),n=0;n<t.length;n++)a.push(Common.names.find(t[n]));return a}},y=function(e){var t,n,a,r=[];if(e&&""!==e){for(t=e.split(","),n=0;n<t.length;n++)a=t[n].toCommaString(),a=a.replace(/kg/g,Common.SPC+"kg"),r.push({n:a});return r}},v=function(e,t){var n,a,r,o=0,i=[];if(!e||""===e)return[];for(r=e.replace(/x/g,Common.SPC+"×"+Common.SPC),n=e.replace(/m/,"").split("x"),a=0;a<n.length;a++)n[a]=parseFloat(n[a]),n[a]<25&&n[a]>o&&(o=n[a]<10?n[a]:.71*n[a]);return l.sc[t]=o/8,i.push({n:r,v:o}),i},w=function(e){var t,n,a,r;if(isNumber(e.pt)&&e.pt>0&&(n=Read.data(o.parts[e.pt].names))&&n.length>0&&(r=n[0].length>1?n[0][1]:n[0][0]),r||(r=l.title[0].n),r=r.replace(/[\{\}]/g,""),null===(t=e.desc.match(/show\:([^\b;\:]+)/)))a=E(r);else{if("0"==t[1])return;a=t[1]}return a+":"+r},b=function(e){var t;return t=e.desc.match(/show\:[^\:]+\:([^\b;\:]+)/),null===t?"NE":t[1]},x=function(e){var t,n,a="";if(!e)return a;for(n=e.desc.split(";"),t=0;t<n.length;t++)-1==n[t].search(/\:/)&&n[t].length>4&&(""!==a&&(a+=", "),a+=n[t]);return a},E=function(e){var t,n;if(e){if(e.length<=3)return e;if(t=e.match(/(.)(.)\D*(\d*)/))return n=t[1],t.length>3&&""!==t[3]?n+=t[3]:n+=t[2]+".",n}},I=function(e){var t,n,a;return t=Create.div(s,"timeline","info"+i,{t:e,l:10,w:1,h:SSEH.BARHEIGHT}),Create.span(t,l.shortname[0],"status"+l.stat[0].n),n=Create.img(t,l.icon[0],"imgHilight"),l.sc[0]<1&&(a=120*l.sc[0],n.style.width=px(a),n.style.height="auto"),Create.div(t,"hilight",null,{t:1,l:0,w:1,h:SSEH.BARHEIGHT-2}),t.onclick=UI.show,t.onmouseover=UI.showImg,t.onmouseout=UI.showImg,t},P=function(e,t,n,a){var r,o=c[a].childNodes;for(c[a].style.width=px(t-10),r=0;r<o.length;r++)"div"==o[r].nodeName.toLowerCase()?(o[r].style.left=px(e-10),o[r].style.width=px(t-e-1)):"img"==o[r].nodeName.toLowerCase()&&(o[r].style.left=px(t+130<n?t+10:e-130))},H=function(e,t,n,a,r,o){var i,s=0;1===r?(i=1,n+=Math.round((SSEH.BARHEIGHT-o.length)/2)):i=r;for(var l=0;l<o.length;l++)1!==r&&l===o.length-1&&(i=SSEH.BARHEIGHT-s),e.fillrect(t,n+l*r,a-t,i,o[l]),s+=r},k=function(e,t,n,a,r,o){for(var i,s=0,l=0;l<o.length;l++)i=l<o.length-1?r:SSEH.BARHEIGHT-s,e.gradient(t,a,n+l*r,i,[{col:o[l],pos:0},{col:"#000",pos:1}]),s+=r},T=function(e,t,n,a){var r,o;Common.sprites.hasOwnProperty(a)&&(o=Common.sprites[a],r=SSEH.BARHEIGHT/2,e.image(Common.symbols.sprite,o.x,o.y,16,16,t-r,n,SSEH.BARHEIGHT,SSEH.BARHEIGHT))},M=function(e){var t,n=[];for(t=0;t<e.length;t++)n[t]=Common.names.findColor(e[t]);return n},O=function(e,t){var n,a=L(e[t].type),r=o.events[t].desc;switch(a){case"l":case"oi":case"toi":t<2&&r&&-1!=r.search(/fail/)&&(n="fail");break;case"app":(t>=e.length-1||"fb"!=L(e[t+1].type))&&(n="app");break;case"fb":case"oi":case"edl":case"imp":n=a}return n},N=function(e,t){return-1==e.search(/^l/i)?Parse.dt(e):U(t,e)},U=function(e,t){var n;if(t&&e&&!(null===(n=t.match(/^l\+([\d\.]+)(\w+)?/))||n.length<3))return e.add(n[1],n[2])},A=function(e){var t;return t=Read.data(e),t[0][0]},L=function(e){var t;return t=Read.data(e),t[0][0]},B=function(){var e,t=[];for(e=0;e<l.stats.length;e++)t.push(l.stats[e].t);return t},F=function(e,t){var n,a,r,o=e.slice();if(!t)return o;for(n=Read.data(t),a=0;a<n.length;a++)if("eom"==n[a][0]){if(!n[a][1])return o;for(r=0;r<o.length;r++)if(o[r]==n[a][1]){o.splice(r,1);break}}return o},D=function(e){var t=Create.div(s,"hilight","info"+i,{l:0,t:e.t,h:e.h,w:e.w});return t.title=l.title[0].n,t.onclick=UI.show,t},R=function(e,t){var n,a=[];for(n=0;n<o.parts.length;n++)o.parts[n].hasOwnProperty(e)&&""!==o.parts[n][e]&&(a=a.concat(o.parts[n][e].split(";")));if(!a||0===a.length)return null;for(t&&(a=a.unique()),n=0;n<a.length;n++)a[n]=a[n].split(":");return a},W=function(e,t){var n;switch(n=e.split(":"),n.length>1&&(l.hasOwnProperty(n[0])||(l[n[0]]=[])),n[0]){case"ag":l.ag=l.ag.concat(g(n[1]));break;case"lv":l.lv=l.lv.concat(d(n[1]));break;case"fam":l.fam=l.fam.concat(S(n[1]));break;case"m":l.m=l.m.concat(y(n[1]));break;case"m0":l.m0=l.m0.concat(y(n[1]));break;case"dim":l.dim=l.dim.concat(v(n[1],t));break;case"sc":l.sc[t]=parseFloat(n[1]);break;case"w":l.w[t]=parseFloat(n[1]);break;case"part":l.part=n[1];break;default:if(void 0!==n[0]&&""!==n[0]){l.hasOwnProperty("spec")||(l.spec=[]),l.spec.push({n:n[0]});break}}};this.drawTimeline=function(e,t,r,o){var i,s,l,m,h,d,u=null,f=[],p=t;for(f=M(a[0].m),i=Math.ceil(SSEH.BARHEIGHT/f.length),s=0;s<a.length;s++)m=UI.Scale.time(a[s].d,r),0===s&&(l=m),null!==u&&("ten"!=a[s].t?H(e,u,p+1,m,i,f):k(e,u,p+1,m,i,f)),u=m,f=M(a[s].m),i=Math.ceil(SSEH.BARHEIGHT/f.length);for(u==l&&(m=u+2,H(e,u,p+1,m,i,f)),d=0,s=0;s<a.length;s++)if("fail"==a[s].i)T(e,UI.Scale.time(a[s].d,r)+9,p+1,"lf");else if(a[s].i&&a[s].l==o&&m-l>8){if(h=UI.Scale.time(a[s].d,r),h<l+2&&(h=l+2),h-d<4)continue;T(e,h,p+1,a[s].t),d=h}return c[o]||(c[o]=I(p)),P(l,m,r,o),t+n},this.drawEscape=function(e,t,n){var a,r,o,s,l=15,m=n/Math.PI;o=parseElements(elem[i]),r=t+1.8*(o.r-85),a=n+(o.l-Math.PI)*m,r-=5*Math.cos(Math.asin(a/r)),s=i.replace(/\d+/,""),e.image(Common.symbols[s],a-l,r-l,30,30),c.et||(c.et=D({t:r-l,w:30,h:30})),c.et.style.left=px(a-l)},this.createTrajectory=function(){},this.ID=function(){return i},this.Box=function(){return r},this.Events=function(){return l.ev},this.createBox=function(){return r=m(),r.style.top=px(-9999),r.style.left=px(6),r.onclick=function(){UI.vanish(!1)},r},this.Name=function(e){return e&&l.shortname&&l.shortname.length>0?l.shortname[0].n:l.title&&l.title.length>0?l.title[0].n:void 0},this.Launchdate=function(){if(a&&a.length>0)return a[0].d},this.Achievements=function(e){var t,n=[],a="";for(t=0;t<l.stats.length;t++)-1!=l.stats[t].d1.search(e)?(n.push(l.stats[t]),""!==a&&l.stats[t].s!==a&&n.push({t:"all",d1:e,d2:"",s:a}),a=l.stats[t].s):"ter"==e&&-1!=l.stats[t].t.search(/^(hm|srm)$/)&&(n.push(l.stats[t]),a=l.stats[t].s);return n.length>0&&n.push({t:"all",d1:e,d2:"",s:a}),n},this.Achievementsctry=function(){return u()},this.AchievementsLnch=function(e){var t,n,r;if(r=l.hasOwnProperty("part"),t=l.id&&l.id.length>0?l.id[0].n.slice(0,8):"",""!==(n=l.lv&&l.lv.length>0&&l.lv[0].hasOwnProperty("id")?l.lv[0].id.replace(/^lnk/,""):""))return{id:t,st:l.stats[0].s,lv:n,dt:a[0].d,part:r}},this.Locations=function(e){if(l.locations.hasOwnProperty(e))return l.locations[e]},this.hasDest=function(e){var t,n;for(n="sbo"!=e?new RegExp("\\b"+e+"\\b"):new RegExp("\\b(ast|com)\\b"),t=0;t<l.stats.length;t++){if(-1!=l.stats[t].d1.search(n))return!0;if("ter"==e&&-1!=l.stats[t].t.search(/^(hm|srm)$/))return!0}return!1},this.Destinations=function(){var e,t=[];for(e=0;e<l.stats.length;e++)t.push(l.stats[e].d1),-1!=l.stats[e].t.search(/^(hm|srm)$/)&&t.push("ter");return t.unique()},this.Height=function(){var e;return e=this.Destinations(),e.length*n},this.Icon=function(){if(l.icon&&l.icon.length>=1)return l.icon[0].i},t&&(s=document.getElementById(t)),s||(s=document.getElementsByTagName("body")[0]),n=SSEH.BARHEIGHT+Math.floor(SSEH.BARHEIGHT/4),l.stats=function(){var e,t,n,a,r,i,s=[];for(e=0;e<o.parts.length;e++)n=o.parts[e].type,t=o.parts[e].dest,n&&""!==n&&t&&(t=t.split(":"),a=t[0],r=t.length>1?t[1]:"",i=o.parts[e].stat||o.stat,i=p(i),f(s,n,a,r)||s.push({t:n,d1:a,d2:r,s:i}));return s}(),a=function(){var e,t,n,a,r,i,s,l,c=[],m=new Date,h=B();if(t=o.stat?o.stat:o.parts[0].stat,o.events){for(e=0;e<o.events.length;e++)l=o.events[e].desc,(n=N(o.events[e].dt,a))&&(0===e&&(a=new Date(n.valueOf())),r=A(o.events[e].loc),"com"!=r&&"ast"!=r||(r="sbo"),i=L(o.events[e].type),h=F(h,l),s=O(o.events,e),c.push({d:n,l:r,t:i,m:h,i:s}));return"o"==t&&m.diff(c[c.length-1].d)<0&&(c.push({d:m,l:r,t:i,m:h}),n=new Date(m.valueOf())),"pom"==i&&m.diff(c[c.length-2].d)<0&&(c[c.length-1].t="nom",c[c.length-1].d=m,c.push({d:n,l:r,t:i,m:h})),-1!=t.search(/o|pl/)&&("pom"==i?c[c.length-1].t="ten":"nom"!=i?l&&-1!=l.search(/eom(?!\:)/i)||c.push({d:c[c.length-1].d.add(3,"yr"),l:r,t:"ten",m:h}):l&&-1==l.search(/pend|\?/i)||c.push({d:c[c.length-1].d.add(3,"yr"),l:r,t:"ten",m:h})),c}}(),l.title=h(),l.shortname=h(!0),l.names=function(){var e,t,n=[];if(t=R("names")){for(e=0;e<t.length;e++)"{"!=t[e][0].slice(0,1)&&n.push(Read.string(t[e],!0));return n}}(),l.goal=function(){var e,t,n,a,r,o=[],i=l.stats;for(e=0;e<i.length;e++)t=Common.names.find(i[e].t),n=i[e].d2?Common.names.find(i[e].d2):Common.names.find(i[e].d1),a=n.l?n.l+" "+t.n:"",r=Common.names.findColor(i[e].t),"hm"==i[e].t?o.push({n:t.n,c:r}):o.push({n:n.n+" "+t.n,l:a,c:r});return o}(),l.stat=function(){var e,t=[];if(e=o.stat?Read.data(o.stat):Read.data(o.parts[0].stat))return t.push(Common.names.find(e[0])),t[t.length-1].c=Common.names.findColor(e[0][0]),t}(),l.ctry=function(){var e,t,n,a=[];if(t=R("ctry",!0)){for(e=0;e<t.length;e++)n=t[e][0],Common.ctry.hasOwnProperty(n)&&a.push({n:Common.ctry[n].name,k:n});return a}}(),l.id=function(){var e,t,n,a=[];if((t=R("id"))&&!(t.length<1)){if(-1!=t[0][0].search(/x$/))return[{n:t[0][0]}];for(e=0;e<t.length;e++)n=t[e].length>1?t[e][1]:t[e][0],e>0&&n.slice(0,-2)==t[0][0].slice(0,-2)?a.push({n:n.slice(-1),u:SSEH.IDLNK+t[e][0],t:"_blank"}):a.push({n:n,u:SSEH.IDLNK+t[e][0],t:"_blank"});return a}}(),l.url=function(){var e,t,n=[];if(t=R("url")){for(e=0;e<t.length;e++)n[e]=Read.url(t[e]);return n}}(),l.icon=function(){var e,t,n,a,r,i,s=[];for(n=0;n<o.parts.length;n++)if((e=Read.data(o.parts[n].icon))&&0!==e.length)for(t=Read.data(o.parts[n].names),i=n>0&&t&&t.length>0?Read.string(t[0]):l.title[0],a=0;a<e.length;a++)r=SSEH.PROBES+e[a][0],s.push({i:r,n:i.n.replace(/[\{\}]/g,""),p:n});return s}(),function(){var e,t,n;for(l.sc=[],n=o.desc.split(";"),e=0;e<n.length;e++)W(n[e]);for(t=0;t<o.parts.length;t++)if(l.sc[t]=1,o.parts[t].hasOwnProperty("desc"))for(n=o.parts[t].desc.split(";"),e=0;e<n.length;e++)W(n[e],t)}(),l.locations=function(){var e,t,n,r,i,s,l,c={};for(e=0;e<o.events.length;e++)if(-1!=o.events[e].type.search(/^imp|edl|td|tdn$/)&&(t=o.events[e].loc.split(":"),t.length>1)){if(!(r=w(o.events[e])))continue;n=t[1],n&&(c.hasOwnProperty(t[0])||(c[t[0]]=[]),i=b(o.events[e]),s=Parse.date(o.events[e].dt,a[0].d),l=x(o.events[e]),c[t[0]].push({n:r,t:o.events[e].type,c:n,o:i,d:s,de:l}))}return c}(),l.ev=[];for(var j=0;j<o.events.length;j++)"pom"!=o.events[j].type&&(l.ev[j]={},l.ev[j].type=function(e){var t,n,a=[];if(!(o.events.length<e+1)&&o.events[e].type&&"ev"!==(t=o.events[e].type))return n=o.events[e].loc.split(":"),-1!==t.search(/\boi|fb|f|app|ae|imp|edl|td|enc\b/)&&"sol"!=n[0]&&a.push(Common.names.find(n[0])),a.push(Common.names.find(t)),a[0].abbr=n[0],a}(j),l.ev[j].date=function(e){var t=[],n=a[0].d;if(!(o.events.length<e+1)&&o.events[e].dt)return o.events[0].dt.length<=4?t.push({n:Parse.date(o.events[e].dt)}):t.push({n:Parse.date(o.events[e].dt,n)}),-1!=o.events[e].dt.search(/\.\./)&&(t[0].w=!0),t}(j),l.ev[j].loc=function(e){var t,n,a,r,i=[];if(o.events.length<e+1||!o.events[e].loc)return i;for(t=o.events[e].loc.split(":"),r=t[0],n=1;n<t.length;n++)-1==t[n].search(/^[\d\-]/)?i.push(Common.names.find(t[n])):-1!=t[n].search(/[NSEW]/)?i.push({n:Parse.position(t[n])}):-1!=t[n].search(/x/)?i.push({n:Parse.orbit(t[n],r)}):i.push({n:Parse.distance(t[n],r)});return"l"==o.events[e].type&&(a=t[1],i.length>0&&(i[0].id="lnk"+a),-1==SSEH.lc.search(a)&&(SSEH.lc+=a+",")),i}(j),l.ev[j].desc=function(e){var t,n,a,r=[],i=null;if(!(o.events.length<e+1)&&o.events[e].desc){for(i=Read.data(o.events[e].desc),t=0;t<i.length;t++)if(1==i[t].length)if(-1!=i[t][0].search(/\//))for(a=i[t][0].split("/"),n=0;n<a.length;n++)r.push(Common.names.find(a[n])),r[r.length-1].v="/";else{if(e==o.events.length-1&&("eom"==i[t]||"?"==i[t]))continue;r.push(Common.names.find(i[t]))}else{if(-1!="show,eom".search(i[t][0]))continue;switch(-1=="com,ast,dp,op".search(i[t][0])?r.push(Common.names.find(i[t][0])):r.push(Common.names.find(i[t][1])),i[t][0]){case"com":case"ast":case"show":break;case"dist":case"rv":case"trv":case"alt":case"ae":case"fb":r[r.length-1].d=Parse.distance(i[t][1]);break;case"v":r[r.length-1].d=Parse.velocity(i[t][1]);break;case"imp":case"nad":r[r.length-1].d=Parse.position(i[t][1]);break;case"eom":2==i[t].length&&(r.push(Common.names.find(i[t][1])),r[r.length-1].v=": ");break;case"ip":case"ssp":case"lp":case"hpp":case"mal":case"fail":r.push(Common.names.find(i[t][1])),r[r.length-1].v=": ";break;case"end":case"los":r[r.length-1].d=Parse.date(i[t][1]);break;case"tm":case"per":r[r.length-1].d=Parse.time(i[t][1]);break;case"mat":r[r.length-1].d=Parse.mass(i[t][1]);break;case"enc":r[r.length-1].d=Parse.date(i[t][1]);break;default:i[t][0].length>3&&(r[r.length-1].l=i[t][1])}}return r}}(j))}function Destination(e,t){var n,a,r,o,i,s,l,c,m,h,d=e,u={},f={},p=[],g=function(){var e,t,a,i,s,l,c=[260,130,210],h=[250,180,150];return"sbo"!=d&&"tno"!=d||(c=h),s=document.createDocumentFragment(),e=Create.div(s,"infoBox",d+"info",{w:SSEH.BOXWIDTH}),Create.closex(e),a=Create.div(e,"header",null,{w:SSEH.BOXWIDTH}),a.title="Click for more details",a.style.cursor="pointer",a.onclick=UI.toggle,i=Create.div(a,"col",null,{w:c[0]}),Create.symbol(i,d,"symbol"),Create.span(i,{n:f.name},"missionTitle"),Create.asymbol(i,{k:"ext",u:f.hp},"symLnk"),f.url&&f.url[0].k&&Create.asymbol(i,f.url[0],"symPict"),Create.br(i),t=Create.symbol(i,"down","symDetail"),t.id=d+"downlnk",Create.field(i,f.orbit,"orbit",!1),"sbo"!=d&&"tno"!=d||Create.span(i,{n:" "}),i=Create.div(a,"col",null,{w:c[1]}),t=Create.field(i,f.nmoons,"nmoons",!1,null,"infoLnk"),t&&(t.onclick=function(){UI.showBox("moons"+d)}),"sol"==d&&Create.field(i,"8+5 Dwarf","planets",!1),"sbo"==d&&(t=Create.field(i,f.ast,"ast",!1,null,"infoLnk"),t.onclick=function(){UI.showBox("sboa")},Create.field(i,f.com,"com",!0,null,"infoLnk"),t.onclick=function(){UI.showBox("sboc")}),"tno"==d&&(t=Create.field(i,f.tno,"tno",!1,null,"infoLnk"),t.onclick=function(){UI.showBox("sbot")}),Create.field(i,f.per,"per"),i=Create.div(a,"rcol",null,{w:c[2]}),Create.field(i,{n:""},"misn",!1,null,null,"missionstat"+d),Create.field(i,f.diam,"diam",!0),a=Create.div(e,"detail",null,{t:41,w:SSEH.BOXWIDTH-10}),"sbo"==d||"tno"==d?(a.style.height=px(40),i=Create.div(a,"col",null,{w:575}),Create.field(i,f.census,"cen",!1)):(i=Create.div(a,"col",null,{w:180}),Create.field(i,f.rot,"rot",!1),Create.field(i,f.mass,"hmass"),Create.field(i,f.temp,"temp"),Create.field(i,f.irad,"irad"),i=Create.div(a,"col",null,{w:125}),Create.field(i,f.tilt,"tilt",!1),Create.field(i,f.dens,"dens"),Create.field(i,f.grav,"grav"),Create.field(i,f.alb,"alb"),i=Create.div(a,"rcol",null,{w:270}),Create.field(i,f.disc,"disc",!1),Create.field(i,f.comp,"comp"),Create.field(i,f.atm,"atm"),Create.field(i,f.mag,"mag")),n.appendChild(s),"sol"==d?(m=Create.div(e,"infoMap","map"+d,{w:SSEH.BOXWIDTH,h:SSEH.BOXWIDTH/2}),m.style.height=px(SSEH.BOXWIDTH/2+32),new SPanel(m.id)):-1!=d.search(/jup|sat|ura|nep/)?(m=Create.div(e,"infoMap","map"+d,{w:SSEH.BOXWIDTH,h:SSEH.BOXWIDTH/2}),m.style.height=px(SSEH.BOXWIDTH/2+32),new Panel(m.id,d,r.getList(),o.getList())):f.map&&(m=Create.div(e,"infoMap","map"+d,{w:SSEH.BOXWIDTH}),m.style.display="none",l=SSEH.MAPS+f.map,f.map=new Image,f.map.onload=function(){m.style.height=px(this.height>0?Math.round(parseInt(this.height)/parseInt(this.width)*SSEH.BOXWIDTH)+32:Math.round(parseInt(this.naturalHeight)/parseInt(this.naturalWidth)*SSEH.BOXWIDTH)+32),m.style.display="block"},f.map.src=l,m.appendChild(f.map)),Create.table(e,"infoTable","stat"+d),C(),p.length>0&&S(),e},C=function(){var e,t,n,a,r,o,i,s=["all","s","p","f","lf","o","pl"];r=document.getElementById("stat"+d),i=document.createDocumentFragment();for(n in u)u.hasOwnProperty(n)&&(u[n].all=Parse.sumType(u[n]));t=u.all.s+u.all.p+u.all.f+u.all.lf+u.all.o,o=t>0?t.toString()+" / "+(u.all.s+u.all.p).toString()+" / "+u.all.o+" / "+u.all.pl+" ":"-",document.getElementById("missionstat"+d).innerHTML=o;for(n in u)u.hasOwnProperty(n)&&(u[n].sp=(u[n].s+u[n].p).toString()+" ("+u[n].p+")",u[n].fl=(u[n].f+u[n].lf).toString()+" ("+u[n].lf+")");for(s=["sp","fl","o","pl","all"],a=Create.tr(i,"tblHead"),Create.td(a,{n:" "}),e=0;e<s.length;e++)Create.td(a,Common.names.find(s[e]));for(n in SSEH.mtype)if(u[n])for(a=Create.tr(i),Create.td(a,Common.names.find(n)),e=0;e<s.length;e++)Create.td(a,{n:u[n][s[e]]});for(a=Create.tr(i),Create.td(a,{n:"All*",l:"Missions with multiple parts get only counted once, except with different statuses"}),e=0;e<s.length;e++)Create.td(a,{n:u.all[s[e]]});r.appendChild(i)},S=function(){var e,t,n,a,r,o,i,s,l,c,m,h,u,f,g=document.getElementById("map"+d),C=document.createDocumentFragment();for(n=new Cdraw("cmap"+d,{className:"infoCanvas",parent:"map"+d,width:SSEH.BOXWIDTH,height:SSEH.BOXWIDTH/2,font:SSEH.TEXTFONT,color:SSEH.TEXTCOL}),r=0;r<p.length;r++)s="imp"==p[r].t?"#fc9":"#d9f",i=v(p[r].c),l=p[r].n.split(":"),m=p[r].o,I(n,i,s,l[0],m),p[r].id=P(l),a=y(n,C,l,i,m,p[r].id),H(a,p[r],i);if("ter"==d)for(f=SSEH.lc.split(","),o=0;o<f.length;o++)""!==f[o]&&Common.hasOwnProperty(f[o])&&(e=f[o],Common.lc[e].hasOwnProperty("desc")&&null!==(t=Common.lc[e].desc.match(/loc\:([^\b;]+)/))&&(r++,i=v(t[1]),s="#0f0",l=w(Common.lc[e].name,Common.lc[e].desc),m=x(Common.lc[e].desc),I(n,i,s,l,m),a=Common.lc[e].name.split(":"),h=a.length>1?a[1]:a[0],c=b(Common.lc[e].desc),u=P(a),a=y(n,C,[l,h],i,m,u),H(a,{n:l+":"+h,c:t[1],de:c,id:u},i)));g.appendChild(C)},y=function(e,t,n,a,r,o){var i,s=r||"NE";return i=E(e,n[0],s),Create.div(t,"mapMark",null,{l:a.x+i.x,t:a.y+i.y,w:i.w})},v=function(e){var t,n,a,r,o,i;if(e)return t=Parse.pos(e),{},o=SSEH.BOXWIDTH/2,i=o/2,n=t.split(","),r=(-parseFloat(n[0])/90+1)*i,a=(parseFloat(n[1])/180+1)*o,{x:Math.round(a),y:Math.round(r)}},w=function(e,t){var n;return n=t.match(/show\:([^\b;\:]+)/),null===n?e.slice(0,3):n[1]},b=function(e){var t;return t=e.match(/reg\:([^\b;\:]+)/),null===t?void 0:t[1]},x=function(e){var t;return t=e.match(/show\:[^\:;]+\:([^\b;]+)/),null===t?"NE":t[1]},E=function(e,t,n){var a,r,o,i,s=e.relPos(n,5);return i=12,o=e.textwidth(t,SSEH.SCALEFONT)+6,a=s.x-6,"right"==s.h?a-=o-i:"center"==s.h&&(a-=Math.round(o/2)-6),r=s.y,"bottom"==s.v?r-=i:"middle"==s.v?r-=Math.round(i/2):"top"==s.v&&(r-=4),{x:a,y:r,w:o}},I=function(e,t,n,a,r){e.cross(t.x,t.y,4,n,2),a&&e.label(a,t.x,t.y,4,r,SSEH.SCALEFONT,n)},P=function(e){return d+e[0].replace(/\s/g,"")},H=function(e,t,n){var a,r,o,i,s,l=SSEH.POPWIDTH,c=parseInt(e.style.left);return o=t.n.split(":"),r=t.id,i=-l/2,i+c<2&&(i=2-c),c-i>SSEH.BOXWIDTH-14&&(i=-l+(SSEH.BOXWIDTH-c)-14),a=Create.div(e,"mapPopup",r,{l:i}),Create.span(a,{n:o[1]},"missionTitle"),Create.br(a),t.t&&(s="imp"==t.t?"imp":"edl",Create.symbol(a,s,"symIcon")),t.d&&(Create.span(a,{n:t.d}),Create.br(a)),Create.span(a,{n:Parse.position(t.c)}),Create.br(a),t.de&&Create.span(a,{n:t.de}),r},k=function(){var e,t,n=f.img;return f.rad&&0!==f.scale?(e=f.rad*f.scale*2/SSEH.SCALE,t=0===n.width?1:n.height/n.width,{w:Math.round(e),h:Math.round(e*t)}):{w:n.width,h:n.height}},T=function(e){var t,a,r,o;return e.w<20?(a=e.t-5,o=e.w+10,r=e.h+10):(a=e.t,o=e.w,r=e.h),t=Create.div(n,"hilight","info"+d,{l:0,t:a,h:r,w:o}),-1==d.search(/sol|sbo|tno/)&&(t.style.borderRadius=px(Math.round(o/2))),t.title=f.name,t.onclick=UI.show,t},M=function(t,n,a){var r,o,i,s,l,c,m=UI.Height()-SSEH.EXTRA;for(i=n+16,o=UI.Scale.time(SSEH.STARTDATE,a),UI.Scale.time(SSEH.ENDDATE,a),s=SSEH.STARTDATE.getFullYear()+1,l=SSEH.ENDDATE.getFullYear(),c=new Date(s,0,1),r=s;r<=l;r++)c.setFullYear(r),o=UI.Scale.time(c,a),r%5==0?(t.text(r.toString(),o,i,SSEH.SCALEFONT,"center","#fff","bottom"),t.vline(o,i,5,"#fff",1.2)):t.vline(o,i,3,"#fff",.95);return"sol"==e&&(o=UI.Scale.time(new Date,a),t.vline(o,i,m-i,"#ccc",.4)),i+10};this.drawImage=function(e,t,c){
var m,u,p,g,C,S,y;return y=-1!==d.search(/jup|sat/)?240:120,m=k(),p="sol"===d?0:t+26,u=Math.round((c-m.w+SSEH.BEVEL)/2),a?a.style.left=px(u):a=Create.img(n,{n:f.name,i:f.img.src,y:p,x:u,w:m.w,h:m.h},"cImg"),h||-1!==d.search(/ura|nep/)||(h=T({t:p-1,w:m.w,h:m.h})),f.nrings>0&&(C=o.draw(e,{x:(c+SSEH.BEVEL)/2,y:p+m.h/2,w:m.w/y,h:m.h/y})),S=C?C.x-5:u-5,f.nmoons>0&&"ter"!=d&&r.draw(e,{x:S,y:p+m.h/2,sc:f.scmoons}),"sbo"===d&&(i.draw(e,{x:(c+SSEH.BEVEL)/5*3,y:p-15,sc:f.scmoons}),s.draw(e,{x:(c+SSEH.BEVEL)/4,y:p+40,sc:f.scmoons})),"tno"==d&&(s.draw(e,{x:(c+SSEH.BEVEL)/5,y:p+40,sc:f.scmoons}),l.draw(e,{x:(c+SSEH.BEVEL)/2+20,y:p+54,sc:f.scmoons})),u<0?(m.w=c-2,u=1):m.w+u>c&&(m.w=c-u-2),g=p+m.h,h||-1==d.search(/ura|nep/)||(h=T({t:p-1,w:m.w,h:m.h})),m.w<20&&(m.w+=10,u-=5),h.style.left=px(u-1),h.style.width=px(m.w),-1=="sol,ven,ter,lun,mar,sbo,sat".search(d)?g+=12:g=M(e,g,c-10),g},this.record=function(e){var t,n,a,r,o,i;if("sbo"==d?(a=e.Achievements("ast"),r=e.Achievements("com"),a&&r?n=a.concat(r):r?a||(n=r):n=a):n=e.Achievements(d),-1!=d.search(/^mer|ven|ter|lun|mar$/)&&(o=e.Locations(d))&&(p=p.concat(o)),n)for(t=0;t<n.length;t++)"phob"==n[t].d2&&"mar"==d||"tita"==n[t].d2||"gany"==n[t].d2?(i=n[t].d2.slice(0,2)+n[t].t,Common.names.createIf(i,Common.names.find(n[t].d2).n+" "+Common.names.find(n[t].t).n),SSEH.mtype[i]={n:""}):i=n[t].t,u[i]||(u[i]={f:0,lf:0,p:0,s:0,o:0,pl:0}),u[i][n[t].s]++},this.Height=function(){var e;return f.rsize?parseInt(f.rsize[1])+48:(e=k(),e.h+48)},this.Box=function(){return c},this.Name=function(){return f.name},this.createBox=function(){var e=UI.Width();return c=g(),c.style.top=px(-9999),c.style.left=px(Math.round((e-SSEH.BOXWIDTH+SSEH.BEVEL)/2)),r&&r.createBox(),o&&o.createBox(),i&&i.createBox(),s&&s.createBox(),l&&l.createBox(),c},t&&(n=document.getElementById(t)),n||(n=document.getElementsByTagName("body")[0]),f=parseObject(d),f.nmoons>0&&"ter"!=d&&(r=new Moons(d,n)),f.nrings>0&&(o=new Rings(d,n,r.getList())),"sbo"==d&&(i=new Sbo("com",n),s=new Sbo("ast",n)),"tno"==d&&(s=new Sbo("tno",n),l=new Dwarf(s.getData("plu"),n)),Common.sprites[d]={n:f.name,x:f.x,y:f.y}}function Moons(e,t){var n,a,r,o={},i=0,s=0,l=e,c={},m=t,h=function(e){var t;return t=Create.div(m,"hilight","moons"+l,{l:0,t:e.t,h:e.h}),t.title=o.name+" Moons",t.onclick=UI.show,t},d=function(){var e,t,n,a,r,i,s,h,d,p,g,C,S=[],y=["fname","orbit","per","diam"],v=[116,225,69,160];C=document.createDocumentFragment(),i=Create.div(C,"infoBox",l+"moons",{w:SSEH.BOXWIDTH}),Create.closex(i),d=Create.div(i,"col",null,{w:SSEH.BOXWIDTH-200}),Create.span(d,{n:o.name+" Moons"},"missionTitle"),Create.asymbol(d,{k:"ext",u:SSEH.SSELNK+o.name.toLowerCase()+"/moons"},"symLnk"),d=Create.div(i,"rcol",null,{w:200}),a=Create.a(d,{n:"Show all details",u:"#"}),a.onclick=UI.all,a.id="lnkmoon"+l,g=Create.div(i,"infoPanel"),h=Create.table(i,"infoTableAuto","moonstat"+l);for(r in c)c.hasOwnProperty(r)&&S.push({k:r,n:parseInt(c[r].a)-c[r].rad});for(S.sort(function(e,t){return e.n-t.n}),s=Create.thead(h),p=Create.tr(s,"tblHead"),e=0;e<y.length;e++)d=Create.td(p,Common.names.find("th"+y[e])),d.style.width=px(v[e]);for(s=Create.tbody(h),t=0;t<S.length;t++){for(r=S[t].k,p=Create.tr(s,"row","linemoon"+l+r),p.title="Click for more details",p.onclick=UI.toggle,e=0;e<y.length;e++){for(d=Create.td(p,{n:c[r][y[e]]||"-"},""),d.onmouseover=UI.Scale.enlarge,d.onmouseout=UI.Scale.enlarge,n=0;n<d.childNodes.length;n++)d.childNodes[n].onmouseover=UI.Scale.enlarge,d.childNodes[n].onmouseout=UI.Scale.enlarge;d.style.width=px(v[e]),c[r].dodraw&&"fname"==y[e]&&(d.style.fontWeight="bold")}p=Create.tr(s,"detPanel","detmoon"+l+r),a=Create.td(p),a.colSpan="4",d=Create.div(a,"col",null,{w:150}),f(d,r,"other"),f(d,r,"mass"),f(d,r,"grav"),f(d,r,"temp"),d=Create.div(a,"col",null,{w:145}),f(d,r,"dens"),f(d,r,"rot"),f(d,r,"tilt"),f(d,r,"alb"),d=Create.div(a,"rcol",null,{w:275}),f(d,r,"disc"),f(d,r,"gr"),f(d,r,"comp"),f(d,r,"atm"),f(d,r,"mag")}return u(g,S),m.appendChild(C),i},u=function(e,t){var a,r,o,i,m,h,d,u,f,p;if(i=10,p=(SSEH.BOXWIDTH-120)/s,f="mar"==l?35:7,"sat"!=l)for(a=0;a<t.length;a++)n=t[a].k,c[n].img&&""!==c[n].img&&(d=UI.Scale.image(c[n],f),r=UI.Scale.dist(c[n],p),r<i&&(r=i+5),r+d.w>SSEH.BOXWIDTH&&(r=SSEH.BOXWIDTH-d.w-5),o=100-d.h/2,i=r+d.w,u=Create.img(e,{n:c[n].name,i:c[n].img.src,y:o,x:r,w:d.w,h:d.h},"infoImg","picmoon"+l+n),u.onmouseover=UI.Scale.enlarge,u.onmouseout=UI.Scale.enlarge);else for(m=60,h=1,a=0;a<t.length;a++)n=t[a].k,c[n].img&&""!==c[n].img&&(d=UI.Scale.image(c[n],f),r=UI.Scale.dist(c[n],p),-1!=n.search(/janu|epim|tele|caly|poly|hele/)?("janu"==n&&(i+=5),r<i&&(r=i),o=100-m*h,(h=-h)>0&&(i+=10)):(r<i&&(r=i+8),r+d.w>SSEH.BOXWIDTH&&(r=SSEH.BOXWIDTH-d.w-5),o=100-d.h/2,-1!=n.search(/^(dio|rhe)$/)&&(r+=8),i=-1!=n.search(/^(dio|tet)$/)?r+d.w/2:r+d.w),u=Create.img(e,{n:c[n].name,i:c[n].img.src,y:o,x:r,w:d.w,h:d.h},"infoImg","picmoon"+l+n),u.onmouseover=UI.Scale.enlarge,u.onmouseout=UI.Scale.enlarge)},f=function(e,t,n){c[t][n]&&""!==c[t][n]&&(Create.field(e,{n:c[t][n]},n,!1),Create.br(e))};this.createBox=function(){a=d(),a.style.top=px(-9999),a.style.left=px(10)},this.getList=function(){var e,t=[];for(e in c)c.hasOwnProperty(e)&&t.push({n:c[e].name,d:c[e].desig,a:parseFloat(c[e].a),r:c[e].rad,i:parseFloat(c[e].i)||0,img:c[e].img});return t},this.draw=function(e,t){var n,a,o,s,l,d,u;l=t.x*t.sc,u=l/i;for(n in c)if(c[n].dodraw){if(!(a=UI.Scale.dist(c[n],u)))continue;d=UI.Scale.image(c[n],1),o=t.x-a,s=t.y-d.h/2,c[n].cimg?c[n].cimg.style.left=px(o):c[n].cimg=Create.img(m,{n:c[n].name,i:c[n].img.src,y:s,x:o,w:d.w,h:d.h},"cImg")}return r||(r=h({t:t.y-15,h:30})),r.style.left=px(t.x-l-5),r.style.width=px(l+5),{x:o,y:s,w:l,h:30}},o.name=Common.names.find(l).n,o.rad=Common.names.findRadius(l);for(n in objects)objects.hasOwnProperty(n)&&objects[n].par==l&&"m"==objects[n].type&&(c[n]=parseObject(n),("ter"!=l&&c[n].rad>150||"mar"==l)&&(c[n].dodraw=!0,parseFloat(c[n].a)>i&&(i=parseFloat(c[n].a))),c[n].img&&""!==c[n].img&&parseFloat(c[n].a)>s&&(s=parseFloat(c[n].a)))}function Rings(e,t,n){var a,r,o,i,s,l,c,m=e,h={},d=t,u=function(){var e,t,n,a,r,o,i,s,c,u,p,g,C=[],S=["fname","dist","w","h","opt"],v=[245,80,80,80,85],w=[160,100,110,105,95],b=[190,80,110,105,95];p=document.createDocumentFragment(),r=Create.div(p,"infoBox",m+"rings",{w:SSEH.BOXWIDTH}),Create.closex(r),c=Create.div(r,"col",null,{w:SSEH.BOXWIDTH-200}),Create.span(c,{n:l.name+" Rings"},"missionTitle"),Create.asymbol(c,{k:"ext",u:SSEH.SSELNK+l.name.toLowerCase()+"/rings"},"symLnk"),c=Create.div(r,"rcol",null,{w:200}),n=Create.a(c,{n:"Show all details",u:"#"}),n.onclick=UI.all,n.id="lnkring"+m,u=Create.div(r,"infoPanel",m+"ringpanel"),u.style.height=px(110),o=Create.table(r,"infoTableAuto","ringstat"+m);for(a in h)h.hasOwnProperty(a)&&C.push({k:a,n:parseInt(h[a].peri)});for(C.sort(function(e,t){return e.n-t.n}),g="jup"==m?v:"nep"==m?b:w,i=Create.thead(o),s=Create.tr(i,"tblHead"),e=0;e<S.length;e++)c=Create.td(s,Common.names.find("th"+S[e])),c.style.width=px(g[e]);for(i=Create.tbody(o),t=0;t<C.length;t++){for(a=C[t].k,s=Create.tr(i,"row","linering"+m+a),s.title="Click for more details",s.onclick=UI.toggle,e=0;e<S.length;e++)c=Create.td(s,{n:h[a][S[e]]||"-"},""),c.style.width=px(g[e]);s=Create.tr(i,"detPanel","detring"+m+a),n=Create.td(s),n.colSpan=5,c=Create.div(n,"col",null,{w:170}),y(c,a,"mass"),y(c,a,"comp"),y(c,a,"e"),c=Create.div(n,"col",null,{w:170}),y(c,a,"alb"),y(c,a,"sdens"),y(c,a,"len"),c=Create.div(n,"rcol",null,{w:230}),y(c,a,"disc"),y(c,a,"moons")}return d.appendChild(p),f(u,C),r},f=function(e,t){var n,a,r,o,i,s,u,f,S,y,v,w,b,x,E,I,P,H,k,T;for(T=p(d,"ovl"+m),r=new Cdraw(m+"ringcanvas",{parent:m+"ringpanel",width:SSEH.BOXWIDTH,height:110}),s="sat"==m?t.length-2:t.length-1,u=l.radius,a="sat"==m?h.erng:h[t[s].k],f=parseFloat(a.peri)+2*a.rad,"nep"==m&&(f=3.1*parseFloat(l.radius)),S=(SSEH.BOXWIDTH-20)/(f-u),w=Math.round(u*S),y=15-w,v=55,r.fillcircle(y,v,w,l.col),n=0;n<=s;n++)i=t[n].k,w=parseFloat(h[i].a)*S,b=2*h[i].rad*S,b<.5?b=1:b<2&&(b=2),x=h[i].opa?h[i].opa:1,"erng"==i?(E=r.makegradient(y+w-b/2,v,y+w+b/2,v,[{pos:0,col:"rgba(255,255,255,0.2)"},{pos:.19,col:"rgba(255,255,255,0.45)"},{pos:1,col:"rgba(255,255,255,0.2)"}]),x=1):"zetcr"==i?(E=r.makegradient(y+w-b/2,v,y+w+b/2,v,[{pos:0,col:"rgba(255,255,255,0.25)"},{pos:1,col:"rgba(255,255,255,0.4)"}]),x=1):"zetccr"==i?(E=r.makegradient(y+w-b/2,v,y+w+b/2,v,[{pos:0,col:"rgba(255,255,255,0.05)"},{pos:1,col:"rgba(255,255,255,0.25)"}]),x=1):-1!=h[i].name.search(/Division|Gap/)?(x=1,E="#000"):E="#fff",I=h[i].len&&""!==h[i].len?Math.PI/180*parseFloat(h[i].len):Math.PI/4,r.setparam("globalAlpha",x),r.arc(y,v,w,I,-I,!0,E,b),g(T,i,{x:y,y:v,r:w,w:b});for(r.setparam("globalAlpha",1),r.setparam("shadowColor","#000"),r.setparam("shadowBlur",1.5),n=1;n<10;n++)w=l.radius*S*n,n>1?r.text(n,y+w,108,SSEH.SCALEFONT,"center","#fff","bottom"):r.index("R<"+m.substring(0,1).toUpperCase(),y+w,108,SSEH.SCALEFONT,"center","#fff","bottom");for(r.setparam("shadowBlur",0),w=parseFloat(l.roche)*S,r.arc(y,v,w,Math.PI/2,-Math.PI/2,!0,"#f0c",1.5),"sat"==m?r.text("Roche Limit",y+w-2,2*v-4,SSEH.SCALEFONT,"left","#f0c"):r.text("Roche Limit",y+w-6,2*v-4,SSEH.SCALEFONT,"right","#f0c"),r.setparam("shadowBlur",1.5),o=10,n=0;n<c.length;n++)w=c[n].a*S,y+w>SSEH.BOXWIDTH||("Polydeuces"==c[n].n&&(o=15),w=C(w,v-o),y+w<124||y+w>SSEH.BOXWIDTH-100?(P="right",H=-6):(P="left",H=6,E="#fff"),a=Math.LOG10E*Math.log(c[n].r+1)+1,r.fillcircle(y+w,o,a,"#fff"),r.text(c[n].n,y+w+H,o,SSEH.SCALEFONT,P,E,"middle"),o=o>=80?10:o+15);k=Create.img(e,{i:SSEH.ICONS+"empty.png"},"infoArea"),k.useMap="#ovl"+m,k.hidefocus="true"},p=function(e,t){var n=document.createElement("map");return n.name=t,e&&e.appendChild(n),n},g=function(e,t,n){var a,r,o=[],i=document.createElement("area");for(i.shape="poly",r=n.w<4?n.r-2:n.r-n.w/2,a=0;a<=110;a+=10)o.push(Math.round(n.x+C(r,n.y-a)),a);for(r=n.w<4?n.r+2:n.r+n.w/2,a=110;a>=0;a-=10)o.push(Math.round(n.x+C(r,n.y-a)),a);return i.coords=o.join(","),i.title=h[t].fname,i.id="picring"+m+t,i.style.cursor="url('"+Common.symbols.nozoom.src+"'), auto",i.onmouseover=UI.showRing,i.onmouseout=UI.showRing,e&&e.appendChild(i),i},C=function(e,t){return Math.sqrt(e*e-t*t)},S=function(e){var t;return t=Create.div(d,"hilight","rings"+m,{l:0,t:e.t,h:e.h}),t.title=l.name+" Rings",t.onclick=UI.show,t},y=function(e,t,n){h[t][n]&&""!==h[t][n]&&(Create.field(e,{n:h[t][n]},n,!1),Create.br(e))};if(this.createBox=function(){o=u(),o.style.top=px(-9999),o.style.left=px(10)},this.draw=function(e,t){var n,a,r,o,c,h=Common.symbols[m+"rings"];return c=0===h.width?l.rsize.split(","):[h.width,h.height],r=Math.round(c[0]*t.w),o=Math.round(c[1]*t.h),a=t.y-Math.round(o/2),n=t.x-Math.round(r/2),s?s.style.left=px(n):s=Create.img(d,{n:l.name+" Rings",i:h.src,y:a,x:n,w:r,h:o},"cImg"),i||(i=S({t:a,h:o})),i.style.left=px(n),i.style.width=px(r),{x:n,y:a,w:r,h:o}},this.getList=function(){var e,t=[];for(e in h)h.hasOwnProperty(e)&&t.push({n:h[e].name,a:parseFloat(h[e].a),w:h[e].rad,h:h[e].th,i:parseFloat(h[e].i),opa:h[e].opa});return t},objects[m].rings&&""!==objects[m].rings){l={name:Common.names.find(m).n,mass:Common.names.findMass(m),radius:Common.names.findRadius(m),col:objects[m].col},l.roche=parseFloat(objects[m].roche)*l.radius,r=objects[m].desc.match(/rsize\:([^;]+)/),null!==r&&(l.rsize=r[1]),c=n,c.sort(function(e,t){return e.a-t.a});for(a in objects)objects.hasOwnProperty(a)&&objects[a].par==m&&"r"==objects[a].type&&(h[a]=parseObject(a))}}function Sbo(e,t){var n,a,r,o,i,s={},l=e.substring(0,1),c={},m={},h=t,d=function(e){var t;return t=Create.div(h,"hilight","sbo"+l,{l:0,t:e.t,h:e.h}),t.title=i.n,t.onclick=UI.show,t},u=function(){var e,t,n,a,r,o,s,d,u,g,C,S,y=[],v=["fname","orbit","per","diam"];switch(l){case"a":C=[148,195,62,165];break;case"t":C=[156,210,74,130];break;case"c":C=[196,194,70,110];break;default:C=[176,210,74,110]}S=document.createDocumentFragment(),r=Create.div(S,"infoBox",l+"sbo",{w:SSEH.BOXWIDTH}),Create.closex(r),u=Create.div(r,"col",null,{w:300}),Create.span(u,i,"missionTitle"),Create.asymbol(u,{k:"ext",u:SSEH.SSELNK+i.u},"symLnk"),"a"==l&&(Create.span(u,{n:"+ 1 dwarf planet"}),Create.asymbol(u,{k:"ext",u:SSEH.SSELNK+"ceres"},"symLnk")),u=Create.div(r,"rcol",null,{w:200}),n=Create.a(u,{n:"Show all details",u:"#"}),n.onclick=UI.all,n.id="lnksbo"+l,g=Create.div(r,"infoPanel"),o=Create.table(r,"infoTableAuto","stat"+l);for(a in c)c.hasOwnProperty(a)&&y.push({k:a,n:Math.abs(parseFloat(c[a].a))});for(y.sort(function(e,t){return e.n-t.n}),s=Create.thead(o),d=Create.tr(s,"tblHead"),e=0;e<v.length;e++)u=Create.td(d,Common.names.find("th"+v[e])),u.style.width=px(C[e]);for(s=Create.tbody(o),t=0;t<y.length;t++){a=y[t].k,f(s,c,a,v,C);for(var w in m)objects.hasOwnProperty(w)&&m[w].par===a&&f(s,m,w,v,C)}return p(g,y),h.appendChild(S),r},f=function(e,t,n,a,r){var o=Create.tr(e,"row","linesbo"+l+n);o.title="Click for more details",o.onclick=UI.toggle;for(var i=0;i<a.length;i++){var s=Create.td(o,{n:t[n][a[i]]||"-"},"");s.style.width=px(r[i]),("t"!==l&&parseFloat(t[n].rad)>=100||"t"===l&&"d"===t[n].type)&&"fname"===a[i]&&(s.style.fontWeight="bold"),"fname"===a[i]&&"m"===t[n].type&&(s.style.paddingLeft=px(12),s.style.width=px(r[i]-12)),s.onmouseover=UI.Scale.enlarge,s.onmouseout=UI.Scale.enlarge;for(var c=0;c<s.childNodes.length;c++)s.childNodes[c].onmouseover=UI.Scale.enlarge,s.childNodes[c].onmouseout=UI.Scale.enlarge}o=Create.tr(e,"detPanel","detsbo"+l+n);var m=Create.td(o);m.colSpan=4,s=Create.div(m,"col",null,{w:150}),g(s,t[n],"mass"),g(s,t[n],"grav"),g(s,t[n],"temp"),g(s,t[n],"peri"),s=Create.div(m,"col",null,{w:155}),g(s,t[n],"dens"),g(s,t[n],"rot"),g(s,t[n],"alb"),s=Create.div(m,"rcol",null,{w:250}),g(s,t[n],"disc"),g(s,t[n],"group"),g(s,t[n],"comp")},p=function(e,t){var a,r,o,i,s,m,h,d,u=-1;switch(i=12,s=100,l){case"a":h=12;break;case"c":h=640;break;case"t":h=7,i=10;break;default:h=14}for(a=0;a<t.length;a++)n=t[a].k,c[n].img&&""!==c[n].img&&(m=UI.Scale.image(c[n],h),m.w>24?(r=i+12,o=s-m.h/2,i=r+m.w):(r=i,o=s-60*u-m.h/2,1==u&&(i=r+m.w+15),u*=-1),d=Create.img(e,{n:c[n].name,i:c[n].img.src,y:o,x:r,w:m.w,h:m.h},"infoImg","picsbo"+l+n),d.onmouseover=UI.Scale.enlarge,d.onmouseout=UI.Scale.enlarge)},g=function(e,t,n){t[n]&&""!==t[n]&&(Create.field(e,{n:t[n]},n,!1),Create.br(e))};this.createBox=function(){a=u(),a.style.top=px(-9999),a.style.left=px(10)},this.getData=function(e){if(c.hasOwnProperty(e))return c[e]},this.draw=function(e,t){var n,a,s,m,u,f,p,g;if("a"==l){u=100,f=80;for(n in c)c[n].dodraw&&(a=(parseFloat(c[n].a)-2.1)*(f-10),p=UI.Scale.image(c[n],1),s=t.x-u/3+10*p.w,m=t.y+a,c[n].cimg?c[n].cimg.style.left=px(s):c[n].cimg=Create.img(h,{n:c[n].name,i:c[n].img.src,y:m,x:s,w:p.w,h:p.h},"cImg"));r||(r=d({t:t.y,h:f})),r.style.left=px(t.x),r.style.width=px(u)}else if("t"==l){u=160,f=160;for(n in c)"plu"!=n&&c[n].dodraw&&(a=(parseFloat(c[n].a)-37)/36*f,p=UI.Scale.image(c[n],1),s=t.x+16*p.w-60,m=t.y+a,c[n].cimg?c[n].cimg.style.left=px(s):c[n].cimg=Create.img(h,{n:c[n].name,i:c[n].img.src,y:m,x:s,w:p.w,h:p.h},"cImg"));r||(r=d({t:t.y,h:f})),r.style.left=px(t.x),r.style.width=px(u)}else g=Common.symbols.comet,u=g.width,f=g.height,o?o.style.left=px(t.x):o=Create.img(h,{n:i,i:g.src,y:t.y,x:t.x,w:u,h:f},"cImg"),r||(r=d({t:t.y-5,h:f+10})),r.style.left=px(t.x-5),r.style.width=px(u+10);return{x:s,y:m,w:u,h:f}},s.name=Common.names.find("sol").n,s.mass=Common.names.findMass("sol"),s.radius=Common.names.findRadius("sol"),i=Common.names.find(e),"t"!=l?(i.n+="s",i.u=i.n.toLowerCase()):i.u="kbos",i.t="_blank";for(n in objects)objects.hasOwnProperty(n)&&(objects[n].type==l||"a"==l&&"cer"==n||"t"==l&&-1!=n.search(/^(plu|eri|mak|hau)$/))&&(c[n]=parseObject(n),function(e){for(var t in objects)objects.hasOwnProperty(t)&&objects[t].par===e&&"m"===objects[t].type&&(m[t]=parseObject(t))}(n),c[n].img&&""!==c[n].img&&c[n].rad>100&&(c[n].dodraw=!0))}function Dwarf(e,t){var n,a,r,o,i=e,s=0,l=0,c=e.acr,m={},h=t,d=function(e){var t;return t=Create.div(h,"hilight","moons"+c,{l:0,t:e.t,h:e.h}),t.title=i.name+" & Moons",t.onclick=UI.show,t},u=function(){var e,t,n,a,r,o,s,l,d,u,g,C,S=[],y=["fname","orbit","per","diam"],v=[116,215,84,155];g=document.createDocumentFragment(),o=Create.div(g,"infoBox",c+"moons",{w:SSEH.BOXWIDTH}),Create.closex(o),l=Create.div(o,"col",null,{w:SSEH.BOXWIDTH-200}),Create.span(l,{n:i.name+" & Moons"},"missionTitle"),Create.asymbol(l,{k:"ext",u:SSEH.SSELNK+i.name.toLowerCase()+"/moons"},"symLnk"),l=Create.div(o,"rcol",null,{w:200}),a=Create.a(l,{n:"Show all details",u:"#"}),a.onclick=UI.all,a.id="lnkdp"+c,u=Create.div(o,"infoPanel",null,{w:SSEH.BOXWIDTH,h:SSEH.BOXWIDTH/2}),C=Create.table(o,"infoTableAuto","moonstat"+c);for(r in m)m.hasOwnProperty(r)&&S.push({k:r,n:parseInt(m[r].a)});for(S.sort(function(e,t){return e.n-t.n}),s=Create.thead(C),d=Create.tr(s,"tblHead"),e=0;e<y.length;e++)l=Create.td(d,Common.names.find("th"+y[e])),l.style.width=px(v[e]);for(s=Create.tbody(C),t=0;t<S.length;t++){for(r=S[t].k,d=Create.tr(s,"row","linedp"+c+r),d.title="Click for more details",d.onclick=UI.toggle,e=0;e<y.length;e++){for(l=Create.td(d,{n:m[r][y[e]]||"-"},""),l.onmouseover=UI.Scale.enlarge,l.onmouseout=UI.Scale.enlarge,n=0;n<l.childNodes.length;n++)l.childNodes[n].onmouseover=UI.Scale.enlarge,l.childNodes[n].onmouseout=UI.Scale.enlarge;l.style.width=px(v[e]),m[r].dodraw&&"fname"==y[e]&&(l.style.fontWeight="bold")}d=Create.tr(s,"detPanel","detdp"+c+r),a=Create.td(d),a.colSpan=4,l=Create.div(a,"col",null,{w:150}),p(l,r,"other"),p(l,r,"mass"),p(l,r,"grav"),p(l,r,"temp"),l=Create.div(a,"col",null,{w:130}),p(l,r,"dens"),p(l,r,"rot"),p(l,r,"tilt"),p(l,r,"alb"),l=Create.div(a,"rcol",null,{w:275}),p(l,r,"disc"),p(l,r,"group"),p(l,r,"comp"),p(l,r,"atm"),p(l,r,"mag")}return f(u,S),h.appendChild(g),o},f=function(e){var t,n,a,r={plu:{x:307,y:118},cha:{x:375,y:133},nix:{x:190,y:84},hydr:{x:564,y:110},kerb:{x:532,y:130},styx:{x:326,y:212}};o=Create.div(e,"infoMap","map"+c,{w:SSEH.BOXWIDTH,h:SSEH.BOXWIDTH/2}),o.style.top=px(0),i.map&&(o.style.display="none",n=SSEH.MAPS+i.map,i.map=new Image,i.map.onload=function(){o.style.height=px(this.height>0?Math.round(parseInt(this.height)/parseInt(this.width)*SSEH.BOXWIDTH)+32:Math.round(parseInt(this.naturalHeight)/parseInt(this.naturalWidth)*SSEH.BOXWIDTH)+32),o.style.display="block"},i.map.src=n),o.appendChild(i.map);for(t in m)m[t].img&&""!==m[t].img&&(a=r[t],dim=UI.Scale.image(m[t],2),dim.w<8&&(dim={w:8,h:8*dim.h/dim.w}),n=Create.img(o,{n:m[t].name,i:m[t].img.src,y:a.y,x:a.x,w:dim.w,h:dim.h},"infoImg","picdp"+c+t),n.onmouseover=UI.Scale.enlarge,n.onmouseout=UI.Scale.enlarge)},p=function(e,t,n){m[t][n]&&""!==m[t][n]&&(Create.field(e,{n:m[t][n]},n,!1),Create.br(e))};this.createBox=function(){a=u(),a.style.top=px(-9999),a.style.left=px(10)},this.getList=function(){var e,t=[];for(e in m)m.hasOwnProperty(e)&&t.push({n:m[e].name,d:m[e].desig,a:parseFloat(m[e].a),r:m[e].rad,i:parseFloat(m[e].i)||0,img:m[e].img});return t},this.draw=function(e,t){var n,a,o,i,l,c,u;l=t.x*t.sc/2,u=l/s;for(n in m)if(m[n].dodraw){if(!(a=UI.Scale.dist(m[n],u)))continue;c=UI.Scale.image(m[n],1),o=t.x-a,i=t.y-c.h/2,m[n].cimg?m[n].cimg.style.left=px(o):m[n].cimg=Create.img(h,{n:m[n].name,i:m[n].img.src,y:i,x:o,w:c.w,h:c.h},"cImg")}return r||(r=d({t:t.y-15,h:30})),r.style.left=px(t.x-l-5),r.style.width=px(l+20),{x:o,y:i,w:l,h:30}};for(n in objects)objects.hasOwnProperty(n)&&objects[n].par==c&&"m"==objects[n].type&&(m[n]=parseObject(n),m[n].rad>150&&(m[n].dodraw=!0,parseFloat(m[n].a)>s&&(s=parseFloat(m[n].a))),m[n].img&&""!==m[n].img&&parseFloat(m[n].a)>l&&(l=parseFloat(m[n].a)));m[c]=parseObject(c),m[c].dodraw=!0}function Panel(e,t,n,a){var r,o,i,s,l=SSEH.BOXWIDTH,c=SSEH.BOXWIDTH/2,m="normal bold 13px Arial, Helvetica, sans-serif",h=t,d=c-70,u=function(e,t){var n,a=f(e);return n=parseFloat(t)||0,n>90&&(n=180-n),n=parseFloat(n)*Math.PI/180,a>90&&(n/=Panel.sc[h].i/180),{x:a*Math.cos(n),y:a*Math.sin(n)}},f=function(e){return(Math.LOG10E*Math.log(parseFloat(e))-Panel.sc[h].sc1)/Panel.sc[h].sc2*l},p=function(e){if(!e)return 2;var t=2*parseFloat(e);return t=2.7*Math.pow(.1*t,.3),t<2&&(t=2),t},g=function(){var e,t,n,a;for(n=1e3;n<1e9;n*=10)for(t=n;t<10*n;t+=n)e=f(t),1e3!=t&&(r.vline(e,c-20,4,"#fff",1),t<=s||t!=n&&t!=2*n&&t!=5*n||(a=t>=1e6?(t/1e6).toString()+"M":t>=1e5?(t/1e3).toString()+"k":t.toString(),r.text(a,e,c-14,SSEH.SCALEFONT,"center","#fff","top")));for(r.text("km",1,c-14,SSEH.SCALEFONT,"left","#fff","top"),n=1;n<1e4;n*=10)for(t=n;t<10*n;t+=n)e=f(t*s),r.vline(e,c-40,4,"#fff",1),t!=n&&t!=2*n&&t!=5*n||r.text(t,e,c-34,SSEH.SCALEFONT,"center","#fff","top");a=h.substring(0,1).toUpperCase(),r.index("R<"+a,1,c-34,SSEH.SCALEFONT,"left","#fff","top")};this.draw=function(){var e,t,n,a,C,S,y,v,w,b,x;for(r.fillrect(0,0,l,c,"#000"),t=f(objects[h].hill*s),r.arc(1,d,t,Math.PI/40,-Math.PI/40,!0,"#00f",2),t=f(objects[h].roche*s),r.arc(1,d,t,Math.PI/10,-Math.PI/10,!0,"#d0d",2),t=f(objects[h].rcrit*s),r.arc(1,d,t,Math.PI/25,-Math.PI/25,!0,"#c00",2),t=f(1.3*s),a=parseFloat(objects[h].tilt),a>90&&(a=180-a),n=t*Math.sin(a*Math.PI/180),t*=Math.cos(a*Math.PI/180),r.line(1,d,t,d-n,"#0c0",2),v=p(s),w=v*Common.symbols[h].height/Common.symbols[h].width,r.image(Common.symbols[h],1-v/2,d-w/2,v,w),a=0;a<i.length;a++)-1==i[a].n.search(/Division|Gap/)&&(S=u(i[a].a-i[a].w/2,i[a].i),y=u(i[a].a+i[a].w/2,i[a].i),v=y.x-S.x,w=p(i[a].h/2),b=i[a].opa||1,w<=2?(w=2,x="rgba(255,255,255,"+b+")"):x=r.makegradient(S.x,d-S.y-w/2,S.x,d-y.y+w/2,[{pos:0,col:"rgba(255,255,255,0)"},{pos:.5,col:"rgba(255,255,255,"+b+")"},{pos:1,col:"rgba(255,255,255,0)"}]),r.fillrect(S.x,d-S.y-w/2,v,w,x));for(a=0;a<o.length;a++)v=p(o[a].r),v<2&&(v=2),w=2==v?2:o[a].img&&""!==o[a].img?v*o[a].img.height/o[a].img.width:v,S=u(o[a].a,o[a].i),o[a].img&&""!==o[a].img?r.image(o[a].img,S.x-v/2,d-S.y-w/2,v,w):(x=parseFloat(o[a].i)>90?"#fcc":"#ffc",r.fillcircle(S.x,d-S.y,v/2,x));e=Panel.fb[h];for(C in e)e.hasOwnProperty(C)&&(t=-1!==e[C].d.toString().search(/km/)?parseInt(e[C].d):e[C].d*s,S=u(t,e[C].i),n=12,e[C].y&&(n-=e[C].y),x=Common.names.findColor(e[C].t),r.cross(S.x,d-S.y,4,x,1),r.vtext(C,S.x,d-S.y-n,m,"left",x,-45));e=groups[h];for(C in e)e.hasOwnProperty(C)&&(e[C].hasOwnProperty("a")?r.vtext(C,f(e[C].x),d+e[C].y,m,"left","#fff",e[C].a):e[C].hasOwnProperty("i")?(S=u(e[C].x,e[C].i),r.text(C,S.x,d-S.y,m,"center","#fff")):r.text(C,f(e[C].x),d+e[C].y,m,"center","#fff"));m=SSEH.SCALEFONT,n=12,r.text("Irregular Moons:",4,2+n,m,"left","#fff"),r.text("(P) Prograde",4,2+2*n,m,"left","#fff"),r.fillcircle(94,2*n-2,4,"#ffc"),r.text("(R) Retrograde",4,2+3*n,m,"left","#fff"),r.fillcircle(94,3*n-2,4,"#fcc"),e=objects[h].tilt+"º",r.text("Planetary Orbital Plane Incl.: "+e,120,2+n,m,"left","#fff"),r.hline(342,n-1,20,"#0c0",2.3),e=objects[h].roche.toString()+" R"+h.substring(0,1)+" / "+Math.round(objects[h].roche*s).toCommaString()+" km",r.text("Roche Limit (Ice): "+e,120,2+2*n,m,"left","#fff"),r.hline(342,2*n-1,20,"#d0d",2.3),e=objects[h].rcrit.toString()+" R"+h.substring(0,1)+" / "+Math.round(objects[h].rcrit*s).toCommaString()+" km",r.text("Critical Distance: "+e,120,2+3*n,m,"left","#fff"),r.hline(342,3*n-1,20,"#c00",2.3),e=objects[h].hill.toString()+" R"+h.substring(0,1)+" / "+Math.round(objects[h].hill*s).toCommaString()+" km",r.text("Hill Sphere: "+e,120,2+4*n,m,"left","#fff"),r.hline(342,4*n-1,20,"#00f",2.3),g()},this.init=function(e,t){o=e,i=t,this.draw()},r=new Cdraw("mapbox"+h,{parent:e,width:l,height:c}),s=Common.names.findRadius(h),n&&a&&this.init(n,a)}function SPanel(e){var t,n=SSEH.BOXWIDTH,a=SSEH.BOXWIDTH/2,r="normal bold 13px Arial, Helvetica, sans-serif",o=a/2,i=function(e,t){var n,a=s(e);return n=parseFloat(t)||0,n>90&&(n=180-n),n=parseFloat(n)*Math.PI/480,{x:a*Math.cos(n),y:a*Math.sin(n)}},s=function(e){return(Math.LOG10E*Math.log(parseFloat(e))+1)/3.76*n},l=function(e){if(!e)return 2;var t=2*parseFloat(e);return t=2*Math.pow(.1*t,.3),t<2&&(t=2),t},c=function(){var e,n,r,o;for(r=.1;r<1e7;r*=10)for(n=r;n<10*r;n+=r)e=s(n),.1!=n&&(t.vline(e,a-20,4,"#fff",1),n!=r&&n!=2*r&&n!=5*r||(o=n>=1e6?(n/1e6).toString()+"M":n>=1e5?(n/1e3).toString()+"k":n.toString(),t.text(o,e,a-14,SSEH.SCALEFONT,"center","#fff","top")));t.text("AU",1,a-14,SSEH.SCALEFONT,"left","#fff","top")};this.draw=function(){var e,m,h,d,u,f,p,g,C,S,y,v;t.fillrect(0,0,n,a,"#000"),t.image(Common.symbols.sbg,0,0),m=s(85),h=s(160),p=t.makeradialgradient(0,o,m,0,o,h,[{pos:0,col:"rgba(255,255,0,0)"},{pos:.06,col:"rgba(255,255,0,0.6)"},{pos:.14,col:"rgba(255,255,0,0.4)"},{pos:1,col:"rgba(255,255,0,0)"}]),t.fillcircle(0,o,h,p),m=s(.75),h=s(1.5),p=t.makeradialgradient(0,o,m,0,o,h,[{pos:0,col:"rgba(0,153,0,0)"},{pos:.4,col:"rgba(0,153,0,0.6)"},{pos:1,col:"rgba(0,153,0,0)"}]),t.fillcircle(0,o,h,p),m=s(4.6),h=s(7),p=t.makeradialgradient(0,o,m,0,o,h,[{pos:0,col:"rgba(255,255,255,0)"},{pos:.05,col:"rgba(255,255,255,0.3)"},{pos:1,col:"rgba(255,255,255,0)"}]),t.fillcircle(0,o,h,p);for(u in objects)objects.hasOwnProperty(u)&&-1!=objects[u].type.search(/s|p|d/)&&(e=objects[u],f="s"==e.type?{x:1,y:0}:i(parseFloat(e.a),e.i),p=Common.symbols.hasOwnProperty(u+"orig")?Common.symbols[u+"orig"]:Common.symbols[u],C=l(e.rad),g=C*p.width/p.height,t.save(),t.rotate(-e.tilt||0,f.x,o-f.y),t.image(p,-g/2,-C/2,g,C),t.restore());f=i(1.5,90),t.save(),t.rotate(-95,f.x,o-90),t.image(Common.symbols.comet,0,0),t.restore(),e=groups.sol;for(u in e)if(e.hasOwnProperty(u)){switch(e[u].t){case"n":y=SSEH.SCALEFONT,S=e[u].col||"#ccc";break;case"c":y=r,S="#xfx";break;case"an":case"a":case"t":y=r,S="#ffx";break;case"p":y=r,S="#fff";break;case"d":y=r,S="#eee";break;default:y=r,S="#fff"}v=(14-Math.ceil((Math.log(e[u].x)+1)/2.7)).toString(16),S=S.replace(/x/g,v),e[u].hasOwnProperty("a")?t.vtext(u,s(e[u].x),o+e[u].y,y,"left",S,e[u].a):e[u].hasOwnProperty("i")?(f=i(e[u].x,e[u].i),t.text(u,f.x,o-f.y,y,"center",S)):t.text(u,s(e[u].x),o+e[u].y,y,"center",S)}e=Panel.fb.sol;for(u in e)e.hasOwnProperty(u)&&(f=i(e[u].d,e[u].i),d=6,e[u].y&&(d-=e[u].y),S="#aaa",t.cross(f.x,o-f.y,4,S,1),t.vtext(u,f.x,o-f.y-d,r,"left",S,-45));c()},t=new Cdraw("mapboxsol",{parent:e,width:n,height:a}),Common.names.findRadius("sol"),this.draw()}function Info(e){var t,n,a,r,o,i,s=e,l=[],c={},m=function(e){var t,n=0;return i&&(t=Create.div(s,"hilight","fullscreen",{l:0,t:0,h:38,w:40}),t.title="Toggle fullscreen mode",t.onclick=UI.toggleFullScreen,n=40),t=Create.div(s,"hilight","infogen",{l:n,t:0,h:38,w:40}),t.title="General Information",t.onclick=UI.show,t},h=function(){var e,t,n,a,r=["info","legnd","abrev","lnch","lvs","creds"];for(t=Create.div(s,"infoBox","geninfo",{w:SSEH.BOXWIDTH,h:520}),Create.closex(t),e=0;e<r.length;e++)switch(a=Create.div(t,"infoTab","tab"+r[e]),Create.text(a,Common.names.find(r[e]).n),a.onclick=SSEH.showInfo,0===e&&(a.className="infoTabA"),n=Create.div(t,"infoPane","pan"+r[e],{w:SSEH.BOXWIDTH}),e){case 0:u(n),n.style.display="block";break;case 1:d(n);break;case 2:f(n);break;case 3:p(n);break;case 4:v(n);break;case 5:b(n)}return t},d=function(e){var t,n,a,r,o,i,s,l,c,m,h;c=18,m=new Cdraw("legIco",{top:px(33),left:px(0),parent:"panlegnd",width:540,height:15*c}),a=Create.div(e,"legCol","legCol1",{t:6,w:144,l:290}),n=Create.div(a,"legTitle",null),Create.text(n,Common.names.find("mitp").n),l=15,s=0,i=291;for(h in SSEH.mtype)SSEH.mtype.hasOwnProperty(h)&&("rvm"==h&&(a=Create.div(e,"legCol","legCol1",{t:6,w:144,l:420}),n=Create.div(a,"legTitle",null),Create.br(n),i=421,s=0),SSEH.mtype[h].col&&(m.fillrect(i,s,c,l,SSEH.mtype[h].col),Create.span(a,{n:SSEH.mtype[h].name},"indent"),Create.br(a),s+=c+.3));for(a=Create.div(e,"legCol","legCol2",{t:6,w:144,l:10}),n=Create.div(a,"legTitle",null,{t:0,l:0}),Create.text(n,Common.names.find("mstat").n),r=["s","p","f","o","pl"],t=0;t<r.length;t++)o=Common.names.find(r[t]),Create.span(a,{n:o.n},"legStatus status"+o.n),Create.br(a);for(a=Create.div(e,"legCol","legCol3",{t:6,w:144,l:150}),n=Create.div(a,"legTitle",null),Create.text(n,Common.names.find("evic").n),s=0,i=150,r=["lf","fb","app","oi","edl","imp"],t=0;t<r.length;t++)Common.sprites[r[t]]&&("lf"!=r[t]&&m.fillrect(i,s,c,l,"#eee"),m.image(Common.symbols.sprite,Common.sprites[r[t]].x,Common.sprites[r[t]].y,16,16,i+2,s,l,l),Create.span(a,{n:SSEH.icons[r[t]].name},"indent"),Create.br(a),s+=c+.3);a=Create.div(e,"legColW","legCol5",{t:160,w:SSEH.BOXWIDTH-20,l:10}),a.style.marginTop=px(8),n=Create.div(a,"legTitle",null),Create.text(n,"Other Symbols"),Create.symbol(a,"down","legImgW legS"),Create.text(a," Show/hide detailed information "),Create.symbol(a,"mbgnb","legImgW"),Create.symbol(a,"smlfyb","legImgW"),Create.text(a," Enter/exit fullscreen display "),Create.br(a),Create.symbol(a,"weather","legImgWS"),Create.text(a,"Weather Info "),Create.symbol(a,"haz","legImgWS"),Create.text(a,"Hazard Info "),Create.symbol(a,"ext","legImgWS"),Create.text(a,"External Link"),Create.symbol(a,"globe","legImgWS"),Create.text(a,"Map Link"),a=Create.div(e,"legCol","legCol4",{t:248,w:SSEH.BOXWIDTH-20,l:10}),n=Create.div(a,"legTitle",null),Create.text(n,"Parameters"),Create.bold(a,"Orbits "),Create.span(a,{n:"Spacecraft:"},"uline"),Create.text(a," periapsis x apoapsis (AU/km) x inclination (degrees)"),Create.br(a),Create.text(a," or perihelion (AU) x eccentricity x inclination (degrees) (Escape trajectories)"),Create.br(a),Create.span(a,{n:"Natural Bodies:"},"uline"),Create.text(a," semimajor axis (AU/km) x eccentricity x inclination (degrees)"),Create.br(a),Create.bold(a,"Radius "),Create.text(a," equatiorial [x planet facing] x polar (km) or equatorial (km) / flattening "),Create.br(a),Create.bold(a,"Missions "),Create.text(a," Total Missions launched / successfull / ongoing"),Create.br(a),Create.bold(a,"Composition "),Create.text(a," Percentages of all components with > 1% volume fraction; Core: % of total radius; Porosity: % of empty space cotained. "),Create.br(a),Create.bold(a,"Temperature "),Create.text(a," Minimum / average / maximum (Kelvin) "),Create.br(a),Create.text(a,"See glossary for definition of terms."),Create.br(a),Create.br(a),Create.bold(a,"Other than that, the general idea is: click or hover on anything for further information.")},u=function(e){var t,n,a,r;e.style.background="#000 url("+Common.symbols.lo.src+") no-repeat center 300px",e.style.backgroundSize="contain",r=Create.div(e,"legCol",null,{t:26,l:20,w:SSEH.BOXWIDTH-50}),t=Create.div(r,"legTitle"),t.style.fontSize=px(20),t.style.marginBottom=px(6),Create.text(t,SSEH.TITLE),Create.bold(r,"Solar System = "),Create.text(r,"Our sun, all bodies that orbit it, and all bodies orbiting those. Click on their images for data about them."),Create.br(r),Create.bold(r,"Exploration = "),Create.text(r,"All missions visiting or observing Solar System bodies and traveling beyond Earth orbit."),Create.br(r),Create.bold(r,"History = "),Create.text(r,"The Period from the first attempt to launch something beyond Earth orbit (1958) to the latest planned event in that regime (a.k.a. future history)."),Create.br(r),Create.br(r),Create.text(r,"Go to: "),a=Hist.Bodies();for(n in a)a.hasOwnProperty(n)&&"sol"!=n&&("jup"==n&&Create.br(r),"info"+n,t=Create.div(r,"legLnk","info"+n),t.onclick=UI.go,Create.text(t,"#"+Common.names.find(n).n));t=Create.div(e,"histTitle",null,{t:480}),Create.text(t,"Version "+SSEH.VERSION+" "),t.appendChild(Common.symbols.cc),Create.text(t," "+SSEH.DATE+SSEH.AUTHOR+" ")},f=function(e){var t,n,a,r,o,i,s=[];for(e.style.backgroundColor="#fff",e.style.border="1px solid #000",o=Create.div(e,"legColW","legCol1",{t:6,l:10,w:SSEH.BOXWIDTH-20}),i=Create.div(o,"legTitle",null),Create.text(i,Common.names.find("acro").n),t=0;t<SSEH.abbrevs.length;t++)a=SSEH.abbrevs[t],s.push(Common.names.find(a)),s[s.length-1].k=a,Common.loc.hasOwnProperty(a)&&Common.loc[a].hasOwnProperty("desc")&&-1!=Common.loc[a].desc.search(/show/)&&null!==(n=Common.loc[a].desc.match(/show\:([^;\:]+)/))&&(s[s.length-1].n=n[1]);for(s.sort(function(e,t){return e.n.toLowerCase()>t.n.toLowerCase()?1:-1}),t=0;t<s.length;t++)a=s[t].k.replace("_",""),Common.sprites.hasOwnProperty(a)&&(r=-1==a.search(/^(oi|edl|lf|fb|td|imp|app)$/)?1.5:1,Create.symbol(o,a,"symLegend",r)),Create.bold(o,s[t].n+": "),
Create.text(o,s[t].l),s[t].hasOwnProperty("u")&&Create.asymbol(o,{k:"ext",u:"http://"+s[t].u},"symLnk"),Create.br(o)},p=function(e){var t,n,a,i=Hist.Probes();e.style.backgroundColor="#fff",n=Create.div(e,"legCol","legCol1",{t:6,l:10}),a=Create.div(n,"legTitle",null),a.style.color="#000",Create.text(a,Common.names.find("lpyr").n);for(t in i)i.hasOwnProperty(t)&&l.push(i[t].Achievementsctry());c.all=g(),o=new Cdraw("legLL",{top:px(16),left:px(5),parent:"panlnch",width:r-10,height:220}),C(),e.appendChild(y(l))},g=function(e){var t,n,a,r,o,i={};if(e){if(t=e.split("="),2!=t.length)return;n=new RegExp("\\b"+t[1]+"\\b"),a=t[0]}for(o=0;o<l.length;o++)r=l[o].l.getFullYear(),e&&!n.test(l[o][a])||(i.hasOwnProperty(r)||(i[r]=0),i[r]++);return i},C=function(e){var t,n,a,r,i,s=e||window.event;for(a=o.Width(),n=o.Height()-20,r="#000",s&&((i=s.target.id)&&""!==i||(i=s.target.parentNode.id)),o.clear(),t=0;t<21;t++)0===t?o.hline(24,n-8*t,a-28,r,1):o.hline(24,n-8*t,4,r,1),t%2==0&&o.text(t.toString(),20,n-8*t,SSEH.SCALEFONT,"right",r,"middle");i?(S("lall",a,n),S(i,a,n)):S("all",a,n),s&&s.stopPropagation()},S=function(e,t,n){var a,r,i,s,l,m,h=SSEH.STARTDATE.getFullYear()+1,d=SSEH.ENDDATE.getFullYear(),u=new Date;for(l="#000","lall"==e?(l="#ddd",e="all"):"all"!=e&&(i=e.split("="),"c"===i[0]?(l=Common.ctry[i[1]].col,"su"===i[1]?d=1991:"ru"===i[1]&&(h=1991)):"s"===i[0]&&(i=i[1].split("|"),i=Common.desc[i[0]].desc.split(":"),l=i[1]),m=2),c.hasOwnProperty(e)||(c[e]=g(e)),s=new Date(h,0,1),a=h;a<=d;a++)s.setFullYear(a),"all"==e&&s.diff(u)<0&&"#ddd"!=l&&(l="#bbb"),r=UI.Scale.time(s,t+40)-56,i=c[e].hasOwnProperty(a)?8*c[e][a]:0,"all"==e&&a%5==0&&(o.text(a.toString(),r,n+8,SSEH.SCALEFONT,"center","#000","top"),o.vline(r,n,4,"#000",1.3)),(s.diff(u)>0||i>0)&&o.fillcircle(r,n-i,3,l),0!==i&&o.vline(r,n-i,i,l,m)},y=function(e){var t,n,a,r,o,i,s,l,c,m=[],h=["all","s","p","f","lf","o","pl"],d={};c=document.createDocumentFragment(),i=Create.table(c,"infoTable"),i.style.position="absolute",i.style.top=px(230),i.onmouseover=C;for(t in Common.ctry)if(Common.ctry.hasOwnProperty(t))for(n=new RegExp(t),d[t]={f:0,lf:0,p:0,s:0,o:0,pl:0},a=0;a<e.length;a++)n.test(e[a].c)&&d[t][e[a].s]++;for(t in d)d.hasOwnProperty(t)&&(d[t].all=Parse.sumType(d[t]));for(d.all={all:0,f:0,lf:0,p:0,s:0,o:0,pl:0},a=0;a<h.length;a++)d.all[h[a]]=Parse.sumField(d,h[a]);for(t in d)d.hasOwnProperty(t)&&(d[t].sp=(d[t].s+d[t].p).toString()+" ("+d[t].p+")",d[t].fl=(d[t].f+d[t].lf).toString()+" ("+d[t].lf+")","all"!=t&&m.push({k:t,n:d[t].all}));for(m.sort(function(e,t){return t.n-e.n}),h=["sp","fl","o","pl","all"],s=Create.tr(i,"tblHead"),Create.td(s,{n:" "}),a=0;a<h.length;a++)if(l=Create.td(s,Common.names.find(h[a])),"all"!=h[a])for("sp"==h[a]?l.id="s=s|p":"fl"==h[a]?l.id="s=f|lf":l.id="s="+h[a],l.style.cursor="help",l.onmouseover=C,r=0;r<l.childNodes.length;r++)l.childNodes[r].onmouseover=C;for(a=0;a<m.length;a++)if(t=m[a].k,d[t].all>0){for(s=Create.tr(i),o=Common.names.find(t),o.i=t,l=Create.td(s,o),l.id="c="+t,l.style.cursor="help",l.onmouseover=C,r=0;r<l.childNodes.length;r++)l.childNodes[r].onmouseover=C;for(r=0;r<h.length;r++)Create.td(s,{n:d[t][h[r]]})}for(s=Create.tr(i),Create.td(s,Common.names.find("all")),a=0;a<h.length;a++)Create.td(s,{n:d.all[h[a]]});return c},v=function(e){var t;e.style.backgroundColor="#fff",e.style.border="1px solid #000",t=Create.div(e,"legColW","legCol0",{t:6,l:10,w:SSEH.BOXWIDTH-20}),Create.span(t,Common.names.find("lvstt"),"legTitle"),Create.br(t),Create.text(t,"In order of appearance. Stats: total / failed / planned launches"),t=Create.div(e,"legColW","legColLV",{t:42,l:4,w:SSEH.BOXWIDTH-20})},w=function(e,t,n){var a,r=0;for(a=t;a>t-n;a--)r<e[a]&&(r=e[a]);return r+6},b=function(e){var t,n,a;e.style.backgroundColor="#fff",e.style.border="1px solid #000",n=Create.div(e,"legColW","legCol1",{t:6,l:10,w:SSEH.BOXWIDTH-20}),a=Create.div(n,"legTitle",null),Create.text(a,Common.names.find("credits").n),Create.bold(n,"Solar System Objects: "),t=Create.div(n),t.innerHTML="Sun:<i> NASA/SDO/GSFC</i><br>Mercury:<i> NASA/JHUAPL/Carnegie Institution of Washington</i><br>Venus<i> NASA/JPL/Mattias Malmer</i><br>Venus map:<i> NASA/USGS/JPL</i><br>Earth:<i> NASA/GSFC</i><br>Moon:<i> NASA/USGS</i><br>Mars:<i> NASA/JPL/Malin Space Science Systems</i><br>Mars map:<i> NASA/JPL/USGS</i><br>Phobos, Deimos:<i> NASA/JPL-Caltech/University of Arizona</i><br>Itokawa:<i> JAXA</i><br>Toutatis:<i> CNSA</i><br>Mathilde, Eros:<i> NASA/JPL/JHUAPL</i><br>Ida, Gaspra, Borelly:<i> NASA/JPL</i><br>Annefrank, Wild 2:<i> NASA/JPL-Caltech/University of Maryland/Cornell</i><br>Tempel 1, Hartley 2:<i> NASA/JPL-Caltech/UMD</i><br>Halley:<i> NASA/ESA/Giotto Project</i><br>Braille:<i> NASA/JPL/USGS</i><br>Lutetia, Šteins, Churyumov-Gerasimenko<i>: ESA/Rosetta/NAVCAM</i><br>Ceres, Vesta:<i> NASA/JPL-Caltech/UCLA/MPS/DLR/IDA</i><br>Pallas:<i> NASA/ESA/STScI</i><br>Hygiea:<i> ESO/P. Vernazza et al.</i><br>Jupiter & Moons:<i> NASA/JPL/DLR</i><br>Galilean Moons:<i> NASA/ESA/A. Simon (GSFC)</i><br>Saturn & Moons:<i> NASA/JPL-Caltech/SSI/LPI</i><br>Neptune, Uranus & moons:<i> NASA/JPL</i><br>Neptune rings:<i> NASA/JPL/Paul Schenk (LPI)</i><br>Pluto:<i> NASA/JHUAPL/SWRI, NASA/ESA/SRI/M. Buie (base map)</i><br>TNOs:<i> NASA</i></i><br>",Create.bold(n,"Spacecraft/Missions: "),t=Create.div(n),t.innerHTML="Please refer to the links given for each mission"};this.createLVlog=function(){var e,t,n,a,r,o,i,s,l,c,m,h=[],d=[],u=[],f="",p=document.getElementById("legColLV");s=document.createDocumentFragment(),o=Hist.LVs(),i=Hist.Probes();for(n in i)if(i.hasOwnProperty(n)&&(a=i[n].AchievementsLnch())&&(r=Common.names.findLV(a.lv))){if(1==a.part)continue;if(""!==a.id&&-1!=f.search(a.id))continue;o[r].setStat("t"),"lf"==a.st&&o[r].setStat("f"),"pl"==a.st&&o[r].setStat("p"),o[r].setStat("dt",a.dt),f+=a.id}for(n in o)o.hasOwnProperty(n)&&(l=o[n].Date())&&h.push({id:n,dt:l});for(h.sort(function(e,t){return e.dt<=t.dt?-1:1}),e=0;e<h.length;e++){if(n=h[e].id,a=o[n].list(),m=Create.div(s,"legColC",null,{w:82}),l=h[e].dt.getFullYear(),Create.span(m,{n:l},"bold"),Create.br(m),u[e]=Create.img(m,a),d[e]=3*parseInt(a.d),u[e].style.height=px(d[e]),(e+1)%7==0||e==h.length-1)for(c=w(d,e,7),t=e;t>e-7&&(t==e||(t+1)%7!=0);t--)u[t].style.marginTop=px(c-d[t]);Create.br(m),Create.span(m,a,"lvid"),Create.br(m),Create.span(m,{n:a.st.t+" / "+a.st.f+" / "+a.st.p})}p.appendChild(s)},this.show=function(e){var n,a=t.childNodes;for(n=0;n<a.length;n++)"infoPane"==a[n].className&&(a[n].id==e?a[n].style.display="block":a[n].style.display="none")},this.createBox=function(){t=h(),t.style.top=px(-9999),t.style.left=px(34)},this.draw=function(e){var t,r,o=i?42:0,l=UI.isFullScreen()?Common.sprites.smlfy:Common.sprites.mbgn;n||(t=Create.div(s,"info",null,{w:40+o}),i&&(a=Create.symbol(t,"mbgn","symFulscr")),r=Create.span(t,{n:"☰"}),r.style.left=px(o+2),n=m()),a.style.backgroundPosition=px(-l.x)+" "+px(-l.y)},r=SSEH.BOXWIDTH,i=null!==document.fullScreenElement||null!==document.mozFullScreen||null!==document.webkitIsFullScreen||null!==document.msFullscreenEnabled,this.createBox()}function LV(e,t){var n,a,r,o,i=function(e,t){var n,r=["m","d","pf","st","ust","pm","th","fam"];for(n=0;n<r.length;n++)a.hasOwnProperty(r[n])&&(!1!==t&&Create.span(e,Common.names.find("lv"+r[n]),"lstcategory"),Create.span(e,{n:a[r[n]]}),Create.br(e));Create.span(e,{n:a.dt}),Create.br(e)},s=function(e,t){var n,r=["m","d","pf","st","ust","fuel","th","pm0","pm1","pm2","fam","dt1","dt2"];for(n=0;n<r.length;n++)!0===t?"dt2"!=r[n]&&Create.span(e,Common.names.find("lv"+r[n]),"lstcategory"):a.hasOwnProperty(r[n])?Create.span(e,{n:a[r[n]]}):Create.span(e,{n:"-"}),Create.br(e);!0===t&&(Create.span(e,Common.names.find("lvstat"),"category"),Create.br(e))},l=function(e){var t,n,a,r=[];if(n=e.split(",")){for(t=0;t<n.length;t++)a=n[t],Common.ctry.hasOwnProperty(a)&&r.push({n:Common.ctry[a].name,k:a});return r}},c=function(e){var t,n,a="";if(e&&""!==e){for(n=e.split("/"),t=0;t<n.length;t++)""!==a&&(a+=" / "),"-"==n[t]||""===n[t]?a+="-":a+=n[t].toCommaString();return a+Parse.unit("kg")}};this.show=function(e){},this.drawData=function(e,t){s(e,t)},this.setStat=function(e,t){a.stat.hasOwnProperty(e)&&("dt"!=e?a.stat[e]++:(null===a.stat.dt||a.stat.dt.diff(t)<0)&&(a.stat.dt=new Date(t.valueOf())))},this.list=function(){return{n:a.sname,i:a.icon.i,d:a.d,st:a.stat,ctry:a.ctry}},this.Date=function(){return a.stat.dt},t&&(n=document.getElementById(t)),n||(n=document.getElementsByTagName("body")[0]),r=e,a=function(e){var t,n,a={};for(a.name={n:r},e.n&&""!==e.n&&(a.name={n:e.n+" ("+r+")"}),a.sname=r.replace(/(Centaur).*/,"$1"),e.alt&&""!==e.alt&&(a.alt={n:e.alt}),a.ctry=l(e.ctry),e.m&&""!==e.m&&(a.m=e.m.toCommaString()+Parse.unit("kg")),a.pm=c(e.pm),e.d&&""!==e.d&&(a.d=e.d.replace(/x/g,Common.SPC+"×"+Common.SPC)+Parse.unit("m")),e.pf&&""!==e.pf&&(a.pf=e.pf.replace(/x/g,Common.SPC+"×"+Common.SPC)+Parse.unit("m")),a.dt=e.dt.replace(/\.\./g,"…"),a.st=e.st,a.fuel=e.fuel,e.ust&&""!==e.ust&&(a.ust=e.ust),e.th&&""!==e.th&&(a.th=e.th.toCommaString()+Parse.unit("kN")),e.fam&&""!==e.fam&&(a.fam=e.fam),a.desc=e.desc,e.icon&&""!==e.icon&&(a.icon={i:SSEH.LV+e.icon}),a.stat={t:0,f:0,p:0,dt:null},n=e.dt.split(/\.\./),a.dt1=n[0],1==n.length?a.dt2=" ":n[1].length>1?a.dt2=n[1]:a.dt2="⋯",n=e.pm.split(/\//),t=0;t<n.length;t++)a["pm"+t]="-"==n[t]?"-":n[t].toCommaString()+Parse.unit("kg");return a}(Common.lv[e]),o=function(e){var t,o,s,l,c,m;for(l=document.createDocumentFragment(),c=Create.div(l,"infoPopup","lv"+r,{w:300}),m=Create.div(c,"col",null,{w:230}),Create.span(m,a.name,"missionTitle"),Create.br(m),a.alt&&(Create.span(m,a.alt),Create.br(m)),i(m),m=Create.div(c,"rcol",null,{w:70}),t=0;t<a.ctry.length;t++)Create.asymbol(m,a.ctry[t],"missionFlag");return Create.br(m),o=Create.img(m,a.icon,"lvIcon"),s=3*parseInt(a.d),o.style.height=px(s),s>144&&(o.style.position="static"),s<120&&"STS"!=r&&(c.style.width=px(260),m.style.width=px(30)),o.style.width="auto",n.appendChild(l),c}(),o.style.top=px(-9999),o.style.left=px(10)}function LC(e,t){var n,a,r,o={},i=function(e){var t,n;if(e&&!(e.length<2)){switch(e[0]){case"url":t={u:"http://"+e[1],k:"ext"};break;case"n":t=Common.names.find(e[0]);break;case"show":t=e.length>2?{n:e[1],p:e[2]}:{n:e[1],p:"NW"};break;case"az":n=e[1].split(".."),t={l:n[0],h:n[1]};break;case"reg":t={n:e[1]};break;case"loc":t=m(e[1]);break;case"shmap":case"kml":case"x":case"y":t=e[1];break;default:return}return t}},s=function(e){var t,n=[],a={};for(t=0;t<Common.lpad.length;t++)Common.lpad[t].par&&Common.lpad[t].par==e&&(Common.lpad[t].hasOwnProperty("syn")?a[Common.lpad[t].syn]=Common.lpad[t].n:n.push({n:Common.lpad[t].n,lv:Common.lpad[t].lv.split(";")}));for(t=0;t<n.length;t++)a.hasOwnProperty(n[t].n)&&(-1!=a[n[t].n].search(/SLC/)?n[t].n="(S)"+n[t].n:n[t].n+="/"+a[n[t].n]);return n},l=function(e,t,n){var r,o,i,s,l,c,m;e&&(m=new Cdraw("lcmap"+a,{top:px(24),left:px(5),parent:"lc"+a,width:440,height:250}),l=Trig.deg2rad(e.l),c=Trig.deg2rad(e.h),t=t||410,n=n||30,r=t+25*Math.sin(l),o=n-25*Math.cos(l),i=t+25*Math.sin(c),s=n-25*Math.cos(c),m.startp(t,n,"rgba(255,0,0,0.2)"),m.movep(r,o),m.arcp(t,n,25,l-Math.PI/2,c-Math.PI/2,!1),m.endp(t,n,!0),m.line(t,n,r,o,"#000",1),m.line(t,n,i,s,"#000",1))},c=function(e,t){var n,a;for(n=0;n<e.length;n++){for(Create.span(t,e[n],"bold"),Create.text(t,": "),a=0;a<e[n].lv.length;a++)a>0&&Create.text(t,", "),Create.span(t,{n:e[n].lv[a]});Create.br(t)}},m=function(e){return{k:"globe",t:"_blank",n:e}},h=function(e){var t,n,a,r=[];if(n=e.split(";")){for(t=0;t<n.length;t++)a=n[t],Common.ctry.hasOwnProperty(a)&&r.push({n:Common.ctry[a].name,k:a});return r}};this.drawData=function(e,t){},this.drawAzimuth=function(e,t,n,r){var i,s,l,c,m,h,d,u,f;if(e){if(r=r||0,f=Parse.pos(o.loc.n).split(","),s=(90-parseFloat(f[0]))*n/180,i=(parseFloat(f[1])+180)*t/360+r,"ksc"!==a&&"uch"!==a){d=Trig.deg2rad(o.az.l),u=Trig.deg2rad(o.az.h),l=i+38*Math.sin(d),c=s-38*Math.cos(d),m=i+38*Math.sin(u),h=s-38*Math.cos(u),e.startp(i,s,"rgba(255,0,0,0.2)"),e.movep(l,c),e.arcp(i,s,38,d-Math.PI/2,u-Math.PI/2,!1),e.endp(i,s,!0),e.line(i,s,l,c,"#000",1),e.line(i,s,m,h,"#000",1);var p=rkt[o.ctry[0].k];e.image(icons,p.x,p.y,p.w,p.h,i-6.5,s-23.4,13,23.4)}else i-=6;var g=o.hasOwnProperty("shmap")?o.shmap:o.show.p;return e.label(o.show.n,i,s,6,g,"bold 16px 'Trebuchet MS'","#000"),res={n:o.show.n,l:o.name.l,c:o.ctry[0].k,url:o.url,tp:"lc"},o.ctry.length>1&&(res.h=o.ctry[1].k),res}},this.setStat=function(e,t){},this.Name=function(){return o.name.n},this.Box=function(){return r},this.list=function(){return{n:o.name,a:o.show.n,loc:o.loc.n,o:o.show.p,ctry:o.ctry}},t&&(n=document.getElementById(t)),n||(n=document.getElementsByTagName("body")[0]),a=e,function(e){var t,n;for(n=Read.data(e.name),o.name=Read.string(n[0]),o.id=a,e.other&&""!==e.other&&(o.other=Read.string(e.other.split(":"),!0)),e.desig&&""!==e.desig&&(o.desig=Read.string(e.desig.split(":"),!0)),o.ctry=h(e.ctry),e.map&&""!==e.map&&(o.map={i:SSEH.LC+e.map}),n=Read.data(e.desc),t=0;t<n.length;t++)o[n[t][0]]=i(n[t]);o.loc&&o.kml&&(o.loc.u=SSEH.GEOLNK.replace(/%ref%/g,o.kml)),o.pads=s(a)}(Common.lc[e]),r=function(e){var t,r,i,s,m;for(i=document.createDocumentFragment(),s=Create.div(i,"infoPopup","lc"+a,{w:442}),m=Create.div(s,"col",null,{w:300}),Create.span(m,o.name,"missionTitle"),o.desig&&Create.span(m,{n:" ("+o.desig.n+")"},"missionTitle"),Create.asymbol(m,o.url,"symLnk"),m=Create.div(s,"rcol",null,{w:140}),t=0;t<o.ctry.length;t++)Create.asymbol(m,o.ctry[t],"missionFlag");return m=Create.div(s,"col",null,{w:440}),r=Create.img(m,o.map,"lcIcon"),r.onload=function(){this.parentNode.style.height=px(this.height-10)},m=Create.div(s,"col",null,{w:230}),m=Create.div(s,"col",null,{w:230}),o.desig&&(Create.span(m,{n:o.name.l}),Create.br(m)),o.other&&(Create.span(m,o.other),Create.br(m)),o.reg&&(Create.span(m,o.reg),Create.br(m)),o.loc&&(Create.asymbol(m,o.loc,"symGeo"),Create.a(m,o.loc),Create.br(m)),o.az&&(Create.span(m,Common.names.find("lcaz"),"category"),Create.span(m,{n:o.az.l+Parse.unit("deg")+".."+o.az.h+Parse.unit("deg")})),m=Create.div(s,"col",null,{w:210}),c(o.pads,m),n.appendChild(i),l(o.az),s}(),r.style.top=px(-9999),r.style.left=px(10)}Cdraw.SOLID=[1],Cdraw.DASH=[4,4],Cdraw.DOT=[1.5,3.5],Cdraw.LDASH=[8,8],Cdraw.SDASH=[2,4],Cdraw.DASHDOT=[4,4,1,4];var Trig={sinh:function(e){return(Math.pow(Math.E,e)-Math.pow(Math.E,-e))/2},cosh:function(e){return(Math.pow(Math.E,e)+Math.pow(Math.E,-e))/2},tanh:function(e){return 2/(1+Math.exp(-2*e))-1},asinh:function(e){return Math.log(e+Math.sqrt(e*e+1))},acosh:function(e){return Math.log(e+Math.sqrt(e*e-1))},normalize0:function(e){return(e+3*Math.PI)%(2*Math.PI)-Math.PI},normalize:function(e){return(e+2*Math.PI)%(2*Math.PI)},deg2rad:function(e){return e*Math.PI/180},hour2rad:function(e){return e*Math.PI/12},rad2deg:function(e){return 180*e/Math.PI},rad2hour:function(e){return 12*e/Math.PI},PI:Math.PI,PI2:2*Math.PI,PI_2:Math.PI/2},SI={a:1e-18,f:1e-15,p:1e-12,n:1e-9,u:1e-6,"μ":1e-6,m:.001,c:.01,k:1e3,M:1e6,G:1e9,T:1e12,P:1e15,E:1e18},UI=UI||{width:0,height:0,boxwidth:0,bevel:0,iscancelled:!1,scale:1,left:0,right:0};UI.vanish=function(e){var t,n;for(n=!1===e?document.querySelectorAll(".infoPopup"):document.querySelectorAll(".infoBox, .infoPopup"),t=0;t<n.length;t++)n[t].style.opacity=0;setTimeout(UI.shift,1e3)},UI.shift=function(){var e,t;for(t=document.querySelectorAll(".infoBox, .infoPopup"),e=0;e<t.length;e++)"0"===t[e].style.opacity&&(t[e].style.top=px(-9999))},UI.wait=function(e,t,n){var a=document.getElementById("waitmsg");a&&(e?(a.style.top=px(t),a.style.left=px(n),a.style.display="block",UI.iscancelled=!1):("block"==a.style.display&&(UI.iscancelled=!0),a.style.display="none"))},UI.cancelled=function(){return UI.iscancelled},UI.Width=function(){var e=0;return e=document.documentElement.clientWidth?document.documentElement.clientWidth:window.innerWidth,(0===e||e<700)&&(e=700),e},UI.Height=function(e){return isNumber(e)&&(UI.height+=e),UI.height},UI.show=function(e,t){var n,a,r,o=(e||window.event,UI.getBoxPos(e)),i=t||this;return a=i.offsetTop+i.clientHeight+2,n=i.id.match(/^(sbo|rings|moons|info)(.+)/),null!==n&&(r=document.getElementById(n[2]+n[1])),r||UI.cancelled()?UI.wait(!1):(UI.wait(!0,a,o.c),window.setTimeout(function(){UI.show(e,i)},500)),!!r&&(1==r.style.opacity?(UI.vanish(),parseInt(r.style.top)!=a&&window.setTimeout(function(){UI.show(e,i)},250)):(UI.vanish(),r.style.left=px(o.l),r.style.top=px(a),r.style.opacity=1,UI.Scroll.set(r)),!1)},UI.go=function(e){var t,n;null!==(t=this.id.match(/^(leg|info)(.+)/))&&(UI.vanish(),n=document.getElementById("info"+t[2]),UI.Scroll.top(n))},UI.Scroll=new function(){var e,t,n,a,r=function(){return window.pageYOffset||document.documentElement.scrollTop},o=function(){return window.innerHeight||document.documentElement.clientHeight},i=function(){return a/n},s=function(){return a+=25,e-t/2*(Math.cos(Math.PI*i())+1)},l=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;this.set=function(i){var s,c,m;i&&(m="string"==typeof i?document.getElementById(i):i,s=m.getBoundingClientRect(),c=o(),s.bottom<c||(t=s.height>c?s.top:s.bottom-c)<=0||(e=r()+t,n=25*Math.round(t/25)*2,n<25&&(n=25),a=0,l(this.move)))},this.top=function(o){var i,s;o&&(s="string"==typeof o?document.getElementById(o):o,i=s.getBoundingClientRect(),t=i.top,e=r()+t,n=25*Math.round(t/25)*2,n>2e3&&(n=25*Math.round(Math.pow(t,.85)/25)*2),n<25&&(n=25),a=0,l(this.move))},this.move=function(){var t=s();Math.abs(e-t)<1||(window.scrollTo(0,t),a<n&&l(UI.Scroll.move))}},UI.getBoxPos=function(e){var t,n,a=UI.boxwidth,r=UI.Width(),o=e||window.event;return n=o&&o.clientX?o.clientX:r/2,t=n-a/2+5,t<0&&(t=8),t>r-a-32&&(t=r-a-32),n-=99,n<8&&(n=8),n>r-232&&(n=r-232),{l:t,c:n}},UI.showBox=function(e){var t=document.getElementById(e);return t&&UI.show(null,t),!1},UI.showImg=function(e){var t,n,a,r=e||window.event;if(this.id)for(t=this.childNodes,n=0;n<t.length;n++)if("img"==t[n].nodeName.toLowerCase()){"mouseout"==r.type?t[n].style.top=px(-9999):"mouseover"==r.type&&(a=-t[n].height/2+8,t[n].style.top=px(a));break}},UI.Scale={oldsize:{w:0,h:0,t:0,l:0},dist:function(e,t){if(e.a)return parseFloat(e.a)*t},image:function(e,t){var n,a,r,o;if(r=t||1,e)return e.eqrad&&0!==e.scale?(a=e.eqrad<1?1:e.eqrad,n=5*Math.pow(a*e.scale,.9)/UI.scale*r,n<5&&(n=5),o=0===e.img.width?1:e.img.height/e.img.width,{w:n,h:n*o}):{w:e.img.width,h:e.img.height}},time:function(e,t){var n,a=t?t-UI.bevel:1;return n=Math.round((e.valueOf()-UI.left)/(UI.right-UI.left)*a),t&&(n+=UI.bevel),n},enlarge:function(e){var t,n,a,r,o=e||window.event;-1!=o.target.id.search(/pic/)?a=o.target:(n=o.target.parentNode.id,n&&""!==n||(n=o.target.parentNode.parentNode.id),n=n.replace(/line/,"pic"),a=document.getElementById(n)),a&&(r=a.height/a.width,120==parseInt(a.style.width)?(a.style.width=px(UI.Scale.oldsize.w),a.style.height=px(UI.Scale.oldsize.h),a.style.top=px(UI.Scale.oldsize.t),a.style.left=px(UI.Scale.oldsize.l),a.style.zIndex=300,UI.Scale.oldsize={w:0,h:0,t:0,l:0}):(UI.Scale.oldsize={w:parseFloat(a.style.width),h:parseFloat(a.style.height),t:parseFloat(a.style.top),l:parseFloat(a.style.left)},UI.Scale.oldsize.w<120?(a.style.cursor="url('"+Common.symbols.zoomin.src+"'), auto",a.style.width=px(120),a.style.height=px(120*r),t=UI.Scale.oldsize.t+UI.Scale.oldsize.h/2-120*r/2,t<4&&(t=4),t>244-120*r&&(t=244-120*r),a.style.top=px(t),t=UI.Scale.oldsize.l+UI.Scale.oldsize.w/2-60,t<4&&(t=4),t>UI.boxwidth-124&&(t=UI.boxwidth-124),a.style.left=px(t),a.style.zIndex=301):a.style.cursor="url('"+Common.symbols.nozoom.src+"'), auto"),n||(n=a.id.replace(/pic/,"line"),UI.showEntry(n)),o.stopPropagation())}},UI.toggle=function(e){var t=this,n=t.nextSibling;n&&("130px"!=n.style.maxHeight?(n.firstChild.style.display="inline-block",n.style.maxHeight=px(130),window.setTimeout(function(){UI.View.set(t)},600)):(n.style.maxHeight=px(0),n.firstChild.style.display="none"))},UI.showRing=function(){if(this.id){var e=this.id.replace(/pic/,"line");UI.showEntry(e)}},UI.showEntry=function(e){var t,n=document.getElementById(e);if(n)if(-1==n.style.backgroundColor.search(/rgb/))n.style.background="rgb(255, 255, 204)",n.nextSibling.firstChild.style.display="inline-block",n.nextSibling.style.maxHeight=px(120),window.setTimeout(function(){UI.View.set(n)},600);else{if(n.style.background="transparent",null!==(t=e.match(/(ring.{3}|moon.{3}|sbo.)/))&&(t="lnk"+t[1],-1!=document.getElementById(t).innerHTML.search(/Hide/)))return;n.nextSibling.firstChild.style.display="none",n.nextSibling.style.maxHeight=px(0)}},UI.View=new function(){var e,t,n,a,r,o,i=function(){return o/r},s=function(){return o+=30,t-n/2*(Math.cos(Math.PI*i())+1)};this.set=function(i){if(i){if(t=null,e=i.parentNode,a=e.firstChild.offsetTop,e.scrollHeight>e.clientHeight&&(i.offsetTop+i.clientHeight+i.nextSibling.clientHeight>e.scrollTop+e.clientHeight&&(t=i.offsetTop+i.clientHeight+i.nextSibling.clientHeight-e.clientHeight-a),i.offsetTop<e.scrollTop&&(t=i.offsetTop-a)),null===t&&e.parentNode.parentNode)return void UI.Scroll.set(e.parentNode.parentNode);n=t-e.scrollTop,r=30*Math.round(Math.abs(n)/30)*2,r<30&&(r=30),o=0,window.setTimeout(this.move,30)}},this.move=function(){var t,n=s();e.scrollTop=n,t=o>=r?0:30,t>0?window.setTimeout(UI.View.move,30):e.parentNode.parentNode&&UI.Scroll.set(e.parentNode.parentNode)}},UI.all=function(){var e,t=document.getElementsByClassName("detPanel"),n=-1==this.innerHTML.search(/Hide/),a=this.id.replace(/lnk/,""),r=null;if(n){for(e=0;e<t.length;e++)t[e].id&&-1!=t[e].id.search(a)&&(t[e].firstChild.style.display="inline-block",t[e].style.maxHeight=px(120),r=e);this.innerHTML="Hide details",r&&t[r].parentNode.parentNode.parentNode&&UI.Scroll.set(t[r].parentNode.parentNode.parentNode)}else{for(e=0;e<t.length;e++)t[e].id&&-1!=t[e].id.search(a)&&(t[e].firstChild.style.display="none",t[e].style.maxHeight=px(0));this.innerHTML="Show all details"}return!1},UI.isFullScreen=function(){return document.fullScreenElement&&null!==document.fullScreenElement||document.mozFullScreen||document.webkitIsFullScreen},UI.toggleFullScreen=function(){document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement?document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():document.documentElement.requestFullscreen?document.documentElement.requestFullscreen():document.documentElement.msRequestFullscreen?document.documentElement.msRequestFullscreen():document.documentElement.mozRequestFullScreen?document.documentElement.mozRequestFullScreen():document.documentElement.webkitRequestFullscreen&&document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)};var Create={br:function(e){var t=document.createElement("br");return e&&e.appendChild(t),t},text:function(e,t){var n=document.createTextNode(t);return e&&e.appendChild(n),n},bold:function(e,t){var n=document.createElement("b");return n.appendChild(document.createTextNode(t)),e&&e.appendChild(n),n},div:function(e,t,n,a){var r=document.createElement("div");return t&&(r.className=t),n&&(r.id=n),a&&"object"==typeof a&&(a.hasOwnProperty("t")&&(r.style.top=px(a.t)),a.hasOwnProperty("l")&&(r.style.left=px(a.l)),a.hasOwnProperty("h")&&(r.style.height=px(a.h)),a.hasOwnProperty("w")&&(r.style.width=px(a.w))),e&&e.appendChild(r),r},span:function(e,t,n,a){var r,o=document.createElement("span");return n&&(o.className=n),a&&(o.id=a),t&&(r=t.n.toString(),-1!=r.search(/\d/)&&(r=this.number(r)),o.innerHTML=r,t.l&&(o.title=t.l,t.u||(o.style.cursor="help")),t.c&&(o.style.color=t.c)),e&&e.appendChild(o),o},a:function(e,t,n){var a;if(t.n||t.u)return t.u?(a=document.createElement("a"),n&&(a.className=n),this.span(a,t,n),a.href=t.u,t.t&&(a.target=t.t),e&&e.appendChild(a),a):this.span(e,t,n)},img:function(e,t,n,a){if(t&&"object"==typeof t){var r=document.createElement("img");return n&&(r.className=n),a&&(r.id=a),r.src=t.i,t.hasOwnProperty("n")&&(r.title=t.l?t.l+" ("+t.n+")":t.n),t.x&&(t.hasOwnProperty("x")&&(r.style.left=px(t.x)),t.hasOwnProperty("y")&&(r.style.top=px(t.y)),t.hasOwnProperty("h")&&(r.style.height=px(t.h)),t.hasOwnProperty("w")&&(r.style.width=px(t.w))),e&&e.appendChild(r),r}},aimg:function(e,t,n){var a;if(t){if(!t.u&&!t.i)return this.span(e,t,n);if(t.i?(a=document.createElement("img"),a.src=t.i,n&&(a.className=n),t.n||t.l||!t.u?a.title=t.l?t.l+" ("+t.n+")":t.n:a.title=t.u):a=this.span(null,t,n),t.u){var r=document.createElement("a");return r.href=t.u,t.t&&(r.target=t.t),n&&(r.className=n),r.appendChild(a),e&&e.appendChild(r),r}return e&&e.appendChild(a),a}},table:function(e,t,n){var a=document.createElement("table");return t&&(a.className=t),n&&(a.id=n),e&&e.appendChild(a),a},thead:function(e,t){var n=document.createElement("thead");return t&&(n.className=t),e&&e.appendChild(n),n},tbody:function(e,t){var n=document.createElement("tbody");return t&&(n.className=t),e&&e.appendChild(n),n},tr:function(e,t,n){var a=document.createElement("tr");return t&&(a.className=t),n&&(a.id=n),e&&e.appendChild(a),a},td:function(e,t,n){var a=document.createElement("td");return n&&(a.className=n),t&&(t.i&&this.symbol(a,t.i,"missionFlag"),this.span(a,t,n)),e&&e.appendChild(a),a},field:function(e,t,n,a,r,o,i){var s,l,c;if(!0===a&&this.br(e),t&&"-"!=t){if(!0!==a&&!1!==a&&this.br(e),this.span(e,Common.names.find("t"+n),"category"),isArray(t))for(c=r||", ",s=this.span(e,null,o,i),l=0;l<t.length;l++)l>0&&this.text(s,c),this.span(s,t[l]);else s=t.hasOwnProperty("n")?this.span(e,t,o,i):this.span(e,{n:t},o,i);return s}},closex:function(e){var t=this.a(e,{n:"x",u:"javascript:UI.vanish()"},"close");t.style.left=px(SSEH.BOXWIDTH-3),t.title="Close box"},symbol:function(e,t,n,a){var r,o,i=this.div(e,n);return o=Common.sprites[t],r=a||1,i.title=o.n,i.style.background="url("+Common.symbols.sprite.src+") "+-o.x/r+"px "+-o.y/r+"px / "+px(240/r),i},asymbol:function(e,t,n,a){var r,o,i;if(t)return Common.sprites.hasOwnProperty(t.k)?(i=t.u?this.a(e,{u:t.u,t:"_blank",n:" "},n):this.div(e,n),o=Common.sprites[t.k],r=a||1,i.title=-1!=t.k.search(/ext|tw|globe/)?t.u:o.n,i.style.background="url("+Common.symbols.sprite.src+") "+-o.x/r+"px "+-o.y/r+"px / "+px(240/r),i):this.a(e,t,n+"W")},number:function(e){var t=e.replace(/(\d)[eE]\+?(-?[\d]+)/g,"$1×10<sup>$2</sup>");return t=t.replace(/\^\+?(-?[\d]+)/g,"<sup>$1</sup>")}},Read={string:function(e,t){if(e)return 1==e.length?{n:e[0]}:e[0].length<=3&&!t?{n:e[1]+" ("+e[0]+")"}:{n:e[0],l:e[1]}},data:function(e){var t,n,a=[];if(!e)return[];if(t=e.split(";"),t.length<1)return[];for(n=0;n<t.length;n++)a[n]=t[n].split(":");return a},url:function(e,t){var n,a;if(e)return e.length>1?(n=e[1],a=Common.names.find(e[0],!1)):t?(n=e[0],a=Common.names.find(t)):(n=e[0],a=Common.names.find("More")),-1==n.search(/^[\.\/]/)&&(n="http://"+n,a.t="_blank"),a.u=n,"weather"!=e[0]&&"haz"!=e[0]||(a.k=e[0]),"tw"==e[0]&&(a.n="@"+a.u.replace(/.*\//,"")),a}};String.prototype.toCommaString=function(){var e=this.split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},Number.prototype.toCommaString=function(){var e=this.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},String.prototype.toScience=function(){var e,t,n="";return e=this.match(/(^\D+)/),null!==e?(n=e[1],t=parseFloat(this.substring(n.length)).toPrecision(4)):t=parseFloat(this).toPrecision(4),t=t.replace(/\.?0+[eE]/,"e"),n+t},Number.prototype.toScience=function(){var e=this.toPrecision(4);return e=e.replace(/\.?0+[eE]/,"e")},Array.prototype.unique=function(e){return function(){return this.filter(e)}}(function(e,t,n){return n.indexOf(e,t+1)<0}),Date.prototype.add=function(e,t){var n=this.valueOf();if(e){switch(t||"d"){case"y":case"yr":n+=31556926080*e;break;case"m":case"mo":n+=26298e5*e;break;case"d":case"dy":n+=864e5*e;break;case"h":case"hr":n+=36e5*e;break;case"n":case"mn":case"mon":n+=6e4*e;break;case"s":case"sec":n+=1e3*e;break;case"ms":n+=e}return new Date(n)}},Date.prototype.diff=function(e,t){var n;if(e){switch(n=e.valueOf()-this.valueOf(),t||"d"){case"y":case"yr":n/=31556926080;break;case"m":case"mo":n/=26298e5;break;case"d":case"dy":n/=864e5;break;case"h":case"hr":n/=36e5;break;case"n":case"mn":n/=6e4;break;case"s":case"sec":n/=1e3}return n}},Date.prototype.toISOString||(Date.prototype.toISOString=function(){function e(e){return e<10?"0"+e:e}return this.getUTCFullYear()+"-"+e(this.getUTCMonth()+1)+"-"+e(this.getUTCDate())}),Date.prototype.frac=function(){return(this.getHours()+this.getTimezoneOffset()/60+this.getMinutes()/60+this.getSeconds()/3600)/24};var Parse={unit:function(e){if(e)switch(e){case"kN":case"km":case"m":case"e":case"kg":return Common.SPC+e;case"au":return Common.SPC+e.toUpperCase();case"deg":case"i":return"°"}},distance:function(e,t){var n="",a=null;if(e=e.toString(),null!==(a=e.match(/([\-\d\.e\^]*\d)(mi|km|m|au|deg|i|e)?/)))switch(a[2]){case"m":n=a[1].toCommaString()+Common.SPC+"m";break;case"km":n=a[1].toCommaString()+Common.SPC+"km";break;case"mi":n=Math.round(1.609344*a[1]).toCommaString()+Common.SPC+"km";break;case"au":n=a[1]+Common.SPC+"AU";break;case"deg":case"i":n=a[1]+"°";break;case"e":n=a[1]+"";break;case void 0:var r=Common.names.findRadius(t);n=r?Math.round((a[1]-1)*r).toCommaString()+Common.SPC+"km":a[1].toCommaString();break;default:return""}return n},orbit:function(e,t){var n,a,r="",o=null;for(o=e.split("x"),o.length>1&&-1==o[0].search(/[a-z]/i)&&-1!=o[1].search(/[a-z]/i)&&null!==(a=o[1].match(/(km|au)/))&&(o[0]+=a[1]),n=0;n<o.length;n++)""!==r&&(r+=Common.TSPC+"×"+Common.TSPC),r+=this.distance(o[n],t);return a=r.match(/(km|au)/gi),null!==a&&a.length>1&&(r=r.replace(/^(\-?\d+)\s?km|\s?au/i,"$1")),r},elements:function(e,t){var n,a,r,o,i,s,l;if(e.a)return t&&"aei"==t?(r=this.distance(e.a),e.e&&""!==e.e&&(r+=Common.TSPC+"×"+Common.TSPC+e.e),e.i&&""!==e.i&&(r+=Common.TSPC+"×"+Common.TSPC+this.distance(e.i+"i")),r):e.e?null===(l=e.a.match(/([\d\.e]+)\s?(km|au)/))?e.a:(n=this.unit(l[2]),a=-1!=n.search(/km/)?0:3,r=parseFloat(l[1]),o=parseFloat(e.e),i=Round(r*(1-o),a),s=Round(r*(1+o),a),i.toCommaString()+Common.TSPC+"×"+Common.TSPC+s.toCommaString()+n+Common.TSPC+"×"+Common.TSPC+this.distance(e.i+"i")):e.a},diameter:function(e){var t=null;if(e||""!==e)return-1!=e.search(/\//)?(t=e.split("/"),t[0].toCommaString().replace(/(km)/,Common.SPC+"$1/")+t[1]):-1!=e.search(/x/)?e.replace(/x/g,Common.TSPC+"×"+Common.TSPC).replace(/(km)/,Common.SPC+"$1"):e.toCommaString().replace(/(km)/,Common.SPC+"$1")},rad:function(e){var t,n=0,a=null;if(e||""!==e){if(-1!=e.search(/x/)){for(a=e.split("x"),t=0;t<a.length;t++)n+=parseFloat(a[t])/2;n/=a.length}else if(-1!=e.search(/\.\./)){for(a=e.split(".."),t=0;t<a.length;t++)n+=parseFloat(a[t])/2;n/=a.length}else-1!=e.search(/\//)?(a=e.split("/"),n=parseFloat(a[0])/2,n+=n*parseFloat(a[1])/4):n=parseFloat(e)/2;return n}},range:function(e){var t="",n=null;if(e||""!==e)return n=e.split(".."),t=parseFloat(n[0]).toCommaString(),n.length>1&&(t+="…"+parseFloat(n[1]).toCommaString()),t+"km"},band:function(e){var t,n,a="";if(e||""!==e)return t=e.match(/([a-zA-Z]+)/),null!==t?t[1]:"Hz",n=e.split(".."),a=parseFloat(n[0]).toCommaString(),n.length>1&&(a+="…"+parseFloat(n[1]).toCommaString()),a+"km"},thickness:function(e){var t,n="km",a="",r=null;if(e&&""!==e){for(r=e.split(".."),t=0;t<r.length;t++)t>0&&(a+="…"),parseFloat(r[t])<.1?(a+=Math.round(1e3*parseFloat(r[t])),n="m"):-1!=r[t].search(/[eE]/)?a+=r[t]:a+=parseFloat(r[t]).toCommaString();return a+Common.SPC+n}},thick:function(e){if(!e||""===e)return.001;var t,n=0,a=e.split("..");for(t=0;t<a.length;t++)n+=parseFloat(a[t]);return n/=a.length},rotation:function(e){var t;if(e&&""!==e){switch(e.toLowerCase()){case"s":t=Common.names.find("sync").n;break;case"c":t=Common.names.find("chao").n;break;default:t=Parse.time(e)}return t}},velocity:function(e){var t="",n=null;if(e){
if(null!==(n=e.match(/([\d\.]+)(kms)?/)))switch(n[2]){case"kms":t=n[1]+Common.SPC+"km/s";break;case void 0:break;default:return""}return t}},position:function(e){var t=null;return null!==(t=e.match(/([\d\.]+)([NS])\,([\d\.]+)([EW])/i))?t[1]+"°"+t[2]+", "+t[3]+"°"+t[4]:null!==(t=e.match(/([\d\.]+)([EW])\,([\d\.]+)([NS])/i))?t[3]+"°"+t[4]+", "+t[1]+"°"+t[2]:(t=e.match(/([\d\.]+)([NSEW])/),null!==t?t[1]+"°"+t[2]:void 0)},pos:function(e){var t,n=null,a=null;if(e)return t=e.match(/([\d\.]+)([NS])\,([\d\.]+)([EW])/i),null!==t?(n=parseFloat(t[1]),"S"==t[2]&&(n=-n),a=parseFloat(t[3]),"W"==t[4]&&(a=-a)):null!==(t=e.match(/([\d\.]+)([EW])\,([\d\.]+)([NS])/i))&&(n=parseFloat(t[3]),"S"==t[4]&&(n=-n),a=parseFloat(t[1]),"W"==t[2]&&(a=-a)),null!==n&&null!==a?(a>180&&(a-=360),a<-180&&(a+=360),n+","+a):void 0},date:function(e,t){var n,a,r="",o=null;if(e){if(-1==e.search(/^l/)){o=e.split("..");for(var i=0;i<o.length;i++)i>0&&(r+="…"),r+=o[i]}else if(null!==(o=e.match(/^l\+([\d\.\?]+)(\w+)?/)))if(t)-1!=o[1].search(/\?/)?r="?":(a=t.add(o[1],o[2]),r=a.toISOString().slice(0,7));else{switch(o[2]){case"hr":n="hr";break;case"dy":n="dy";break;case"mo":n="mon";break;case"yr":n="yr";break;default:n=""}r="L+"+o[1]+Common.SPC+n}return r}},dt:function(e,t){var n;if(e){if(t&&-1!==e.search(/^l/i))return n=e.split(/[\+\u202f]/),t.add(n[1],n[2]);if(n=e.split("."),!(n.length<1)&&(n=n[0].split("-"),n[0]=n[0].replace(/\D/g,""),n[0]))return n[1]=n[1]?n[1].replace(/\D/g,""):"1",n[2]=n[2]?n[2].replace(/\D/g,""):"1",new Date(n[0],n[1]-1,n[2])}},comp:function(e){var t,n,a,r,o="";if(e&&""!==e){for(a=e.split("+"),t=0;t<a.length;t++)r=a[t].split(":"),"poro"==r[0]?(r[0]="Porosity",n=";"+Common.SPC):"dust"==r[0]?(r[0]="Dust",n=";"+Common.SPC):"core"==r[0]?(r[0]="Core",n=";"+Common.SPC):n=Common.SPC+"+"+Common.SPC,t>0&&(o+=n),o+=r.length>1?r[0]+":"+Common.SPC+r[1]+"%":r[0];return o}},atm:function(e){var t="";return e.atm&&""!==e.atm&&(t=this.comp(e.atm)),e.atp&&(-1==e.atp.search(/trace/)?t+=" ("+e.atp+Common.SPC+"bar)":t+=" ("+e.atp+")"),t},mag:function(e){var t="";if(e.dip&&""!==e.dip&&(t=e.dip.replace("..","…")+Common.SPC+"Gauss"),e.dipt){var n=e.dipt.split("x");t+="; Dipole:"+n[0]+this.unit("i"),n.length>1&&(t+=Common.SPC+"/"+Common.SPC+n[1]+"km")}return t},mass:function(e,t){var n,a,r;if(e)return a=e,r=e.replace(/[\d\.\-e~<,]/g,""),a=r.length<1&&t?(parseFloat(e)*t).toScience():-1!==e.search(/^\D/)?e.replace(r,""):parseFloat(e).toScience(),-1!=e.search(/\.\./)&&(n=e.split(".."),a+="…"+parseFloat(n[1]).toScience()),""===r&&(r="kg"),a+Common.SPC+r},time:function(e){if(e){var t,n="",a=null;if(null!==(a=e.match(/^([-~e\d\.\?]+)(\w+)?/))){switch(a[2]){case"s":t="s";break;case"mn":case"n":t="min";break;case"hr":case"h":t="h";break;case"dy":case"d":t="d";break;case"mo":case"m":t="mon";break;case"yr":case"y":case"a":t="a";break;default:t=a[2]}n=a[1]+Common.SPC+t}return n}},sumType:function(e){var t,n=0;for(t in e)e.hasOwnProperty(t)&&(n+=e[t]);return n},sumField:function(e,t){var n,a=0;for(n in e)e.hasOwnProperty(n)&&(a+=e[n][t]);return a}},parseObject=function(e){var t,n,a,r={},o={};a=e,o.acr=e;for(t in objects[a])objects[a].hasOwnProperty(t)&&(o[t]=objects[a][t]);if(n=o.type,r.mass=Common.names.findMass(o.par),o.img&&""!==o.img?o.img=Common.symbols[a]:o.img=null,"m"==n&&o.desig&&""!==o.desig?o.fname=o.desig+" "+o.name:"r"==n?(o.name&&-1==o.name.search(/Division|Arc|Gap/)&&(o.name+=" Ring"),o.other&&""!==o.other?o.fname=o.name+" ("+o.other+")":o.fname=o.name):"c"==n?o.desig&&""!==o.desig?o.fname=o.desig+"/"+o.name:o.fname=o.name:("a"==n||"d"==n||"t"==n)&&o.desig&&""!==o.desig?o.fname="("+o.desig+") "+o.name:o.fname=o.name,o.dia&&""!==o.dia?(o.diam=Parse.diameter(o.dia),o.eqrad=parseFloat(o.dia)/2,o.rad=Parse.rad(o.dia)):o.diam="-","r"==n&&(o.w=o.diam?o.diam:"-",o.rad||(o.rad=1),o.thick&&""!==o.thick&&(o.h=Parse.thickness(o.thick),o.th=Parse.thick(o.thick)),o.th||(o.th=.001),o.h||(o.h="-"),o.rad?o.peri=Math.round(parseFloat(o.a)-o.rad):o.peri=parseFloat(o.a),o.dist=Parse.distance(o.peri+"km"),o.len&&""!==o.len&&(o.len=Parse.distance(o.len+"i")),o.opt&&""!==o.opt&&(o.opt=o.opt.replace("..","…"))),-1!=n.search(/^(d|a|c|t)$/)&&(function(){var e,t;if(o.gr&&""!==o.gr){for(t=o.gr.split(/[\;\:]/),e=0;e<t.length;e++)t[e]=Common.names.find(t[e]).n;o.group=t.join(", ")}}(),function(){var e;o.peri&&""!==o.peri&&(e=o.peri.split(":"),o.peri=e[1],o.peri+=" ("+Parse.distance(e[0])+")")}()),-1!=n.search(/^(b)$/)&&function(){var e,t,n;if(o.cen&&""!==o.cen){for(t=o.cen.split(/\;/),e=0;e<t.length;e++)n=t[e].split(/\:/),t[e]=n[0]+": "+n[1];o.census=t.join(", ")}}(),"p"==n||"d"==n){o.nmoons=0,o.nrings=0;for(t in objects)objects[t].par==a&&("m"==objects[t].type&&o.nmoons++,"r"==objects[t].type&&o.nrings++)}return o.orbit=Parse.elements(o,"aei"),o.tilt&&(o.tilt+=Parse.unit("i")),o.per=Parse.time(o.per),o.rot=Parse.rotation(o.rot),o.dens&&""!==o.dens&&(o.dens+=Common.SPC+"g/cm^3"),o.grav&&""!==o.grav&&(o.grav+=Common.SPC+"g"),o.irad&&""!==o.irad&&(o.irad+=Common.SPC+"W/m^3"),o.sdens&&""!==o.sdens&&(o.sdens+=Common.SPC+"g/cm^2"),o.temp&&""!==o.temp&&(o.temp=o.temp.replace(/K/g,Common.SPC+"K")),o.comp=Parse.comp(o.comp),o.spec&&""!==o.spec&&(o.comp+=" ("+o.spec+"-Type)"),o.atm=Parse.atm(o),o.mag=Parse.mag(o),o.mass=Parse.mass(o.mass,r.mass),o.disc&&""!==o.disc&&""!==o.dyr&&(o.disc=o.disc+", "+o.dyr),function(){var e,t,n,a=[];if(o.url&&""!==o.url){for(t=o.url.split(/\;/),e=0;e<t.length;e++)n=t[e].split(/\:/),a.push(Read.url(n));o.url=a}}(),function(){var e,t,n;for(e=o.desc.split(";"),n=0;n<e.length;n++)switch(t=e[n].split(":"),t[0]){case"url":t.length>1&&(o.hp="http://"+t[1]);break;case"sc":o.scale=parseFloat(t[1]);break;case"scmoons":o.scmoons=parseFloat(t[1]);break;case"orb":o.orb=t[1];break;case"moon":o.moons=t[1];break;case"opa":o.opa=parseFloat(t[1]);break;case"rsize":o.rsize=t[1].split(",");break;case"x":o.x=parseInt(t[1]);break;case"y":o.y=parseInt(t[1])}if(o.scale||(o.scale=1),o.moons){for(e=o.moons.split(","),n=0;n<e.length;n++)e[n]=Common.names.find(e[n]).n;o.moons=e.join(", ")}else o.moons=""}(),o},Hist=new function(){var e,t,n,a,r,o,i,s,l,c=[],m=[],h=[],d=[],u=0,f=0,p={},g={},C={},S={},y=0,v=0,w=function(){var e,n,o;f=UI.Height(SSEH.EXTRA),t.style.height=px(f),u=UI.Width(),t.style.width=px(u),document.getElementById("canvas-wrap").style.height=px(f);try{o=document.getElementsByClassName("loadImg"),o&&(o[0].style.display="none"),o=document.getElementById("imgCC"),o&&(o.style.display="none")}catch(e){}r.setwidth(u),r.setheight(f),r.fillrect(0,0,u,f,SSEH.BGCOL),n=0;for(e in g)g.hasOwnProperty(e)&&(n=g[e].drawImage(r,n,u),n=b(e,n));return x(n),a&&a.draw(r),n},b=function(e,t){var n;for(n in p)p.hasOwnProperty(n)&&(p[n].hasDest(e)&&(t=p[n].drawTimeline(r,t,u-10,e)),g[e].record(p[n]));return t},x=function(e){var t,n,a=u/2,o=e+120,i=["pioneer10","pioneer11","voyager1","voyager2"];for(n=r.makeradialgradient(a,0,o,a,0,o+120,[{pos:0,col:"rgba(255,255,0,0)"},{pos:.01,col:"rgba(255,255,0,0.36)"},{pos:.1,col:"rgba(255,255,0,0.25)"},{pos:.3,col:"rgba(255,255,0,0.15)"},{pos:1,col:"rgba(255,255,0,0)"}]),r.fillcircle(a,0,o+120,n),t=0;t<i.length;t++)p[i[t]].drawEscape(r,o,a)},E=function(){var e,t=Create.div(n,"histTitle","histTtl",{t:f-20});e=new Image,e.src=Common.symbols.cc.src,Create.text(t,SSEH.TITLE+" "+SSEH.VERSION+" "),t.appendChild(e),Create.text(t," "+SSEH.DATE+SSEH.AUTHOR)},I=function(){var e,a="bold 32px sans-serif",o="bold 16px sans-serif",s=(r.textwidth("Loading",o),window.innerHeight),l=Math.PI/i*1.3;0===v?(u=window.innerWidth,r.setwidth(u),r.setheight(s),r.textwidth(SSEH.TITLE,a),t.style.height=px(s),t.style.cursor="progress",e=Create.img(n,{i:SSEH.PATH+"lo.png"},"loadImg"),e.style.top=px(s-u/2.84),r.text(SSEH.TITLE,u/2,140,a,"center","#fff","bottom"),r.text(SSEH.CLICK,u/2,155,o,"center","#fff","top"),r.text("Loading",u/2,220,o,"center","#000","middle"),r.text("Version "+SSEH.VERSION,u-270,s-2,o,"right","#fff","bottom"),Create.img(n,{i:SSEH.ICONS+"cc.png",x:u-258,y:s-18},"cImg","imgCC"),r.text(SSEH.DATE+SSEH.AUTHOR,u-170,s-2,o,"left","#fff","bottom")):(P(u/2+1,220),r.save(),r.scale(1,.333),r.arc(u/2,660,50,60*-l,l*v,!1,"rgba(204,153,102,0.5)",1),r.restore()),(0===i||v<i)&&v++},P=function(e,t){var n=2*Math.abs((v+y)/(i+s)-.51)+.01,a=Math.abs((v+y)/(i+s))<.5;r.save(),r.setparam("globalCompositeOperation","destination-over"),r.startp(e,t-33,"#fff",1),r.arcp(e,t,33,-Math.PI/2,Math.PI/2,!0),r.scale(n,1),r.arcp(e/n,t,33,Math.PI/2,-Math.PI/2,!a),r.endp(null,null,!0),r.restore()},H=function(){var e,t,n={};e=0;for(t in SSEH.images)SSEH.images.hasOwnProperty(t)&&(n[t]=new Image,n[t].src=SSEH.images[t],-1==SSEH.images[t].search(/\.cur/)&&(n[t].onload=Hist.Count,e++));for(t in objects)objects.hasOwnProperty(t)&&(objects[t].img&&""!==objects[t].img&&(n[t]=new Image,n[t].src=SSEH.PLANETS+objects[t].img,objects[t].ind&&(n[t].onload=Hist.Count,e++)),objects[t].imgo&&""!==objects[t].imgo&&(n[t+"orig"]=new Image,n[t+"orig"].src=SSEH.PLANETS+objects[t].imgo),objects[t].rings&&""!==objects[t].rings&&(n[t+"rings"]=new Image,n[t+"rings"].src=SSEH.PLANETS+objects[t].rings,n[t+"rings"].onload=Hist.Count,e++));return s=e,n},k=function(){var e,t,n,a={};for(e in SSEH.icons)SSEH.icons.hasOwnProperty(e)&&null!==(t=SSEH.icons[e].desc.match(/x\:(\d+);y\:(\d+)/))&&(a[e]={n:SSEH.icons[e].name,x:t[1],y:t[2]});for(e in Common.ctry)Common.ctry.hasOwnProperty(e)&&null!==(t=Common.ctry[e].desc.match(/x\:(\d+);y\:(\d+)/))&&(a[e]={n:Common.ctry[e].name,x:t[1],y:t[2]});for(e in Common.desc)Common.desc[e].hasOwnProperty("desc")&&null!==(t=Common.desc[e].desc.match(/x\:(\d+);y\:(\d+)/))&&(n=Common.desc[e].name.split(":"),n=n.length>1?n[1]+" ("+n[0]+")":n[0],a[e]={n:n,x:t[1],y:t[2]});for(e in Common.loc)Common.loc[e].hasOwnProperty("desc")&&null!==(t=Common.loc[e].desc.match(/x\:(\d+);y\:(\d+)/))&&(n=Common.loc[e].name.split(":"),n=n.length>1?n[1]+" ("+n[0]+")":n[0],a[e]={n:n,x:t[1],y:t[2]});return a},T=function(e,t){return e.d<=t.d?-1:1};this.list=function(){},this.load=function(){var t;f=0,i=0,UI.boxwidth=SSEH.BOXWIDTH,UI.scale=SSEH.SCALE,UI.bevel=SSEH.BEVEL,UI.left=SSEH.STARTDATE.valueOf(),UI.right=SSEH.ENDDATE.valueOf(),SSEH.lc="",I();for(t in missions)missions.hasOwnProperty(t)&&(m.push({n:t,d:missions[t].events[0].dt}),i++);m.sort(T);for(t in objects)objects[t].ind&&-1!=objects[t].ind.search(/^\d+$/)&&(c.push({n:t,d:parseInt(objects[t].ind)}),i++);c.sort(T);for(t in Common.lv)Common.lv.hasOwnProperty(t)&&(Common.lv[t].hasOwnProperty("syn")||h.push(t));for(t in Common.lc)Common.lc.hasOwnProperty(t)&&d.push(t);e=0,setTimeout(Hist.loadPlanet,SSEH.INTERVAL)},this.loadPlanet=function(){for(var t;e<c.length;)try{I(),t=c[e].n,g[t]=new Destination(t,"canvas-wrap"),UI.Height(g[t].Height())}catch(e){e instanceof Error&&logError("Error loading "+t,e)}finally{if(++e%4==0)return void setTimeout(Hist.loadPlanet,SSEH.INTERVAL)}e=0,setTimeout(Hist.loadMission,SSEH.INTERVAL)},this.loadMission=function(){for(var t;e<m.length;)try{I(),t=m[e].n,p[t]=new Mission(t,"canvas-wrap"),UI.Height(p[t].Height())}catch(e){e instanceof Error&&logError("Error loading "+t,e)}finally{if(++e%4==0)return void setTimeout(Hist.loadMission,SSEH.INTERVAL)}e=0,o=0,setTimeout(Hist.loadWait,SSEH.INTERVAL)},this.loadWait=function(){s==y||o>1e3?setTimeout(Hist.loadFinish,SSEH.INTERVAL):(o++,I(),setTimeout(Hist.loadWait,SSEH.INTERVAL))},this.loadFinish=function(){w(),E(),a=new Info(n),a.draw(r),document.getElementById("canvas").onclick=UI.vanish,window.onresize=function(){UI.vanish(),w()},e=0,l=Create.div(n,"waitMsg","waitmsg"),Create.text(l,"Please wait..."),setTimeout(Hist.loadDBox,SSEH.INTERVAL)},this.loadDBox=function(){for(var t;e<c.length;)try{t=c[e].n,g[t].createBox()}catch(e){e instanceof Error&&logError("Error loading "+t,e)}finally{if(++e%4==0)return void setTimeout(Hist.loadDBox,SSEH.INTERVAL)}e=0,setTimeout(Hist.loadMBox,SSEH.INTERVAL)},this.loadMBox=function(){for(var t;e<m.length;)try{t=m[e].n,p[t].createBox()}catch(e){e instanceof Error&&logError("Error loading "+t,e)}finally{if(++e%4==0)return void setTimeout(Hist.loadMBox,SSEH.INTERVAL)}e=0,setTimeout(Hist.loadLVBox,SSEH.INTERVAL)},this.loadLVBox=function(){for(var t;e<h.length;)try{t=h[e],C[t]=new LV(t)}catch(e){e instanceof Error&&logError("Error loading "+t,e)}finally{if(++e%4==0)return void setTimeout(Hist.loadLVBox,SSEH.INTERVAL)}e=0,setTimeout(Hist.loadLCBox,SSEH.INTERVAL)},this.loadLCBox=function(){for(var n;e<d.length;)try{n=d[e],S[n]=new LC(n)}catch(e){e instanceof Error&&logError("Error loading "+n,e)}finally{if(++e%4==0)return void setTimeout(Hist.loadLCBox,SSEH.INTERVAL)}e=0,setTimeout(a.createLVlog(),SSEH.INTERVAL),t.style.cursor="default"},this.init=function(){return u=UI.Width(),Common.symbols=H(),Common.sprites=k(),Common.names=new Names("SSEH"),Common.SPC=SSEH.SPC,Common.TSPC=SSEH.TSPC,SSEH.PARENT&&(n=document.getElementById(SSEH.PARENT)),n||(n=document.getElementsByTagName("body")[0]),t=Create.div(n,"","canvas-wrap",{w:u,h:0}),r=new Cdraw("canvas",{parent:"canvas-wrap",width:u,height:window.innerHeight}),{p:n,c:r.setheight,w:u}},this.Canvas=function(){return r},this.Parent=function(){return n},this.Probes=function(){return p},this.LVs=function(){return C},this.Bodies=function(){return g},this.Count=function(){y++},this.Symbols=function(){return H()},this.Sprites=function(){return k()}};Panel.sc={jup:{sc1:4.74,sc2:3.05,i:360},sat:{sc1:4.67,sc2:3.2,i:360},ura:{sc1:4.3,sc2:3.6,i:400},nep:{sc1:4.29,sc2:3.9,i:440}},Panel.fb={jup:{"Pioneer 10":{t:"fbm",d:2.82,i:13.8,y:-16},"Pioneer 11":{t:"fbm",d:1.6,i:51.8,y:6},"Voyager 1":{t:"fbm",d:4.89,i:3.98,y:-30},"Voyager 2":{t:"fbm",d:10.1,i:6.91,y:0},"Galileo JOI":{t:"om",d:"286000km",i:.036,y:-38},"Galileo Probe Entry":{t:"pm",d:"70000km",i:.036,y:-2},Ulysses:{t:"fbm",d:6.3,i:154.6,y:4},Cassini:{t:"fbm",d:"9794404km",i:0},"New Horizons":{t:"fbm",d:"2216252km",i:0},"Juno JOI":{t:"om",d:1.06,i:3,y:-48}},sat:{"Pioneer 11":{t:"fbm",d:1.34,i:10,y:0},"Voyager 1":{t:"fbm",d:3,i:65,y:32},"Voyager 2":{t:"fbm",d:"161081km",i:6.9,y:6},"Cassini SOI":{t:"om",d:"80000km",i:36.8,y:-0},"Huygens EDL":{t:"slm",d:21.5,i:0,y:-4}},ura:{"Voyager 2":{t:"fbm",d:"107092km",i:11.23}},nep:{"Voyager 2":{t:"fbm",d:"29216km",i:116,y:0}},sol:{"Pioneer 10":{t:"etm",d:112,i:3,y:0,dt:0,d0:0,dx:0,i0:0,di:0},"Pioneer 11":{t:"etm",d:90.2,i:14,y:0,dt:0,d0:0,dx:0,i0:0,di:0},"Voyager 1":{t:"etm",d:130,i:35,y:28},"Voyager 2":{t:"etm",d:106.5,i:-30,y:0}}},SSEH.showInfo=function(){var e,t,n,a=this.id.replace(/tab/,"pan");if(n=document.getElementById(a))for(t=n.parentNode.childNodes,e=0;e<t.length;e++)"infoPane"==t[e].className?t[e].id==a?t[e].style.display="block":t[e].style.display="none":-1!=t[e].className.search(/infoTab/)&&(t[e].id==this.id?t[e].className="infoTabA":t[e].className="infoTab")},SSEH.showLV=function(e,t){var n,a,r,o,i=e||window.event,s=t||this;if(a=s.offsetTop+s.parentNode.parentNode.offsetTop+s.offsetHeight+4,r=s.parentNode.parentNode.offsetLeft+s.parentNode.offsetLeft+4,null!==(n=s.id.match(/^lnk(.+)/))){if(!Common.lv.hasOwnProperty(n[1]))return;o=document.getElementById("lv"+n[1])}return o||UI.cancelled()?UI.wait(!1):(UI.wait(!0,a,r),window.setTimeout(function(){SSEH.showLV(i,s)},500)),!!o&&(1==o.style.opacity?(o.style.opacity=0,setTimeout(UI.shift,1e3)):(UI.vanish(!1),o.style.left=px(r),o.style.top=px(a),o.style.opacity=1,UI.Scroll.set(o)),i.stopPropagation(),!1)},SSEH.showLC=function(e,t){var n,a,r,o,i=e||window.event,s=t||this;if(a=s.offsetTop+s.parentNode.parentNode.parentNode.offsetTop+s.offsetHeight+4,r=s.parentNode.parentNode.offsetLeft+s.parentNode.offsetLeft+4,null!==(n=s.id.match(/^lnk(.+)/))){if(!Common.lc.hasOwnProperty(n[1]))return;o=document.getElementById("lc"+n[1])}return o||UI.cancelled()?UI.wait(!1):(UI.wait(!0,a,r),window.setTimeout(function(){SSEH.showLC(i,s)},500)),!!o&&(1==o.style.opacity?(o.style.opacity=0,setTimeout(UI.shift,1e3)):(UI.vanish(!1),o.style.left=px(r),o.style.top=px(a),o.style.opacity=1,UI.Scroll.set(o)),i.stopPropagation(),!1)};var parseElements=function(e,t,n){var a,r,o,i,s={},l=["a","e","i","w","M","L","W","N"],c=function(e,t){for(var n=t>1?e*e:-e*e,a=t*n*e/6,r=(1-t)*e-a,o=4;Math.abs(a)>1e-15;)a*=n/(o*(o+1)),r-=a,o+=2;return r},m=function(e){var t,n,a,r,o=e.e,i=e.M,s=1e-8,l=0,m=1.9,h=!1,d=0;if(!i)return 0;if(o<1&&((i<-Math.PI||i>Math.PI)&&(r=Trig.normalize0(i),l=i-r,i=r),o<.9)){t=Math.atan2(Math.sin(i),Math.cos(i)-o);do{n=(t-o*Math.sin(t)-i)/(1-o*Math.cos(t)),t-=n}while(Math.abs(n)>s);return t}if(i<0&&(i=-i,h=!0),t=i,s*=Math.abs(1-o),s<1e-15&&(s=1e-15),(o>.8&&i<Math.PI/3||o>1)&&(a=i/Math.abs(1-o),a*a>6*Math.abs(1-o)&&(a=i<Math.PI?Math.pow(6*i,1/3):Trig.asinh(i/o)),t=a),o>1&&i>4&&(t=Math.log(i)),o<1)for(;Math.abs(m)>s;)n=d++>8?c(t,o)-i:t-o*Math.sin(t)-i,m=-n/(1-o*Math.cos(t)),t+=m;else for(;Math.abs(m)>s;)n=d++>7?-c(t,o)-i:o*Trig.sinh(t)-t-i,m=-n/(o*Trig.cosh(t)-1),t+=m;return h?l-t:l+t},h=function(e){var t,n,a=e.getUTCFullYear(),r=e.getUTCMonth()+1,o=e.getUTCDate(),i=e.frac(),s=0,l=[31,28,31,30,31,30,31,31,30,31,30,31];return a<-4799?-1:r<1||r>12?-2:(2!=r||a%4!=0||a%100==0&&a%400!=0||(s=1),(o<1||o>l[r-1]+s)&&-3,t=(r-14)/12,n=a+t,1461*(n+4800)/4+367*(r-2-12*t)/12-(n+4900)/100*3/4+o-2432076+2400000.5+i)};for(i=n||Math.pow(.01720209895,2),t&&(a=t instanceof Date?t:Parse.dt(t)),a||(a=new Date),s.jd=h(a),a=Parse.dt(e.ep),s.jd0=h(a),s.d=s.jd-s.jd0,s.cy=s.d/36525,r=0;r<l.length;r++)o=l[r],e.hasOwnProperty("d"+o)?s[o]=e[o]+e["d"+o]*s.cy:e.hasOwnProperty(o)&&(s[o]=e[o]),s.hasOwnProperty(o)&&-1==o.search(/a|e/)&&(s[o]*=Math.PI/180);return function(e){e.hasOwnProperty("w")||e.hasOwnProperty("M")||(e.w=e.W-e.N,e.M=e.L-e.W),e.e<1&&(e.M=Trig.normalize0(e.M)),e.P=Math.pow(Math.abs(e.a),1.5),e.T=e.jd0-e.M/Math.PI/2/e.P,1!=e.e?(e.q=e.a*(1-e.e),e.t0=e.a*Math.sqrt(Math.abs(e.a)/i)):(e.w0=3/Math.sqrt(2)/(e.q*Math.sqrt(e.q/i)),e.a=0,e.t0=0),e.am=Math.sqrt(i*e.q*(1+e.e))}(s),function(e){var t,n,a,r,o;1==e.e?(o=e.jd0-e.T,r=e.w0*o*.5,n=Math.pow(r+Math.sqrt(r*r+1),1/3),e.v=2*Math.atan(n-1/n)):(e.E=m(e),e.e>1?(t=e.e-Trig.cosh(e.E),n=Trig.sinh(e.E)):(t=Math.cos(e.E)-e.e,n=Math.sin(e.E)),n*=Math.sqrt(Math.abs(1-e.e*e.e)),e.v=Math.atan2(n,t)),a=e.q*(1+e.e),e.r=a/(1+e.e*Math.cos(e.v))}(s),function(e){var t,n,a,r=e.v+e.w;t=e.r*(Math.cos(e.N)*Math.cos(r)-Math.sin(e.N)*Math.sin(r)*Math.cos(e.i)),n=e.r*(Math.sin(e.N)*Math.cos(r)+Math.cos(e.N)*Math.sin(r)*Math.cos(e.i)),a=e.r*(Math.sin(r)*Math.sin(e.i)),e.x=t,e.y=n,e.z=a}(s),function(e){var t,n;t=Math.atan2(e.y,e.x),n=Math.atan2(e.z,Math.sqrt(e.x*e.x+e.y*e.y)),e.l=Trig.normalize(t),e.b=n}(s),s};