/* / VISUAL SAT-FLARE TRACKER 3D - Online Export / By Simone Corbellini (c) 2011-2013 / All Rights Reserved / / v.2.1.1 - 12 November 2013 */ var SatNorad = 25544;var xvsft_MapW = 640;var xvsft_MapH = 480;var xvsft_MapZ = 2; var vr0002 = null; var vr0003 = 6378.135; var vr0004 = Math.atan(1)*4; var vr0005 = -1; var vr0006 = 0; var vr0007 = 0; var vr0008 = new Array(); var vr0009 = new Object(); var vr0010 = null; var vr0011 = null; var vr0012 = 1;var vr0013 = 0; var vr0014 = 50; var vr0015 = 50; var vr0016="http:/"+"/www.satflare.com/"; var vr0017 = vr0016 + "export/"; var vr0018 = vr0016+"track.php?q="+SatNorad; var vr0019 = null; var vr0020 = 3000; var vr0021 = 10; var vr0022 = 0; var vr0023 = 0; var vr0024 = Math.round((new Date()).getTime() / 1000);var vr0025 = Math.round(1513483660843 / 1000); var vr0026 = vr0025 - vr0024; var vr0027 = new Date(); vr0054(); var vr0028 = null; if (document.getElementById("map_canvas") == null) { document.write("
_
"); vr0028 = setTimeout("vr0029()",1000);document.write(""); } function vr0029() { var vr0030=document.createElement('script'); vr0030.setAttribute("type","text/javascript"); vr0030.setAttribute("src", "http://maps.google.com/maps/api/js?sensor=false&callback=vr0031"); document.getElementsByTagName("head")[0].appendChild(vr0030); } function vr0031() { var latlng = new google.maps.LatLng(0, 0); var myOptions = {zoom: xvsft_MapZ,center: latlng, disableDefaultUI: true, zoomControl: true, mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, position: google.maps.ControlPosition.TOP_LEFT }, mapTypeId: google.maps.MapTypeId.TERRAIN}; if (vr0002 == null) { vr0002 = new google.maps.Map(document.getElementById("map_canvas"), myOptions); google.maps.event.addListener(vr0002, 'click', function() { vr0101(); }); google.maps.event.addListener(vr0002, 'dragstart', function() { vr0102(); }); } else { vr0002.setOptions(myOptions);} vr0038(); vr0043(); vr0049(SatNorad); } function vr0032(controlDiv, map) { controlDiv.style.padding = '5px'; var vr0033 = "Powered By SatFlare.com"; var vr0034 = "Click to go to the tracking program at SatFlare.com"; var vr0035 = document.createElement('DIV'); vr0035.style.color = '#000040'; vr0035.style.borderWidth = '2px'; vr0035.style.cursor = 'pointer'; vr0035.style.textAlign = 'right'; vr0035.title = vr0034; controlDiv.appendChild(vr0035); var vr0036 = document.createElement('DIV'); vr0036.style.fontFamily = 'Arial,sans-serif'; vr0036.style.backgroundColor = 'white'; vr0036.style.opacity ='0.75'; vr0036.style.fontSize = '10px'; vr0036.style.paddingLeft = '4px'; vr0036.style.paddingRight = '4px'; vr0036.innerHTML = ""+ vr0033 +"";vr0035.appendChild(vr0036); } function vr0038() { var vr0039 = document.createElement('DIV'); var vr0040 = new vr0032(vr0039, vr0002); vr0039.index = 1; vr0002.controls[google.maps.ControlPosition.TOP_RIGHT].push(vr0039); } function vr0041(controlDiv, map) { controlDiv.style.padding = '5px'; var vr0035 = document.createElement('DIV');vr0035.style.color = '#000040'; vr0035.style.borderWidth = '2px'; vr0035.style.cursor = 'pointer'; vr0035.style.textAlign = 'right'; controlDiv.appendChild(vr0035); var vr0037 = document.createElement('IMG'); vr0037.src = "/export/PointerAdvuTema.jpg"; vr0037.style = "opacity:0.80;"; vr0035.appendChild(vr0037); google.maps.event.addDomListener(vr0037, 'click', function() { window.location = 'https:/'+'/play.google.com/store/apps/details?id=com.satflare.isspointer3dpro'; }); } function vr0042() { var vr0039 = document.createElement('DIV'); var vr0040 = new vr0041(vr0039, vr0002); vr0039.index = 0; vr0002.controls[google.maps.ControlPosition.TOP_RIGHT].push(vr0039); } function vr0043() { var vr0044 = document.createElement('DIV'); var vr0045 = new vr0046(vr0044, vr0002); vr0044.index = 1; vr0002.controls[google.maps.ControlPosition.TOP_RIGHT].push(vr0044); } function vr0046(scontrolDiv, map) { scontrolDiv.style.padding = '5px'; var vr0033 = ""; var vr0047 = document.createElement('DIV'); vr0047.style.color = '#000040'; vr0047.style.borderWidth = '2px'; vr0047.style.cursor = 'pointer'; vr0047.style.textAlign = 'right';vr0047.title = ""; scontrolDiv.appendChild(vr0047); var vr0048 = document.createElement('DIV'); vr0048.id = "xvstOID"; vr0048.style.fontFamily = 'Arial,sans-serif'; vr0048.style.backgroundColor = 'white'; vr0048.style.opacity ='0.75'; vr0048.style.fontSize = '10px'; vr0048.style.paddingLeft = '4px';vr0048.style.paddingRight = '4px'; vr0048.innerHTML = ""+ vr0033 +""; vr0047.appendChild(vr0048); } function vr0049(nor) { var vr0030=document.createElement('script'); vr0030.setAttribute("type","text/javascript"); vr0030.setAttribute("src", vr0016 + "export/xqvsft.asp?q="+nor);document.getElementsByTagName("head")[0].appendChild(vr0030); } function RemoteTLELoaded(vr0129) { var vr0050,l2,l3; var h = 0; if (vr0129 == 0) { return; } var vr0051 = vr0005; for(h=0; h < fetchlines; h=h+3) { vr0050 = fetch[h]; l2 = fetch[h+1]; l3 = fetch[h+2]; if (l2.substring(0,1) != "1") break; if (l3.substring(0,1) != "2") break; vr0056(vr0050,l2,l3); } if (vr0051 >= 0) { vr0006 = 1; SatelliteClick(vr0008.length - 1); } else { if (vr0008.length >=0) vr0005 = 0; vr0006 = 1; vr0007 = 1; vr0055(); vr0052(); } } function vr0052() { vr0019 = setTimeout("vr0053()",vr0020); } function vr0053() { vr0019 = setTimeout("vr0053()",vr0020);vr0006 = 1; vr0007 = 1; vr0055(); } function vr0054() { var T = new Date(); vr0027.setTime(T.getTime() + vr0026*1000); } function vr0055() { vr0054(); if (vr0008.length > 0) { if (vr0006 != 0) vr0062(); if (vr0007 != 0) vr0063(); } if (vr0022 == 0) vr0121(); vr0022 = vr0022 + 1; if (vr0022 > vr0021) vr0022 = 0; } function vr0056(line0i,line1,line2) { var x; var y; var vr0057 = -1; var vr0058 = new TLE(); var vr0059 = vr0058.decode(line1,line2); var sgp4 = new SGP4(vr0059); var vr0060 = line0i.toUpperCase(); var vr0061 = new Object(); vr0061.SGP4 = sgp4; vr0061.TLE = vr0059; vr0061.Name = vr0060;vr0061.Line1 = line1; vr0061.Line2 = line2; vr0061.Marker = null; vr0061.VCircle = null; vr0061.SCircle = null; vr0061.OrbitPath = null; vr0061.ShadowCircle = new Array(); vr0061.SunLit = 0; vr0061.LastEventTime = new Date(); vr0061.Surfaces = new Array(); vr0061.MinFlareMag = 0; vr0061.StdMag = -1e9; vr0061.SkyPassRise = 0; vr0061.SkyPassSet = 0; vr0061.SkyPassTrack = new Array(); vr0061.SatPicture = 'satellite_32.png'; vr0061.SatPictureWX = 32; vr0061.SatPictureWY = 32; vr0061.SatPictureCX = -1; vr0061.SatPictureCY = -1; vr0061.FirstLitChange = null; vr0061.FirstLitTo = 0; if (vr0061.TLE.catalog_no_2-0 == 25544) { vr0061.SatPicture = 'iss.ico'; vr0061.SatPictureWX = 36; vr0061.SatPictureWY = 51; } vr0008.push(vr0061); } function vr0062() { vr0065(); vr0006 = 0; } function vr0063() { var vr0064; vr0067(); vr0070(); vr0077(vr0005); if (vr0023 == 0) { vr0095(vr0005); vr0023 = 60; } else { vr0023--; } vr0007 = 0; } function vr0065() { var n; var m = vr0008.length; for(n=0; n=0 ) { if (vr0012 != 0) { vr0068 = vr0008[vr0005].SGP4.latitude; vr0069 = vr0008[vr0005].SGP4.longitude; var latlng = new google.maps.LatLng(vr0068, vr0069); vr0002.setCenter(latlng); } } } function vr0070() { var n;var m = vr0008.length; var latlng; var vr0071; var vr0072 = 0; var vr0073; if (!vr0013) { vr0072 = vr0005; m = vr0072+1; } for(n=vr0072; n= 0) { vr0075 = vr0008[n].SatPictureCX; vr0076 = vr0008[n].SatPictureCY; } var vr0074 = { url: vr0017+vr0008[n].SatPicture,size: new google.maps.Size(vr0008[n].SatPictureWX, vr0008[n].SatPictureWY), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(vr0075, vr0076) }; } vr0073 = vr0008[n].Name; vr0071 = new google.maps.Marker({position: latlng, map: vr0002, icon: vr0074, title: vr0073}); s = "google.maps.event.addListener(vr0071, 'click', function() {vr0101()});";eval(s); vr0008[n].Marker = vr0071; } else { vr0008[n].Marker.setPosition(latlng); if (vr0008[n].Marker.getMap() == null) vr0008[n].Marker.setMap(map); } } } function vr0077(nsat) { var d; var a; var h; var i; var vr0078; var vr0079 = new Array(); var n; var vr0068; var vr0069; if (nsat < 0) return; i =0; d = vr0008[nsat].SGP4.latitude; a = vr0008[nsat].SGP4.longitude; h = vr0008[nsat].SGP4.altitude / vr0003; vr0078 = vr0080(d,a,h,i,45); for(n=0; n< vr0078.length; n++) { vr0068 = vr0078[n].latitude; vr0069 = vr0078[n].longitude; vr0079[n] = new google.maps.LatLng(vr0068, vr0069);} if (vr0008[nsat].VCircle == null) { vr0008[nsat].VCircle = new google.maps.Polygon({path: vr0079,strokeColor: "#FFFFFF",strokeOpacity: 0.8,strokeWeight: 1,fillColor: "#0000FF",fillOpacity: 0.1}); vr0008[nsat].VCircle.setMap(vr0002); google.maps.event.addListener(vr0008[nsat].VCircle, 'click', function() {vr0101(); }); } else { vr0008[nsat].VCircle.setPath(vr0079); vr0008[nsat].VCircle.setMap(vr0002); } } function vr0080(d, a, h, i, ns) { var vr0081; var x; var y; var z; var r; var vr0082; var vr0083; var vr0084; var vr0085; var vr0086; var vr0087; var vr0088; var vr0089; var vr0090; var vr0091;var vr0092; var vr0093; var s = ""; var vr0078 = new Array(); d = d / 180 * vr0004; a = a / 180 * vr0004; vr0082 = vr0004/2 - d; vr0089 = Math.cos(vr0082); vr0090 = Math.sin(vr0082); vr0091 = Math.cos(-a); vr0092 = Math.sin(-a); if (h >= 0) { vr0081 = Math.acos(1/(1+h)); z = Math.cos(vr0081);r = Math.sin(vr0081); vr0093 = 0; for (vr0082=0; vr0082 < 2*vr0004; vr0082 += 2*vr0004/ns) { x = Math.sin(vr0082) * r; y = Math.cos(vr0082) * r; vr0084 = y; vr0083 = vr0089 * x + vr0090 * z; vr0085 = vr0089 * z - vr0090 * x; vr0088 = vr0085; vr0086 = vr0083 * vr0091 + vr0084 * vr0092; vr0087 = -vr0083 * vr0092 + vr0084 * vr0091; var vr0094 = new Object(); vr0094.latitude = Math.asin(vr0088) / vr0004 * 180.0; vr0094.longitude = Math.atan2(vr0087,vr0086) / vr0004 * 180.0; vr0078[vr0093] = vr0094; vr0093++; } } return vr0078; } function vr0095(nsat) { var d = new Date(); var vr0096 = new Array();var vr0097; var vr0098; var vr0099 = null; var vr0100; tmp_orbit = vr0008[nsat].SGP4; vr0097 = vr0008[nsat].OrbitPath; vr0116(d); vr0122(vr0005,0); vr0100 = vr0008[nsat].SunLit; for (var n=-vr0014*6; n < vr0015*6; n++) { d.setTime(vr0027.getTime()+n*10000*1); tmp_orbit=vr0008[nsat].SGP4;tmp_orbit.calc(d); tmp_orbit.latlng(); vr0096[n+vr0014*6] = new google.maps.LatLng(tmp_orbit.latitude, tmp_orbit.longitude); vr0116(d); vr0122(nsat,0); if ((vr0100 != vr0008[nsat].SunLit) && (vr0099 == null) && (n >= 0)) { vr0099 = d.getTime(); vr0008[nsat].FirstLitTo = vr0008[nsat].SunLit; } } vr0008[nsat].FirstLitChange = vr0099; vr0098 = "#FF0000"; if (vr0097 == null) { vr0097 = new google.maps.Polyline({path: vr0096, strokeColor: vr0098, strokeOpacity: 1.0, strokeWeight: 1}); vr0097.setMap(vr0002); vr0008[nsat].OrbitPath = vr0097; } else { vr0097.setMap(vr0002);vr0097.setPath(vr0096); vr0097.set("strokeColor",vr0098); } d.setTime(vr0027.getTime()); tmp_orbit=vr0008[nsat].SGP4; tmp_orbit.calc(d); tmp_orbit.latlng(); vr0116(vr0027); vr0122(nsat,0); } function vr0101() { window.location = vr0018; } function vr0102(){ } function vr0103(d) { return (d.getTime()) / (1000*60*60*24) + 2440587.5; } function vr0104(vr0118) { var vr0105; var t; var vr0106; var vr0107; var c; var vr0108; var k; var r; var e; var vr0109 = new Object(); vr0109.Dec = 0; vr0109.Ra = 0; vr0105 = vr0118 - 2451545; vr0107 = 357.529 + 0.98560028 * vr0105;vr0106 = 280.459 + 0.98564736 * vr0105; while (vr0107 > 360) vr0107 = vr0107 - 360; while (vr0107 < 0) vr0107 = vr0107 + 360; vr0106 = vr0106 + 1.915 * Math.sin(vr0107 / 180 * vr0004) + 0.02 * Math.sin(2 * vr0107 / 180 * vr0004); while (vr0106 > 360) vr0106 = vr0106 - 360; while (vr0106 < 0) vr0106 = vr0106 + 360; r = 1.00014 - 0.01671 * Math.cos(vr0107 / 180 * vr0004) - 0.00014 * Math.cos(2 * vr0107 / 180 * vr0004); e = 23.439 - 0.00000036 * vr0105; while (e > 360) e = e - 360; while (e < 0) e = e + 360; Dec = Math.asin(Math.sin(e / 180 * vr0004) * Math.sin(vr0106 / 180 * vr0004));Ra = (Math.atan2(Math.cos(e / 180 * vr0004) * Math.sin(vr0106 / 180 * vr0004), Math.cos(vr0106 / 180 * vr0004))); if (Ra < 0) Ra = Ra + 2 * vr0004; vr0109.Dec = Dec; vr0109.Ra = Ra; return vr0109; } function vr0110(d) { var vr0111; var vr0112; var vr0113; var vr0114; vr0111 = vr0103(d) - 2451545; vr0112 = vr0111 / 36525; vr0113 = -0.0000062 * Math.pow(vr0112,3) + 0.093104 * vr0112 * vr0112 + (876600 * 3600 + 8640184.812866) * vr0112 + 24110.54841;vr0113 = vr0113 / 180 * vr0004 / 240; vr0114 = vr0113 + vr0004; vr0114 = vr0114 - Math.floor(vr0114 / 2 / vr0004) * 2 * vr0004; if (vr0111 < 0) vr0114 = -vr0114; if (vr0114 > 2 * vr0004) vr0114 = vr0114 - 2 * vr0004; return vr0114; } function vr0080(d, a, h, i, ns) { var vr0081; var x; var y; var z; var r;var vr0082; var vr0083; var vr0084; var vr0085; var vr0086; var vr0087; var vr0088; var vr0089; var vr0090; var vr0091; var vr0092; var vr0093; var s = ""; var vr0078 = new Array(); d = d / 180 * vr0004; a = a / 180 * vr0004; vr0082 = vr0004/2 - d; vr0089 = Math.cos(vr0082); vr0090 = Math.sin(vr0082); vr0091 = Math.cos(-a); vr0092 = Math.sin(-a); if (h >= 0) { vr0081 = Math.acos(1/(1+h)); z = Math.cos(vr0081); r = Math.sin(vr0081); vr0093 = 0; for (vr0082=0; vr0082 < 2*vr0004; vr0082 += 2*vr0004/ns) { x = Math.sin(vr0082) * r; y = Math.cos(vr0082) * r; vr0084 = y; vr0083 = vr0089 * x + vr0090 * z;vr0085 = vr0089 * z - vr0090 * x; vr0088 = vr0085; vr0086 = vr0083 * vr0091 + vr0084 * vr0092; vr0087 = -vr0083 * vr0092 + vr0084 * vr0091; var vr0094 = new Object(); vr0094.latitude = Math.asin(vr0088) / vr0004 * 180.0; vr0094.longitude = Math.atan2(vr0087,vr0086) / vr0004 * 180.0; vr0078[vr0093] = vr0094;vr0093++; } } return vr0078; } function vr0115() { var d; var a; var h; var i; var vr0078; var vr0079 = new Array(); var n; var vr0068; var vr0069; i =0; d = vr0009.Dec / vr0004 * 180; a = vr0009.Lon; h = 149597871 / vr0003; vr0078 = vr0080(d,a,h,i,120); for(n=0; n< vr0078.length; n++) { vr0068 = vr0078[n].latitude; vr0069 = vr0078[n].longitude; vr0079[n] = new google.maps.LatLng(vr0068, vr0069); } if (vr0010 == null) { vr0010 = new google.maps.Polygon({ path: vr0079, strokeColor: "#202020", strokeOpacity: 0.8, strokeWeight: 1, fillOpacity: 0.4}); vr0010.setMap(vr0002); google.maps.event.addListener(vr0010, 'click', function(event) { vr0101(); }); } else { vr0010.setPath(vr0079); google.maps.event.addListener(vr0010, 'click', function(event) { vr0101(); }); } if (vr0009.Dec >= 0) { vr0010.set("fillColor","#FFFFFF"); } else { vr0010.set("fillColor", "#000000"); } return; } function vr0116(d) { var vr0117; var p = 0; var vr0118; vr0118 = vr0103(d); vr0117 = vr0104(vr0118); var vr0119 = vr0110(d); vr0117.Lon = vr0117.Ra - vr0119; vr0009.Dec = vr0117.Dec; vr0009.Ra = vr0117.Ra; vr0009.Lon = vr0117.Lon / vr0004 * 180; vr0009.LonRad = vr0117.Lon; vr0009.PlaneZ = Math.sin(vr0117.Dec); vr0009.PlaneX = Math.cos(vr0117.Dec) * Math.cos(vr0117.Ra); vr0009.PlaneY = Math.cos(vr0117.Dec) * Math.sin(vr0117.Ra); vr0009.ECEFPlaneZ = Math.sin(vr0117.Dec); vr0009.ECEFPlaneX = Math.cos(vr0117.Dec) * Math.cos(vr0117.Lon);vr0009.ECEFPlaneY = Math.cos(vr0117.Dec) * Math.sin(vr0117.Lon); } function vr0120(n) { if (vr0002 != null) { if (n==0) { if (vr0011 != null) { vr0011.setMap(null); vr0011 = null; } } else { if (vr0011 == null) { vr0011 = new google.maps.weather.CloudLayer(); vr0011.setMap(vr0002); } } } } function vr0121() { vr0116(vr0027); vr0115(); } function vr0122(n, EVT){ var vr0123; var vr0124; var vr0125; var k; vr0123 = vr0008[n].SGP4.x; vr0124 = vr0008[n].SGP4.y; vr0125 = vr0008[n].SGP4.z; k = vr0123 * vr0009.PlaneX + vr0124 * vr0009.PlaneY + vr0125 * vr0009.PlaneZ; if (k>=0) { vr0008[n].SunLit = 1; } else { k = Math.sqrt(vr0123*vr0123 + vr0124*vr0124 + vr0125*vr0125 - k*k);if (k > vr0003) { vr0008[n].SunLit = 1; } else { vr0008[n].SunLit = 0; } } } function vr0126(tdif) { var vr0113; var d; var h; var m; var s; var x; var vr0127 = ""; var vr0128 = 0; vr0113 = tdif/1000; var vr0129 = new Object(); vr0129.ages = vr0113; if (vr0113 < 0) vr0113 = -vr0113; x = vr0113;d = Math.floor(x / 60/ 60/ 24); x = x - d * 60 * 60 * 24; h = Math.floor(x / 60 / 60); x = x - h * 60 * 60; m = Math.floor(x / 60); x = Math.floor(x - m * 60); s = x; if (d > 0) { vr0127 += d + " day"; if (d > 1) vr0127 += "s"; vr0128++; vr0127 +=" "; } if (h > 0) { vr0127 += h + " hour"; if (h > 1) vr0127 += "s"; vr0128++; vr0127 +=" "; } if ((m > 0) && (vr0128 < 2)) { vr0127 += m + " min"; vr0128++; vr0127 +=" "; } if ((s > 0) && (vr0128 < 2)) { vr0127 += s + " s"; vr0128++; vr0127 +=" "; } vr0129.s = s; vr0129.m = m; vr0129.h = h; vr0129.d = d; vr0129.vr0127 = vr0127; return vr0129; }