function selectsatellites(e){for(i=0;i-1){document.Position.SelectList.options[i].selected=true}}}function deleteAllCookies(){var e=document.cookie.split(";");for(var t=0;t-1?n.substr(0,r):n;document.cookie=i+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"}}function d_difference222(e,t){if(e>t)return Math.abs(e-t);else return Math.abs(t-e)}function d_difference(e,t){if(e>t)return e-t;else return t-e}function difference(e,t){var n;if(e>=180)e=e-360;if(t>=180)t=t-360;if(e<-180)e=360-e;if(t<-180)t=360-t;if(t>e)n=t-e;if(t<=e)n=-(e-t);if(n>180)n=n-360;if(n<-180)n=180-n;return-1*n}function angulardifference(e,t){var n;if(e>=180)e=e-360;if(t>=180)t=t-360;if(e<-180)e=360-e;if(t<-180)t=360-t;if(t>e)n=t-e;if(t<=e)n=-(e-t);if(n>180)n=n-360;if(n<-180)n=180-n;return n}function halfangle(){var e,t,n,r,i,s,o;alert(111);t=299792458;r=Math.PI;i=99;o=11.7;n=t/(o*1e3*1e3*1e3);s=n+n/4;e=Deg(Math.cos(n/s));alert(e)}function setlocaltimeinhtmlfields(){var e,t,n,r,i,s,o,u;e=new Date;n=e.getMonth()+1;t=e.getDate();r=e.getFullYear();i=e.getHours();s=e.getMinutes();o=e.getSeconds();document.getElementById("YearNow").value=1*r;document.getElementById("Month").value=1*n;document.getElementById("Day").value=1*t;document.getElementById("Hour").value=1*i;document.getElementById("Minute").value=1*s;document.getElementById("Second").value=1*o;document.getElementById("LocalTimeZoneDescription").innerHTML=get_timezone_offset_text()}function onchange_antenna_size(){AntSize=1*document.getElementById("AntSize").value;document.getElementById("AntSizeFeet").value=formatvalue(AntSize*metertofeet,4);document.getElementById("AntSizeInches").value=formatvalue(AntSize*metertoinch,5);SetCookie();load_tables();print_outages()}function onchange_antenna_size_feet(){var e;e=1*document.getElementById("AntSizeFeet").value;AntSize=e*feettometer;document.getElementById("AntSize").value=formatvalue(AntSize,4);document.getElementById("AntSizeInches").value=formatvalue(e*feettoinch,5);SetCookie();load_tables();print_outages()}function onchange_antenna_size_inches(){var e;e=1*document.getElementById("AntSizeInches").value;AntSize=e*inchtometer;document.getElementById("AntSize").value=formatvalue(AntSize,4);document.getElementById("AntSizeFeet").value=formatvalue(e*inctofeet,5);SetCookie();load_tables();print_outages()}function onchange_band(){if(document.getElementById("c-band").checked==true){Frequency=3.95;document.getElementById("NoiseTempLNB").value=15;document.getElementById("NoiseTempLNB_dB").value=.219;document.getElementById("circular").checked=true}else if(document.getElementById("ku-band").checked==true){Frequency=11.95;document.getElementById("linear").checked=true;document.getElementById("NoiseTempLNB").value=58.66;document.getElementById("NoiseTempLNB_dB").value=.8}else if(document.getElementById("user-band").checked==true)Frequency=1*document.getElementById("Frequency").value;document.getElementById("Frequency").value=Frequency;SetCookie();load_tables();print_outages()}function onchange_frequency(){document.getElementById("user-band").checked=true;Frequency=1*document.getElementById("Frequency").value;SetCookie();load_tables();print_outages()}function onchange_year(){Year=1*document.getElementById("Year").value;print_outages()}function onchange_season(){if(document.getElementById("Spring").checked==true)season=0;else season=1;print_outages()}function find_peak_latitude(e){var t,n,r,i,s,o;r="N/A2";o=90;document.getElementById("SunInt_Peak_Latitude").innerHTML="
";for(n=-9e4;n<9e4;n++){t=Deg(-Math.atan2(3964*Math.sin(Radians(n/1e3)),22300+3964*(1-Math.cos(Radians(n/1e3)))));if(3964*(1-Math.cos(Radians(n/1e3))==-22300))r="N/A3";else if(Math.abs(difference(t,e))"}function set_todays_dateandtime(){var e,t,n,r,i,s,o,u;e=new Date;n=e.getUTCMonth()+1;t=e.getUTCDate();r=e.getUTCFullYear();i=e.getUTCHours();s=e.getUTCMinutes();o=e.getUTCSeconds();u=daynumber(t,n,r,i,s,o);return u}function getsunintpeak(){var e}function getPeakLatitude(e){var t,n,r,i,s,o,u,a,f;var l,c,h,p,d;var v,m,g,y;var b=new Array;i=.01;d=.01;p=.01;s="---";c=1;a=e;sunangles=sun_angles(a,60,60);SunDeclination=sunangles[2];outage_beamwidth=calculateantennabeamwidth(1*Frequency,1*AntSize,70);if(SunDeclination<0){if(SunDeclination-outage_beamwidth>-8.6833)g=SunDeclination-outage_beamwidth;if(SunDeclination+outage_beamwidth>-8.6833)y=SunDeclination+outage_beamwidth}else{if(SunDeclination+outage_beamwidth<8.6833)g=SunDeclination+outage_beamwidth;if(SunDeclination-outage_beamwidth<8.6833)y=SunDeclination-outage_beamwidth}if(SunDeclination<0)h=1;else h=-1;document.getElementById("SunInt_Peak_Latitude").innerHTML="---";t=SimpleElevationEquatorCrossing(0,79,0,0);for(o=-8130;o<8130;o++){f=o/100;t=SimpleElevationEquatorCrossing(0,Math.abs(f),0,0);if(SunDeclination>0)r=-CalculateDeclination2(Math.abs(f),180,t);else r=CalculateDeclination2(Math.abs(f),180,t);if(r>0)h=-1;else h=1;if(Math.abs(difference(SunDeclination,r))0){if(SunDeclination<0)s=-f;else s=f;i=Math.abs(difference(r,SunDeclination))}}document.getElementById("SunInt_Peak_Latitude").innerHTML=document.getElementById("SunInt_Peak_Latitude").innerHTML+" InpoutDecl= "+SunDeclination+" Found lat="+s+" Recalc Decl"+u+" SelectedSatLon "+SatLon+" Outage beamwidth "+outage_beamwidth+" Date: "+d_to_date_and_time(a)+"
";b[0]=s;b[1]=c;b[2]=SunDeclination;b[3]=v;b[4]=m;return b}function getCorrectedPeakLatitude(e,t,n,r,i,s,o){var u,a,f,l,c,h,p,d,v;var m,g,y,b,w;var E,S,x,T;var N=new Array;l=.01;w=.01;b=.01;c="---";g=1;d=e;sunangles=sun_angles(d,60,60);SunDeclination=sunangles[2];outage_beamwidth=calculateantennabeamwidth(1*Frequency,1*AntSize,70);if(SunDeclination<0){if(SunDeclination-outage_beamwidth>-8.6833)x=SunDeclination-outage_beamwidth;if(SunDeclination+outage_beamwidth>-8.6833)T=SunDeclination+outage_beamwidth}else{if(SunDeclination+outage_beamwidth<8.6833)x=SunDeclination+outage_beamwidth;if(SunDeclination-outage_beamwidth<8.6833)T=SunDeclination-outage_beamwidth}if(SunDeclination<0)y=1;else y=-1;document.getElementById("SunInt_Peak_Latitude").innerHTML="---";u=SimpleElevationEquatorCrossing(0,79,0,0);for(h=-8130;h<8130;h++){v=h/100;f=GetVariableDeclination(t,v,r,i,s,o);if(f>0)y=-1;else y=1;if(Math.abs(difference(SunDeclination,f))0){if(SunDeclination<0)c=v;else c=v;l=Math.abs(difference(f,SunDeclination))}}document.getElementById("SunInt_Peak_Latitude").innerHTML=document.getElementById("SunInt_Peak_Latitude").innerHTML+" InpoutDecl= "+SunDeclination+" Found lat="+c+" Recalc Decl"+p+" SelectedSatLon "+t+" Outage beamwidth "+outage_beamwidth+" Date: "+d_to_date_and_time(d)+"";N[0]=c;N[1]=g;N[2]=SunDeclination;N[3]=E;N[4]=S;return N}function getPeakMaxMinLatitude(e){var t,n,r,i,s,o,u,a,f;var l,c,h,p,d;var v,m,g,y;var b,p,d,w,E,S;var x=new Array;i=.01;d=.01;p=.01;s="---";c=1;a=e;sunangles=sun_angles(a,60,60);SunDeclination=sunangles[2];if(document.getElementById("id3dBBeamwidth").checked==true&&document.getElementById("idThresholdLinkMargin").checked==false){outage_beamwidth=calculateantennabeamwidth(Frequency,AntSize,70);E=0}else{w=1*document.getElementById("idInputLinkMargin").value;S=1/100*document.getElementById("AntEfficiency").value;E=1*globalarray_indexCN_degrad_output_offaxis[Math.round(w*10)];outage_beamwidth=E;if(outage_beamwidth==null)E=null;if(Math.abs(SunDeclination+outage_beamwidth+.02)<8.6833)g=SunDeclination+outage_beamwidth;if(Math.abs(SunDeclination-outage_beamwidth-.02)<8.6833)y=SunDeclination-outage_beamwidth}if(document.getElementById("id3dBBeamwidth").checked==true&&document.getElementById("idThresholdLinkMargin").checked==false){if(Math.abs(SunDeclination+outage_beamwidth+.27)<8.6833)g=SunDeclination+outage_beamwidth+.25;if(Math.abs(SunDeclination-outage_beamwidth-.27)<8.6833)y=SunDeclination-outage_beamwidth-.25}else p=1;if(SunDeclination<0)h=1;else h=-1;document.getElementById("SunInt_Peak_Latitude").innerHTML="---";t=SimpleElevationEquatorCrossing(0,79,0,0);for(o=-8130;o<8130;o++){f=o/100;t=SimpleElevationEquatorCrossing(0,Math.abs(f),0,0);r=GetVariableDeclination(0,f,0,0,0,42164.14);if(r>0)h=-1;else h=1;if(Math.abs(difference(SunDeclination,r))0){s=f;i=Math.abs(difference(r,SunDeclination))}if(Math.abs(difference(y,r))0){m=f;p=Math.abs(difference(r,y))}if(Math.abs(difference(g,r))0){v=f;d=Math.abs(difference(r,g))}}x[0]=s;x[1]=c;x[2]=SunDeclination;x[3]=v;x[4]=m;return x}function getcorrectdeclination(e,t,n){var r,i,s;i=Elevation2(e,t,n,0,0,42164.57);r=Azimuth2(e,t,n,0,0,42164.57);s=CalculateDeclination2(t,r,i);return s}function test_sat_HA_for_all_Lon(e,t){var n,r,i,s,o,u,a,f;var l;l=1*SatLon;a=SimpleElevationEquatorCrossing(0,e,0,0);f=CalculateDeclination2(e,180,a);for(n=0;n<360;n++){r=n;u=Elevation2(l,e,r,0,0,42164.57);o=Azimuth2(l,e,r,0,0,42164.57);s=CalculateDeclination2(1*e,o,u);s=f;i=CalculateSatHourangle(o,0,f,e)}}function getPeakLongitude(e,t){var n,r,s,o,u,a,f;var l,c;var h=new Array;var p,d,v,m,g,y,b;var w,E;a="---";y="N/A";b="N/A";l=1*SatLon;u=.01;document.getElementById("SunInt_Peak_Longitude").innerHTML="---";var S=new Array;for(i=0;i<36e3;i++){c=i/100;if(c==0)c=1e-6;if(c==90)c=90.000001;if(c==270)c=270.000001;if(c==360)c=359.999999;h=sun_angles(e,c,t);f=h[14];w=h[2];s=Elevation2(l,t,c,0,0,42164.57);r=Azimuth2(l,t,c,0,0,42164.57);o=CalculateDeclination2(1*t,r,s);n=CalculateSatHourangle(r,s,o,t);n=CalculateSatHourangle(r,s,1*w,t);E=difference(w,o);S[1]=t+E;g=0;m=0;if(t<0){if(n>270&&n<90)g=1;if(f>270&&f<90)m=1}else{if(n>90&&n<270)g=1;if(f>90&&f<270)m=1}g=1;m=1;if(Math.abs(difference(n,f))0&&m!=0&&g!=0){a=1*c;if(s<0)a="---";a=1*c;y=f;b=n;u=Math.abs(difference(n,f))}}document.getElementById("SunInt_Peak_Latitude").innerHTML=document.getElementById("SunInt_Peak_Latitude").innerHTML+"
\n SatDecl:"+o;d=t;if(a!="---")p=a;else if(a=="---")p=a;if(a!="---"&&m!=0&&g!=0){var x;if(p>180)x=p-360;else x=p;var T=new google.maps.LatLng(d,x);document.getElementById("SunInt_Peak_Longitude").innerHTML=document.getElementById("SunInt_Peak_Longitude").innerHTML+" LastMinOffset: "+u+" SunHourangle= "+y+" SatDecl="+o+" Found lon="+a+" SiteLat "+t+" SelectedSatLon "+SatLon+" Outage beamwidth "+outage_beamwidth+" Date: "+d_to_date_and_time(e)+"\n found_sun_HA:"+y+" found_sat_HA:"+b+""}test_sat_HA_for_all_Lon(t,y);S[0]=p;return S}function getFastPeakLongitude(e,t){var n,r,s,o,u,a,f;var l,c;var h=new Array;var p,d,v,m,g,y,b;var w,E;a="---";y="N/A";b="N/A";l=1*SatLon;u=1;document.getElementById("SunInt_Peak_Longitude").innerHTML="---";var S=new Array;for(i=0;i<360;i++){c=i;if(c==0)c=1e-6;if(c==90)c=90.000001;if(c==270)c=270.000001;if(c==360)c=359.999999;h=sun_angles(e,c,t);f=h[14];w=h[2];s=Elevation2(l,t,c,0,0,42164.57);r=Azimuth2(l,t,c,0,0,42164.57);o=CalculateDeclination2(1*t,r,s);n=CalculateSatHourangle(r,s,o,t);n=CalculateSatHourangle(r,s,1*w,t);E=difference(w,o);S[1]=t+E;g=0;m=0;if(t<0){if(n>270&&n<90)g=1;if(f>270&&f<90)m=1}else{if(n>90&&n<270)g=1;if(f>90&&f<270)m=1}g=1;m=1;if(Math.abs(difference(n,f))0&&m!=0&&g!=0){a=1*c;if(s<0)a="---";a=1*c;y=f;b=n;u=Math.abs(difference(n,f))}}document.getElementById("SunInt_Peak_Latitude").innerHTML=document.getElementById("SunInt_Peak_Latitude").innerHTML+"
\n SatDecl:"+o;d=t;if(a!="---")p=a;else if(a=="---")p=a;if(a!="---"&&m!=0&&g!=0){var x;if(p>180)x=p-360;else x=p;var T=new google.maps.LatLng(d,x);document.getElementById("SunInt_Peak_Longitude").innerHTML=document.getElementById("SunInt_Peak_Longitude").innerHTML+" LastMinOffset: "+u+" SunHourangle= "+y+" SatDecl="+o+" Found lon="+a+" SiteLat "+t+" SelectedSatLon "+SatLon+" Outage beamwidth "+outage_beamwidth+" Date: "+d_to_date_and_time(e)+"\n found_sun_HA:"+y+" found_sat_HA:"+b+""}test_sat_HA_for_all_Lon(t,y);S[0]=p;return S}function placeMarker(e){var t="C/N reduction peak center is "+globalarray_index_offaxis_output_CN_degrad[Math.abs(Math.round(0*10))]+" dB"}function clearmarkers(){currentselectedinterval=0;clearInterval(autointerval);clearInterval(autointerval2);document.getElementById("10s").style.borderWidth="medium";document.getElementById("10s").style.borderColor="grey";document.getElementById("20s").style.borderWidth="medium";document.getElementById("20s").style.borderColor="grey";document.getElementById("30s").style.borderWidth="medium";document.getElementById("30s").style.borderColor="grey";document.getElementById("60s").style.borderWidth="medium";document.getElementById("60s").style.borderColor="grey";document.getElementById("Simulatebutton").style.borderWidth="medium";document.getElementById("Simulatebutton").style.borderColor="grey"}function draw_footprint(e,t,n,r,i,s){var o,u,a,f,l,c,h,p,d,v,m,g,y,b,w;var E=new Array;f=angulardifference(t,n);a=f;document.getElementById("SunInt_misc").innerHTML="Lon_SB: "+a;u=Deg(Math.acos(Math.cos(Radians(e))*Math.cos(Radians(a))));u=Rev(u);o=Deg(Math.atan2(Math.sin(Radians(u)),6.6235-Math.cos(Radians(u))));if(s!="NA"){o=s*1}l=Deg(Math.acos(Math.cos(Radians(o))*Math.cos(Radians(i))+Math.sin(Radians(o))*Math.sin(Radians(i))*Math.cos(Radians(r))));y=Math.sin(Radians(r));b=Math.sin(Radians(o))*Math.cos(Radians(i))/Math.sin(Radians(i));b=b-Math.cos(Radians(o))*Math.cos(Radians(r));c=Deg(Math.atan2(y,b));h=Deg(Math.atan2(Math.sin(Radians(a)),Math.tan(Radians(e))))+c;p=Deg(Math.asin(6.6235*Math.sin(Radians(l))))-l;d=Deg(Math.asin(Math.sin(Radians(p))*Math.cos(Radians(h))));v=Deg(Math.atan2(Math.tan(Radians(p))*Math.sin(Radians(h)),1));g=n-v;w=d;if(g<0)g=g+360;m=new google.maps.LatLng(w,g);return m}function test_draw_footprint(e,t,n,r,i,s){var o,u,a,f,l,c,h,p,d,v,m,g,y,b,w;var E=new Array;f=angulardifference(t,n);a=f;document.getElementById("SunInt_misc").innerHTML="Lon_SB: "+a;u=Deg(Math.acos(Math.cos(Radians(e))*Math.cos(Radians(a))));u=Rev(u);o=Deg(Math.atan2(Math.sin(Radians(u)),6.6235-Math.cos(Radians(u))));if(s!="NA")o=-s*1;l=Deg(Math.acos(Math.cos(Radians(o))*Math.cos(Radians(i))+Math.sin(Radians(o))*Math.sin(Radians(i))*Math.cos(Radians(r))));y=Math.sin(Radians(r));b=Math.sin(Radians(o))*Math.cos(Radians(i))/Math.sin(Radians(i));b=b-Math.cos(Radians(o))*Math.cos(Radians(r));c=Deg(Math.atan2(y,b));h=Deg(Math.atan2(Math.sin(Radians(a)),Math.tan(Radians(e))))+c;p=Deg(Math.asin(6.6235*Math.sin(Radians(l))))-l;alert(p);d=Deg(Math.asin(Math.sin(Radians(p))*Math.cos(Radians(h))));v=Deg(Math.atan2(Math.tan(Radians(p))*Math.sin(Radians(h)),1));g=n-v;w=d;if(g<0)g=g+360;E[0]=1*a;E[1]=1*u;E[2]=1*o;E[3]=1*l;E[4]=1*c;E[5]=1*h;E[6]=1*d;E[7]=1*g;E[8]=1*w;E[9]=1*t;E[10]=1*e;E[11]=1*n;E[12]=1*r;E[13]=1*i;E[14]=1*p;var S;S="\nSatLon: "+E[11];S+="\nBoresLON:"+E[9];S+="\nBoresLAT:"+E[10];S+="\nLonSB:"+E[0];S+="\nBeta:"+E[1]+" (coverageangle, lat korrigert for flattning?)";S+="\nYb:"+E[2]+" (declination)";S+="\nYn:"+E[3]+" (declination point n, korriger denne for hyere deklinasjon?)";S+="\nB_n:"+E[14]+"(beta point n)";S+="\nFi_n:"+E[4];S+="\nE_n:"+E[5];S+="\nLat_n_point:"+E[6];S+="\nLon n point:"+E[7];S+="\nLat n point:"+E[8];S+="\nW rotation:"+E[12];S+="\nBeamwidth:"+E[13];alert(S);return output_array}function test_footprint(){var e=new Array;var t;e=test_draw_footprint(50,10,0,90,1,"NA");alert(1*e[0]+"test");t="\nSatLon: "+1*e[11];t+="\nBoresLON:"+e[9];t+="\nBoresLAT:"+e[10];t+="\nLonSB:"+e[0];t+="\nBeta:"+e[1];t+="\nYb:"+e[2]+" (declination?)";t+="\nYn:"+e[3];t+="\nFi_n:"+e[4];t+="\nE_n:"+e[5];t+="\nLat_n_point:"+e[6];t+="\nLon n point:"+e[7];t+="\nLat n point:"+e[8];t+="\nW rotation:"+e[12];t+="\nBeamwidth:"+e[13];alert(t)}function PlaceCoveragemarkers(e){var t="http://maps.google.com/mapfiles/marker_whiteA.png";coveragemarkers=new google.maps.Marker({position:e,map:map,icon:t});var n="Coverage Marker
"}function PlaceNan1markers(e){var t="http://maps.google.com/mapfiles/marker_purpleA.png";Nan1markers=new google.maps.Marker({position:e,map:map,icon:t});var n="NaN1 start
"}function PlaceNaN2markers(e){var t="http://maps.google.com/mapfiles/marker_yellowA.png";NaN2markers=new google.maps.Marker({position:e,map:map,icon:t});var n="NaN2 stop
"}function PlaceGlobalNaN1markers(e){var t="http://maps.google.com/mapfiles/dd-start.png";GlobalNaN1markers=new google.maps.Marker({position:e,map:map,icon:t});var n="GobalNaN1 Start
"}function PlaceGlobalNaN2markers(e){var t="http://maps.google.com/mapfiles/dd-end.png";GlobalNaN2markers=new google.maps.Marker({position:e,map:map,icon:t});var n="GobalNaN2 Stop
"}function PlaceSitemarker(e){var t="http://www.birdtheme.org/useful/images/square.png";SiteMarker=new google.maps.Marker({position:e,map:map,icon:t});var n="SiteMarker
"}function draw_satellite_coverage_aera(){var e=[];var t,n,r,i;print_max_north_south_outage();if(SatLon>180)r=SatLon-360;else r=SatLon;if(coverage_polygon1!=null)coverage_polygon1.setMap(null);if(polygon1!=null)polygon1.setMap(null);if(coveragemarkers!=null)coveragemarkers.setMap(null);for(t=0;t<1500;t++){if(marker[t]!=null)marker[t].setMap(null)}if(!document.getElementById("plotall").checked&&!document.getElementById("plotall").checked){for(t=0;t<361;t++){n=t;i=draw_footprint(0,r,r,n,8.683333333333334,"NA");if(!isNaN(i.lng())&&!isNaN(i.lat()))e.push(i)}var s={path:e,strokeColor:"green",strokeOpacity:1,strokeWeight:2,geodesic:false};globalcoveragearray=e;coverage_polygon1=new google.maps.Polyline(s);coverage_polygon1.setMap(map)}}function footprinttestplotter(){var e=new Array;var t,n,r,s,o,u;if(SatLon>180)t=SatLon-360;else t=SatLon;n="";outage_beamwidth=calculateantennabeamwidth(1*Frequency,1*AntSize,70);document.getElementById("SunInt_lonsearch").innerHTML='';var a=new Array;n="
";for(i=0;i<361;i++){s=110;o=55;u=359.2;e=get_skew(o,s,u,i,outage_beamwidth);r=new google.maps.LatLng(e[7],e[9]);if(!isNaN(r.lat())&&!isNaN(r.lng()))a.push(r);n=n+""}document.getElementById("SunInt_lonsearch").innerHTML=n+"
Vridning: "+i+"Lon_SB: "+e[0]+"Beta: "+e[1]+"Yb: "+e[2]+"Yn: "+e[3]+"Fi_n: "+e[4]+"E_n: "+e[5]+"B_n: "+e[6]+"Lat_n_point: "+e[7]+"Lon_n_point_rel_to_sub_point: "+e[8]+"LonReal: "+e[9]+"
";var f={path:a,strokeColor:"blue",strokeOpacity:1,strokeWeight:1,fillColor:"#0000FF",fillOpacity:.2,geodesic:true};polygon1=new google.maps.Polygon(f);polygon1.setMap(map)}function calcTime(e){d=new Date;utc=d.getTime()+d.getTimezoneOffset()*6e4;nd=new Date(utc+36e5*offset);return 1}function print_new_affectedarea(e,t,n){}function print_max_north_south_outage(){var e=[];var t,n,r,i;var s=[];var o=[];var u,a;var f,l,c,h,p,d,v,m;f=set_todays_dateandtime();c=1*document.getElementById("YearNow").value;h=1*document.getElementById("Month").value;p=1*document.getElementById("Day").value;d=1*document.getElementById("Hour").value;v=1*document.getElementById("Minute").value;m=1*document.getElementById("Second").value;l=daynumber(p,h,c,d,v,m);var g=new Date(1*c,1*h-1,1*p,1*d,1*v,1*m,0);l=l+g.getTimezoneOffset()/(60*24);f=l;u=80.88;e=getPeakMaxMinLatitude(f);document.getElementById("showtimecalculated").innerHTML=d_to_date_and_time(f);r=e[0];n=1*e[3];t=1*e[4];if(polygon_max_min_lat_for_outage!=null)polygon_max_min_lat_for_outage.setMap(null);if(polyline_peaklat!=null)polyline_peaklat.setMap(null);if(polygon_max_min_lat_for_outage!=null)google.maps.event.clearListeners(polygon_max_min_lat_for_outage,"click");if(!isNaN(n)&&!isNaN(t)){o[0]=new google.maps.LatLng(n,-180);o[1]=new google.maps.LatLng(n,0);o[2]=new google.maps.LatLng(n,180);o[3]=new google.maps.LatLng(t,180);o[4]=new google.maps.LatLng(t,0);o[5]=new google.maps.LatLng(t,-180);var y={path:o,strokeColor:"orange",strokeOpacity:0,strokeWeight:1,fillColor:"orange",fillOpacity:.1};polygon_max_min_lat_for_outage=new google.maps.Polygon(y);polygon_max_min_lat_for_outage.setMap(map);google.maps.event.addListener(polygon_max_min_lat_for_outage,"click",calculatesunintdate)}else if(!isNaN(n)&&isNaN(t)){o[0]=new google.maps.LatLng(n,-180);o[1]=new google.maps.LatLng(n,0);o[2]=new google.maps.LatLng(n,180);o[3]=new google.maps.LatLng(u,180);o[4]=new google.maps.LatLng(u,0);o[5]=new google.maps.LatLng(u,-180);var y={path:o,strokeColor:"orange",strokeOpacity:0,strokeWeight:1,fillColor:"orange",fillOpacity:.1};polygon_max_min_lat_for_outage=new google.maps.Polygon(y);polygon_max_min_lat_for_outage.setMap(map);google.maps.event.addListener(polygon_max_min_lat_for_outage,"click",calculatesunintdate)}else if(isNaN(n)&&!isNaN(t)){o[0]=new google.maps.LatLng(-u,-180);o[1]=new google.maps.LatLng(-u,0);o[2]=new google.maps.LatLng(-u,180);o[3]=new google.maps.LatLng(t,180);o[4]=new google.maps.LatLng(t,0);o[5]=new google.maps.LatLng(t,-180);var y={path:o,strokeColor:"orange",strokeOpacity:0,strokeWeight:1,fillColor:"orange",fillOpacity:.1};polygon_max_min_lat_for_outage=new google.maps.Polygon(y);polygon_max_min_lat_for_outage.setMap(map);google.maps.event.addListener(polygon_max_min_lat_for_outage,"click",calculatesunintdate)}if(!isNaN(r)){var b,w;if(SatLon>360)b=SatLon-360;else b=SatLon;s[0]=new google.maps.LatLng(1*r,-179.99);s[1]=new google.maps.LatLng(1*r,0);s[2]=new google.maps.LatLng(1*r,180);var E={path:s,strokeColor:"red",strokeOpacity:.5,strokeWeight:1};polyline_peaklat=new google.maps.Polyline(E);polyline_peaklat.setMap(map)}}function test_t_ant(){var e;var t=new Array;t=getCN_degradation(1*Frequency,1*AntSize,0);alert(t[0])}function Get_ITUR_BO1213_AntennaGain(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m,g;s=299792458;o=Math.PI;c=Math.pow(10,34/25);u=s/(n*1e3*1e3*1e3);m=e/u;d=10*log10(t*(o*e/u)*(o*e/u));l=95*(u/e);p=29-25*log10(l);f=u/e*Math.sqrt((d-p)/.0025);if(0<=i&&i=11){g=Math.pow(10,1*(v/10));return g}else{return 0}}function calculate_cn_reduction_detailed_approach(e,t,n,r,i,s){var o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x;g=Math.PI;m=.266;l=1e-4;if(r>.266){o=0;u=r-.266;a=r+.266;f=u;while(f=11)return v-d;else{return 99}}function find_offaxis_for_gain_reduction(e,t,n){var r,s,o,u;for(i=0;i<1800;i++){r=i/10;s=ITUR_BO1213_AntennaPattern(1*t,1*n,1*Frequency,54,r);if(s==99)return-1*1;if(sf){u=r*i*(f/a)*(f/a)}else{u=r*i}y=Math.pow(10,g/10);m=10*log10((v+u*y)/v);b[0]=formatnumber(Math.round(m*1e3)/1e3,4);b[1]=Math.floor(v);b[2]=Math.floor(u*y);b[3]=Math.floor(u);b[4]=Math.floor(r*12e4*Math.pow(e,-.75));return b}function getAffectedSatPositions(e,t){var n;n=Math.sqrt((8.69+t)*(8.69+t)-e*e);return n}function getOutageSpanForSelectedSatellite(e,t){}function getOutageSpan(e,t){var n;n=Math.sqrt((8.69+t)*(8.69+t)-e*e);return n}function get_global_start_and_stop_time_for_selected_satellite_date(e,t,n,r,i,s,o,u,a,f){var l=new Array;var c=new Array;var h,p,d,v,m;var g,y,b,w,E,S,x;var T,N,C,k,L,A,O,M;var _,D,P;var H,B,j,F;var I;var q=new Array;I=0;D="";H=.25;F=1*document.getElementById("idInputLinkMargin").value;if(document.getElementById("id3dBBeamwidth").checked==true&&document.getElementById("idThresholdLinkMargin").checked==false){x=calculateantennabeamwidth(s,o,70);_=8.69+x+H;B=0}else{j=1/100*document.getElementById("AntEfficiency").value;B=1*globalarray_indexCN_degrad_output_offaxis[Math.round(F*10)];x=calculatebeamwidth_for_offpeak(B,0,0);_=8.69+x;if(x==null)B=null}S=0;b=180;E=180;h=sun_declination_refraction(1*f,t,n);N=SunAtSatAzimuth(f,280,e,0,E);P=Math.floor(f)+N/24;h=sun_declination_refraction(1*P,t,50);N=SunAtSatAzimuth(P,280,e,0,E);P=Math.floor(f)+N/24;if(Math.abs(h)<_){l=get_global_outage_start_stop_max_for_selected_date(P,e,n,E,Math.abs(h),s,o)}else{}q[0]=l[0];q[1]=l[1];q[2]=l[2];q[3]=l[3];q[4]=l[4];if(f>q[0]&&f0){L=r-S;A=Rev(r+S)}else{L=r+S;A=Rev(r-S)}u=SunAtSatAzimuth(e,280,t,n,L);w=1*(Math.floor(e)+1*(u/24));w=Math.floor(e)+u/24;u=SunAtSatAzimuth(w,280,t,n,L);w=1*(Math.floor(w)+1*(u/24));h=SunAtSatAzimuth(e,280,t,n,A);E=1*(Math.floor(e)+1*(h/24));h=SunAtSatAzimuth(E,280,t,n,A);E=1*(Math.floor(E)+1*(h/24));if(Ee)w=w-1;b=m*2*(24*60/360);g=Math.floor(b);y=Math.floor((b-g)*60);if(g<10)g="0"+g;if(y<10)y="0"+y;C[0]=w;C[1]=E;C[2]=e;C[3]=b;C[4]=i;return C}function showsunlongitude(){var e,t,n,r;var i,s,o,u,a,f,l,c;var h,p;var d=[];var v=[];var m,g,y,b,w;e=set_todays_dateandtime();i=1*document.getElementById("YearNow").value;s=1*document.getElementById("Month").value;o=1*document.getElementById("Day").value;u=1*document.getElementById("Hour").value;a=1*document.getElementById("Minute").value;f=1*document.getElementById("Second").value;var E=new Date(1*i,1*s-1,1*o,1*u,1*a,1*f,0);l=daynumber(o,s,i,u,a,f);l=l+E.getTimezoneOffset()/(60*24);e=l;d=sun_angles(e,0,0);document.getElementById("sunlongitude").innerHTML="";document.getElementById("sunlongitude").style.color="red";t=1*d[12];n=1*d[2];n=Math.abs(n);var S;S="";v=get_global_start_and_stop_time_for_selected_satellite_date(SatLon,SiteLon,Math.abs(SiteLat),0,i,1*Frequency,1*AntSize,0,1*Geosync_radius,e);if(v[1]<=e)v=get_global_start_and_stop_time_for_selected_satellite_date(SatLon,SiteLon,SiteLat,0,i,1*Frequency,1*AntSize,0,1*Geosync_radius,1*(e+1));if(document.getElementById("id3dBBeamwidth").checked==true&&document.getElementById("idThresholdLinkMargin").checked==false){r=calculateantennabeamwidth(Frequency,AntSize,70);b=0;c=getAffectedSatPositions(n,1*(r+.25))}else{y=1/100*document.getElementById("AntEfficiency").value;w=1*document.getElementById("idInputLinkMargin").value;b=1*globalarray_indexCN_degrad_output_offaxis[Math.round(w*10)];r=calculatebeamwidth_for_offpeak(b,0,0);c=getAffectedSatPositions(n,1*r);if(r==null)b=null}if(isNaN(c)){document.getElementById("sunlongitude").style.color="blue";document.getElementById("sunlongitude").innerHTML="No potential outages for this date&time"}else{h=Rev(DegEastFormat(t-c));p=Rev(DegEastFormat(t+c));document.getElementById("sunlongitude").innerHTML="";if(t<180)S=formatvalue(t,5)+"E ";else S=formatvalue(t,5)+"E ("+formatvalue(360-t,5)+"W)";if(h<180)m=formatvalue(h,5)+"E";else m=formatvalue(h,6)+"E ("+formatvalue(360-h,6)+"W)";if(p<180)g=formatvalue(p,5)+"E";else g=formatvalue(p,6)+"E ("+formatvalue(360-p,6)+"W)";document.getElementById("sunlongitude").innerHTML=document.getElementById("sunlongitude").innerHTML+'
Sun interference has just started at '+m+" and just ended at "+g+"";document.getElementById("sunlongitude").innerHTML=document.getElementById("sunlongitude").innerHTML+"
Sun@Earth Longitude: "+S+"";document.getElementById("sunlongitude").innerHTML=document.getElementById("sunlongitude").innerHTML+"

Outages in coverage area for selected satellite will start at: "+d_to_date_and_time(v[0]);document.getElementById("sunlongitude").innerHTML=document.getElementById("sunlongitude").innerHTML+"
Outages in coverage area for selected satellite will stop at: "+d_to_date_and_time(v[1]);document.getElementById("sunlongitude").innerHTML=document.getElementById("sunlongitude").innerHTML+"
Sun transit Satellite Longitude at : "+d_to_date_and_time(v[2])}return t}function getsatellites(){var e;var t;var n,r;var i;var s=new Array;for(e=0;e0){if(!isNaN(globalarray_indexCN_degrad_output_offaxis[E])&&e!=globalarray_indexCN_degrad_output_offaxis[E]&&globalarray_indexCN_degrad_output_offaxis[E]>0&&document.getElementById("contours").checked||E==201){if(Math.sqrt(t*t+n*n)<8.8+e){b=1*globalarray_indexCN_degrad_output_offaxis[E];if(E==201){b=e}var f=[];N=false;for(i=0;i<36001;i++){y=i/100;c=n+Math.cos(Radians(y))*b;h=t+Math.sin(Radians(y))*b;p=Math.acos(Math.cos(Radians(h))*Math.cos(Radians(c)));d=Math.atan2(Math.sin(Radians(c)),Math.tan(Radians(h)));v=Math.asin(6.617*Math.sin(p))-p;g=Deg(Math.asin(Math.sin(v)*Math.cos(d)))+s;m=Deg(Math.atan(Math.tan(v)*Math.sin(d)));m=Deg(Math.atan2(Math.tan(v)*Math.sin(d),1))+r;l=new google.maps.LatLng(g,m);if(!isNaN(l.lng())&&!isNaN(l.lat())){f.push(l);if(N==false&&E<201){var M="-"+Math.round(E/10)+"dB";T=l;if(markerarray[E]!=null)markermotherarray[o][E].setMap(null);markermotherarray[o][E]=new google.maps.Marker({position:l,title:M,map:map});markermotherarray[o][E].setVisible(false);labelmotherarray[o][E]=new Label({map:map});labelmotherarray[o][E].set("zIndex",1234);labelmotherarray[o][E].bindTo("position",markermotherarray[o][E],"position");labelmotherarray[o][E].set("text",M);N=true}if(E==201){if(document.getElementById("contours").checked==false)labelposition[o]=l}}}}var M="-"+Math.round(E/10);var _;O=new Array("red","darkolivegreen","black");var D=new Array(.2,.2,.2);var P="red";var P=O[o%3];if(E>=60){fill_color=P;x=1*D[o%3];_="black";w=1;strokeOpc=.6}else if(E>=40){fill_color=P;x=1*D[o%3];_="black";w=1;strokeOpc=.6}else{fill_color=P;x=1*D[o%3];_="black";w=1;strokeOpc=.6}if(E==201){w=3;_="black";strokeOpc=.6;if(document.getElementById("contours").checked){x=0;fill_color=P}else{x=1*D[o%3];fill_color=P}}else{}var H={path:f,strokeColor:_,strokeOpacity:strokeOpc,strokeWeight:w,fillColor:fill_color,fillOpacity:x,geodesic:true,title:M};if(motherarray[o][E]!=null)motherarray[o][E].setMap(null);motherarray[o][E]=new google.maps.Polygon(H);motherarray[o][E].setMap(map);if(E<201){}if(motherarray[o][E]!=null)google.maps.event.clearListeners(motherarray[o][E],"click");google.maps.event.addListener(motherarray[o][E],"click",calculatesunintdate);if(E==201){E=200}}E=E-10}if(Math.sqrt(t*t+n*n)<8.8+e){c=n;h=t;p=Math.acos(Math.cos(Radians(h))*Math.cos(Radians(c)));d=Math.atan2(Math.sin(Radians(c)),Math.tan(Radians(h)));v=Math.asin(6.617*Math.sin(p))-p;g=Deg(Math.asin(Math.sin(v)*Math.cos(d)))+s;m=Deg(Math.atan(Math.tan(v)*Math.sin(d)));m=Deg(Math.atan2(Math.tan(v)*Math.sin(d),1))+r;S=1*globalarray_index_offaxis_output_CN_degrad[Math.abs(Math.round(0*10))];C="";var M;if(r>180)C=formatvalue(360-r,5)+"W ("+formatvalue(r,5)+"E )";else C=formatvalue(r,5)+"E";if(k[1]<0)M=u+"
"+C+"
Incl. "+formatvalue(k[1],4)+"S
-"+formatvalue(S,4)+"dB";else M=u+"
"+C+"
Incl. "+formatvalue(k[1],4)+"N
-"+formatvalue(S,4)+"dB";if(marker[o]!=null)marker[o].setMap(null);var B=new google.maps.LatLng(g,m);if(isNaN(B.lng())||isNaN(B.lat()))B=labelposition[o];if(!isNaN(B.lng())&&!isNaN(B.lat())){if(marker[o]!=null)marker[o].setMap(null);A=1;marker[o]=new google.maps.Marker({position:B,title:M,map:map});marker[o].setVisible(false);if(label[o]!=null)label[o].setMap(null);label[o]=new Label({map:map});label[o].set("zIndex",1234);label[o].bindTo("position",marker[o],"position");label[o].set("text",M)}}return A}function draw_new_coverage(){var e=[];var t,n,r,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b;var w,E,g,p,d,S,v,m;l=8.683333333333334;var x=6.61078;var T,N;N=1/298.257223563;N=.0033528131;for(i=0;i<360001;i++){r=Math.sin(Radians(i/1e3))*l;n=Math.cos(Radians(i/1e3))*l;s=Math.acos(Math.cos(Radians(r))*Math.cos(Radians(n)))+Radians(0);o=Math.atan2(Math.sin(Radians(n)),Math.tan(Radians(r)))+Radians(0);u=Math.asin(6.617*Math.sin(s))-s;u=Math.asin(6.6235*Math.sin(s))-s;f=Deg(Math.asin(Math.sin(u)*Math.cos(o)));T=Deg(Math.atan(Math.sin(Radians(f))/(x-Math.cos(Radians(f))))-Math.atan(Math.sin(Radians(f))/Math.sqrt(x*x-Math.cos(Radians(f))*Math.cos(Radians(f)))));T=Deg(Math.atan((1-N)*(1-N)*Math.tan(Radians(f))));a=Deg(Math.atan2(Math.tan(u)*Math.sin(o),1))-50.1;t=new google.maps.LatLng(f,a);if(!isNaN(t.lng())&&!isNaN(t.lat()))e.push(t);else{t=new google.maps.LatLng(0,28.21);e.push(t)}}var C={path:e,strokeColor:"red",strokeOpacity:1,strokeWeight:2,fillColor:"#0000FF",fillOpacity:.2,geodesic:true}}function print_footprint_on_google_map(e,t){var n,r,i,s;var o,u,a,f,l,c,h,p,d,v;var m=[];var g=[];var y=[];var b=[];var w=[];var E,S,x,T,N,C,k,L;var A,O,M,_,D,P,H;var B=new Array;var j,F;var I,q,R,U,z,W,X,V,$;var J=new Array;var K=new Array;var Q=[];var G=new Array;var Y;var Z,et;var tt;var nt=new Array;var rt=new Array;var it,st,ot,ut,at;var ft,lt;var ct,ht,pt,dt;var vt;$=showsunlongitude();s=0;E=SatLon;n=set_todays_dateandtime();I=1*document.getElementById("YearNow").value;q=1*document.getElementById("Month").value;R=1*document.getElementById("Day").value;U=1*document.getElementById("Hour").value;z=1*document.getElementById("Minute").value;W=1*document.getElementById("Second").value;var mt=new Date(1*I,1*q-1,1*R,1*U,1*z,1*W,0);document.getElementById("LocalTimeZoneDescription").innerHTML=get_timezone_offset_text_new(mt);X=daynumber(R,q,I,U,z,W);X=X+mt.getTimezoneOffset()/(60*24);n=X;document.getElementById("showtimecalculated").innerHTML=d_to_date_and_time(n);window.document.title="Sun Outage Visualizer Simulator for Geostationary Satellites - Projects area affected by potential Sun outage - Jens T. Stre - http://www.satellite-calculations.com "+document.getElementById("showtimecalculated").innerHTML;B=getPeakLatitude(n);C=85;B=sun_angles(n,60,60);j=B[2];H=difference(E,$);J=getsatellites();F=J[1];ct=Math.acos(Math.cos(Radians(-1*j))*Math.cos(Radians(0)));ht=Math.atan2(Math.sin(Radians(0)),Math.tan(Radians(-1*j)));pt=Math.asin(6.617*Math.sin(ct))-ct;dt=Deg(Math.asin(Math.sin(pt)*Math.cos(ht)));tt=document.Position.SelectList.value;rt=tt.split(":");vt=0;if(document.getElementById("plotall").checked==false&&document.getElementById("plotselected").checked==false&&document.getElementById("altplot").checked==false&&document.getElementById("plotallfiltered").checked==false){if(test_satreferredcoordinates(1*t,-1*j,1*H,1*E,1*F,vt,rt[4].trim(),rt)==1)vt=vt+1;var gt=showsunlongitude();if(gt>180)gt=gt-360;var yt=new google.maps.LatLng(dt,E);var bt=map.getCenter().lat();var wt=map.getCenter().lng();var Et=bt;var St=wt;if(isNaN(yt.lat()))Et=bt;if(isNaN(yt.lng())||document.getElementById("ifollowthesun").checked)St=gt;else St=wt;var xt=new google.maps.LatLng(Et,St);if(!isNaN(yt.lng())&&!isNaN(yt.lat())){if(document.getElementById("ifollowthesun").checked)map.setCenter(xt)}else{if(isNaN(yt.lat()))Et=bt;if(isNaN(yt.lng()))St=gt;St=gt;var xt=new google.maps.LatLng(Et,St);if(document.getElementById("ifollowthesun").checked)map.setCenter(xt)}}if(document.getElementById("plotall").checked){if(coverage_polygon1!=null)coverage_polygon1.setMap(null);var gt=showsunlongitude();if(gt>180)gt=gt-360;var yt=new google.maps.LatLng(dt,E);var bt=map.getCenter().lat();var wt=map.getCenter().lng();var Et=bt;var St=wt;if(isNaN(yt.lat()))Et=bt;if(isNaN(yt.lng())||document.getElementById("ifollowthesun").checked)St=gt;else St=wt;var xt=new google.maps.LatLng(Et,St);if(!isNaN(yt.lng())&&!isNaN(yt.lat())){if(document.getElementById("ifollowthesun").checked)map.setCenter(xt)}else{if(isNaN(yt.lat()))Et=bt;if(isNaN(yt.lng()))St=gt;St=gt;var xt=new google.maps.LatLng(Et,St);if(document.getElementById("ifollowthesun").checked)map.setCenter(xt)}vt=0;for(o=0;o180)gt=gt-360;var yt=new google.maps.LatLng(dt,E);var bt=map.getCenter().lat();var wt=map.getCenter().lng();var Et=bt;var St=wt;if(isNaN(yt.lat()))Et=bt;if(isNaN(yt.lng())||document.getElementById("ifollowthesun").checked)St=gt;else St=wt;var xt=new google.maps.LatLng(Et,St);if(!isNaN(yt.lng())&&!isNaN(yt.lat())){if(document.getElementById("ifollowthesun").checked)map.setCenter(xt)}else{if(isNaN(yt.lat()))Et=bt;if(isNaN(yt.lng()))St=gt;St=gt;var xt=new google.maps.LatLng(Et,St);if(document.getElementById("ifollowthesun").checked)map.setCenter(xt)}ft=0;vt=0;st=1*document.getElementById("SatLonFilter").value;ut=1*document.getElementById("InclinationFilter").value;ot=1*document.getElementById("LonDriftFilter").value;for(o=0;ost&&it180)gt=gt-360;var yt=new google.maps.LatLng(dt,E);var bt=map.getCenter().lat();var wt=map.getCenter().lng();var Et=bt;var St=wt;if(isNaN(yt.lat()))Et=bt;if(isNaN(yt.lng())||document.getElementById("ifollowthesun").checked)St=gt;else St=wt;var xt=new google.maps.LatLng(Et,St);if(!isNaN(yt.lng())&&!isNaN(yt.lat())){if(document.getElementById("ifollowthesun").checked)map.setCenter(xt)}else{if(isNaN(yt.lat()))Et=bt;if(isNaN(yt.lng()))St=gt;St=gt;var xt=new google.maps.LatLng(Et,St);if(document.getElementById("ifollowthesun").checked)map.setCenter(xt)}o=0;vt=0;while(o<3600){F=0;E=1*o/10;rt=new Array(1*E,0,42164,28184,"test",1023.0244812045,-42147.7814604451,-.00121153714057367,0);H=difference(E,$);if(test_satreferredcoordinates(1*t,-1*j,1*H,1*E,1*F,vt,"",rt)==1)vt=vt+1;o=o+1*document.getElementById("SatLonResolution").value*10}}var yt=new google.maps.LatLng(dt,$);if(document.getElementById("plotselected").checked){if(coverage_polygon1!=null)coverage_polygon1.setMap(null);for(o=0;o180)gt=gt-360;var yt=new google.maps.LatLng(dt,E);var bt=map.getCenter().lat();var wt=map.getCenter().lng();var Et=bt;var St=wt;if(isNaN(yt.lat()))Et=bt;if(isNaN(yt.lng())||document.getElementById("ifollowthesun").checked)St=gt;else St=wt;var xt=new google.maps.LatLng(Et,St);if(!isNaN(yt.lng())&&!isNaN(yt.lat())){if(document.getElementById("ifollowthesun").checked){map.setCenter(xt)}}else{if(isNaN(yt.lat()))Et=bt;if(isNaN(yt.lng()))St=gt;St=gt;var xt=new google.maps.LatLng(Et,St);if(document.getElementById("ifollowthesun").checked)map.setCenter(xt)}create_url()}function create_url(){var e,t;var n=new Array;e="http://www.satellite-calculations.com/Satellite/sunoutagestatus.php?";e+=document.getElementById("Frequency").value;e+="/"+document.getElementById("AntSize").value;e+="/meter";e+="/"+document.getElementById("AntEfficiency").value;e+="/"+document.getElementById("NoiseTempAntenna").value;e+="/"+document.getElementById("WaveGuideLoss_dB").value;e+="/"+document.getElementById("NoiseTempLNB_dB").value;if(document.getElementById("linear").checked==true)e+="/lin";else e+="/cir";e+="/"+document.getElementById("idInputLinkMargin").value;if(document.getElementById("altplot").checked==true)e+="/3";else if(document.getElementById("plotall").checked==true)e+="/1";else if(document.getElementById("plotselected").checked==true)e+="/2";else if(document.getElementById("plotallfiltered").checked==true)e+="/4";else e+="/0";e+="/"+document.getElementById("SatLonResolution").value;if(document.getElementById("ifollowthesun").checked==true)e+="/followthesun";else e+="/dontfollowthesun";if(document.getElementById("autoupdatesatlist").checked==true)e+="/dynlis";else e+="/nodynlis";if(document.getElementById("contours").checked==true)e+="/1dB";else e+="/0dB";if(document.getElementById("id3dBBeamwidth").checked==true)e+="/notCNbased";else e+="/CNbased";if(isNaN(currentselectedinterval)||currentselectedinterval=="undefined")e+="/0";else e+="/"+currentselectedinterval;e+="/"+map.getZoom();if(document.getElementById("buttonmap").value=="Click for small map")e+="/bigmap";else e+="/smallmap";e+="/"+document.getElementById("SatLonFilter").value;e+="/"+document.getElementById("InclinationFilter").value;e+="/"+document.getElementById("LonDriftFilter").value;for(i=0;iURL link with settings';document.getElementById("URL").style.backgroundColor="grey"}function calculatesunintdate(e){var t=[];var n=e.latLng;currentselectedlocation=n;SiteLat=currentselectedlocation.lat();SiteLon=currentselectedlocation.lng();reverseGeocode(currentselectedlocation);t.push(n);var r={locations:t};elevator1.getElevationForLocations(r,function(e,t){if(t==google.maps.ElevationStatus.OK){if(e[0]){if(e[0].elevation<0)Height_over_ocean=0;else Height_over_ocean=1*e[0].elevation/1e3;print_outages();infowindow.setPosition(n);var r=infowindow.getPosition();var i,s;if(r.lng()<0)i="W";else i="E";if(r.lat()<0)s="S";else s="N";map.setCenter(n);var o,u,a;u=e[0].elevation;o=u*metertofeet;a=o*feettoinch;if(SiteMarker!=null)SiteMarker.setMap(null);PlaceSitemarker(n);SetCookie()}else{alert("No results found")}}else{alert("Elevation service failed due to: "+t)}})}function DegEastFormat(e){var t;if(e<0)t=360+e;else t=e;return t}function start_moving_marker_on_map(){clearInterval(autointerval);loadfootprint();autointerval=setInterval("setlocaltimeinhtmlfields();loadfootprint()",1e4);automatic_600s();document.getElementById("30s").style.borderWidth="thick";document.getElementById("30s").style.borderColor="red";document.getElementById("10s").style.borderWidth="medium";document.getElementById("10s").style.borderColor="grey";document.getElementById("20s").style.borderWidth="medium";document.getElementById("20s").style.borderColor="grey";document.getElementById("60s").style.borderWidth="medium";document.getElementById("60s").style.borderColor="grey";document.getElementById("Simulatebutton").style.borderWidth="medium";document.getElementById("Simulatebutton").style.borderColor="grey";currentselectedinterval=10}function automatic_20seconds(){clearInterval(autointerval);loadfootprint();autointerval=setInterval("setlocaltimeinhtmlfields();loadfootprint()",5e3);automatic_600s();document.getElementById("20s").style.borderWidth="thick";document.getElementById("20s").style.borderColor="red";document.getElementById("10s").style.borderWidth="medium";document.getElementById("10s").style.borderColor="grey";document.getElementById("30s").style.borderWidth="medium";document.getElementById("30s").style.borderColor="grey";document.getElementById("60s").style.borderWidth="medium";document.getElementById("60s").style.borderColor="grey";document.getElementById("Simulatebutton").style.borderWidth="medium";document.getElementById("Simulatebutton").style.borderColor="grey";currentselectedinterval=5}function automatic_60seconds(){clearInterval(autointerval);loadfootprint();autointerval=setInterval("setlocaltimeinhtmlfields();loadfootprint()",6e4);automatic_600s();document.getElementById("60s").style.borderWidth="thick";document.getElementById("60s").style.borderColor="red";document.getElementById("10s").style.borderWidth="medium";document.getElementById("10s").style.borderColor="grey";document.getElementById("20s").style.borderWidth="medium";document.getElementById("20s").style.borderColor="grey";document.getElementById("30s").style.borderWidth="medium";document.getElementById("30s").style.borderColor="grey";document.getElementById("Simulatebutton").style.borderWidth="medium";document.getElementById("Simulatebutton").style.borderColor="grey";currentselectedinterval=60}function automatic_10seconds(){clearInterval(autointerval);loadfootprint();autointerval=setInterval("setlocaltimeinhtmlfields();loadfootprint()",1e3);automatic_600s();document.getElementById("10s").style.borderWidth="thick";document.getElementById("10s").style.borderColor="red";document.getElementById("20s").style.borderWidth="medium";document.getElementById("20s").style.borderColor="grey";document.getElementById("30s").style.borderWidth="medium";document.getElementById("30s").style.borderColor="grey";document.getElementById("60s").style.borderWidth="medium";document.getElementById("60s").style.borderColor="grey";document.getElementById("Simulatebutton").style.borderWidth="medium";document.getElementById("Simulatebutton").style.borderColor="grey";currentselectedinterval=1}function automatic_600s(){clearInterval(autointerval2);setlocaltimeinhtmlfields();print_max_north_south_outage();autointerval2=setInterval("setlocaltimeinhtmlfields();print_max_north_south_outage()",300*1e3)}function simulation(){var e,t,n,r,i,s,o,u,a,f;var l=new Date;clearInterval(autointerval2);n=1*document.getElementById("YearNow").value;r=1*document.getElementById("Month").value;i=1*document.getElementById("Day").value;s=1*document.getElementById("Hour").value;o=1*document.getElementById("Minute").value;u=1*document.getElementById("Second").value;a=daynumber(i,r,n,s,o,u);var l=new Date(1*n,1*r-1,1*i,1*s,1*o,1*u,0);a=a+l.getTimezoneOffset()/(60*24);f=a;e=1*document.getElementById("Simulationrefresh").value;var c=new Date(1*n,1*r-1,1*i,1*s,1*o,1*u,0);r=c.getMonth()+1;i=c.getDate();n=c.getFullYear();s=c.getHours();o=c.getMinutes();u=c.getSeconds();document.getElementById("YearNow").value=1*n;document.getElementById("Month").value=1*r;document.getElementById("Day").value=1*i;document.getElementById("Hour").value=1*s;document.getElementById("Minute").value=1*o;document.getElementById("Second").value=1*u;document.getElementById("Simulatebutton").style.borderWidth="thick";document.getElementById("Simulatebutton").style.borderColor="red";document.getElementById("20s").style.borderWidth="medium";document.getElementById("20s").style.borderColor="grey";document.getElementById("30s").style.borderWidth="medium";document.getElementById("30s").style.borderColor="grey";document.getElementById("60s").style.borderWidth="medium";document.getElementById("60s").style.borderColor="grey";document.getElementById("10s").style.borderWidth="medium";document.getElementById("10s").style.borderColor="grey";loadfootprint();autointerval2=setInterval("setsimulationtimeinhtmlfields();loadfootprint()",e*1e3)}function setsimulationtimeinhtmlfields(){var e,t,n,r,i,s,o,u,r,n,t,i,s,a,f;var l=new Date;r=1*document.getElementById("YearNow").value;n=1*document.getElementById("Month").value;t=1*document.getElementById("Day").value;i=1*document.getElementById("Hour").value;s=1*document.getElementById("Minute").value;o=1*document.getElementById("Second").value;u=daynumber(t,n,r,i,s,o);var l=new Date(1*r,1*n-1,1*t,1*i,1*s,1*o,0);f=1*document.getElementById("Simulatestep").value;l=1*l+f*1e3;l=new Date(l);n=l.getMonth()+1;t=l.getDate();r=l.getFullYear();i=l.getHours();s=l.getMinutes();o=l.getSeconds();document.getElementById("YearNow").value=1*r;document.getElementById("Month").value=1*n;document.getElementById("Day").value=1*t;document.getElementById("Hour").value=1*i;document.getElementById("Minute").value=1*s;document.getElementById("Second").value=1*o;document.getElementById("LocalTimeZoneDescription").innerHTML=get_timezone_offset_text();print_max_north_south_outage()}function loadfootprint(){var e,t,n,r,i,s;for(s=0;s<1500;s++){if(label[s]!=null)label[s].setMap(null)}for(s=0;s<1500;s++){if(marker[s]!=null)marker[s].setMap(null)}if(new_outage_aerea_polygon!=null)new_outage_aerea_polygon.setMap(null);for(s=0;s<202;s++){if(markerarray[s]!=null)markerarray[s].setMap(null)}for(s=0;s<202;s++){if(arrayofoutagepolygons[s]!=null)arrayofoutagepolygons[s].setMap(null)}for(k=0;k<1500;k++){for(s=0;s<202;s++){if(motherarray[k][s]!=null)motherarray[k][s].setMap(null);if(labelmotherarray[k][s]!=null)labelmotherarray[k][s].setMap(null);if(markermotherarray[k][s]!=null)markermotherarray[k][s].setMap(null)}}e=SatLon;if(document.getElementById("id3dBBeamwidth").checked==true&&document.getElementById("idThresholdLinkMargin").checked==false){t=calculateantennabeamwidth(1*Frequency,1*AntSize,70)+SunRadius;r=0}else{i=1*document.getElementById("idInputLinkMargin").value;n=1/100*document.getElementById("AntEfficiency").value;r=1*globalarray_indexCN_degrad_output_offaxis[Math.round(i*10)];t=calculatebeamwidth_for_offpeak(1*r,0,0);if(r==0)t=0;if(t==null)r=null}if(t!=0&&t!=null)print_footprint_on_google_map(1*e,1*t);else polygon_max_min_lat_for_outage.setMap(null)}function sun_angles(e,t,n){var r,i,s,o,u,a,f,l,c;var h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D;var P,H,B,j,F,I,q;l=Math.PI;var R=new Array;h=282.9404+470935e-10*e;p=1;d=.016709-1.151e-9*e;v=356.047+.9856002585*e;g=23.4393-3.563e-7*e;m=h+Rev(v);m=Rev(m);y=v+180/l*d*Math.sin(Radians(v))*(1+d*Math.cos(Radians(v)));y=Rev(y);b=p*Math.cos(Radians(y))-d;w=p*Math.sin(Radians(Rev(y)))*Math.sqrt(1-d*d);E=Math.sqrt(b*b+w*w);S=Deg(Math.atan2(w,b));x=Rev(S+h);b=E*Math.cos(Radians(x));w=E*Math.sin(Radians(x));T=0;N=b;C=w*Math.cos(Radians(g))+T*Math.sin(Radians(g));k=w*Math.sin(Radians(g))+T*Math.cos(Radians(g));L=Rev(Deg(Math.atan2(C,N)));A=Deg(Math.atan2(k,Math.sqrt(N*N+C*C)));O=m+180;M=e-Math.floor(e);s=O+M*360+t;i=s-L;b=Math.cos(i*l/180)*Math.cos(A*l/180);w=Math.sin(i*l/180)*Math.cos(A*l/180);T=Math.sin(A*l/180);H=b*Math.sin(n*l/180)-T*Math.cos(n*l/180);B=w;j=b*Math.cos(n*l/180)+T*Math.sin(n*l/180);P=Deg(Math.asin(j));q=P;P=ElevationRefraction(P);SunAzimuth=Deg(Math.atan2(B,H));R[0]=P;if(n<0)R[1]=SunAzimuth+180;else R[1]=SunAzimuth+180;if(n>0)R[14]=Rev(i-180);else R[14]=Rev(360-i);R[2]=A;R[3]=x;R[4]=L;R[5]=Rev(O);R[6]=Rev(v);R[7]=Rev(h);R[8]=Rev(d);R[9]=Rev(g);R[10]=q;R[11]=m;R[12]=Rev(L-O-M*360);R[13]=E;return R}function SimpleElevationEquatorCrossing(e,t,n,r){var i,s,o,u,a,f,l,c,h,p,d,v,m,g,y;var b,w,E;var S,x,T,N,C,k;var L;var A=new Array;x=.58804392;T=-.17941557;N=.029906946;C=-.00251874;k=82622101e-12;E=0;s=0;u=42164.57;o=6378.14;i=o/Math.sqrt(1-s*(2-s)*Math.sin(Radians(t))*Math.sin(Radians(t)));a=(i+r)*Math.cos(Radians(t));f=(i*(1-s)*(1-s)+r)*Math.sin(Radians(t));l=u-i;c=u*Math.cos(Radians(E))*Math.cos(Radians(e-n))-a;h=u*Math.cos(Radians(E))*Math.sin(Radians(e-n));d=u*Math.sin(Radians(E))-f;v=-c*Math.sin(Radians(t))+d*Math.cos(Radians(t));m=c*Math.cos(Radians(t))+d*Math.sin(Radians(t));g=Deg(Math.atan2(m,Math.sqrt(v*v+h*h)));s=1/298.257;u=42164.57;o=6378.14;s=0;i=o/Math.sqrt(1-s*(2-s)*Math.sin(Radians(t))*Math.sin(Radians(t)));a=(i+r)*Math.cos(Radians(t));f=(i*(1-s)*(1-s)+r)*Math.sin(Radians(t));l=u-i;c=u*Math.cos(Radians(E))*Math.cos(Radians(e-n))-a;h=u*Math.cos(Radians(E))*Math.sin(Radians(e-n));d=u*Math.sin(Radians(E))-f;v=-c*Math.sin(Radians(t))+d*Math.cos(Radians(t));m=c*Math.cos(Radians(t))+d*Math.sin(Radians(t));g=Deg(Math.atan2(m,Math.sqrt(v*v+h*h)));S=Math.abs(g+.589);p=Math.abs(x+T*S+N*S*S+C*S*S*S+k*S*S*S*S);if(g>10.2){b=g+.01617*(Math.cos(Radians(Math.abs(g)))/Math.sin(Radians(Math.abs(g))))}else{b=g+p}if(m<-3e3)b=-99;return g}function SetHtmlDefaults(){var e,t;t=new Date;Year=t.getUTCFullYear();Month=t.getUTCMonth()+1;if(Month>=5){document.getElementById("Fall").checked=1;season=1}else{document.getElementById("Spring").checked=1;season=0}document.getElementById("ku-band").checked=true;document.getElementById("AntSize").value=.72;document.getElementById("Frequency").value=10.95;document.getElementById("Year").value=Year;e=document.cookie;if(e==null){document.getElementById("ku-band").checked=1;Frequency=11.95}else{var n=new Array;n=e.split(":");if(n[14]=="C")document.getElementById("c-band").checked=true;else if(n[14]=="ku")document.getElementById("ku-band").checked=true;else if(n[14]=="userband")document.getElementById("user-band").checked=true;else document.getElementById("ku-band").checked=true;if(!isNaN(n[12])&&n[12]!="undefined"&&n[12]!=""){document.getElementById("AntSize").value=1*n[12];AntSize=1*n[12]}else{AntSize=.6;document.getElementById("AntSize").value=.6}if(!isNaN(n[13])&&n[13]!="undefined"&&n[13]!=""){Frequency=1*n[13];document.getElementById("Frequency").value=1*1*n[13]}else{Frequency=11.95;document.getElementById("Frequency").value=Frequency}}if(document.getElementById("user-band").checked)Frequency=1*document.getElementById("Frequency").value;else if(document.getElementById("ku-band").checked){Frequency=11.95;document.getElementById("Frequency").value=Frequency}else if(document.getElementById("c-band").checked){Frequency=3.95;document.getElementById("Frequency").value=Frequency}if(!isNaN(AntSize)){document.getElementById("AntSizeFeet").value=formatvalue(AntSize*metertofeet,4);document.getElementById("AntSizeInches").value=formatvalue(AntSize*metertoinch,5)}}function SetCookiePHParg(){var e,t,n,r,i;var s,o;var u,a,f,l;var c,h,p,d,v,m,g,y,b,w;var E,S,x,T,N,C,h,p,d;var k=new Array;var L=new Array;MyCookieVal=document.cookie;if(MyCookieVal!==""){k=MyCookieVal.split(":");E=k[4];S=k[6];x=k[7];T=k[8];N=k[9];C=k[10];h=k[12];p=k[13];d=k[14];v=k[15];g=k[17];y=k[18];b=k[19];w=k[20]}if(MyCookieVal==""){E="undefined";S="undefined";x="undefined";T="undefined";N="undefined";C="undefined";h="undefined";p="undefined";d="undefined";v="undefined";g="undefined";y="undefined";b="undefined";w="undefined"}if(SiteLat<0){n="South";e=-SiteLat}else{n="North";e=SiteLat}if(SiteLon>0){r="East";t=SiteLon}else{r="West";t=-SiteLon}h=1*document.getElementById("AntSize").value;p=1*document.getElementById("Frequency").value;if(document.getElementById("c-band").checked==true)d="C";else if(document.getElementById("ku-band").checked==true)d="ku";else if(document.getElementById("user-band").checked==true)d="userband";else document.getElementById("ku-band").checked=true;i=k[0]+":"+k[1]+":"+k[2]+":"+k[3]+":"+k[4]+":"+k[5]+":"+S+":"+x+":"+T+":"+N+":"+C+":"+k[11]+":"+h+":"+p+":"+d+":"+v+":"+zoom+":"+g+":"+b+":"+w+";expires=Tue, 10 Jul 2040 23:59:59 UTC;";deleteAllCookies();document.cookie=i}function SetCookie(){var e,t,n,r,i;var s,o;var u,a,f,l;var c,h,p,d,v,m,g,y,b,w;var E,S,x,T,N,C,h,p,d;var k=new Array;var L=new Array;MyCookieVal=document.cookie;if(MyCookieVal!==""){k=MyCookieVal.split(":");E=k[4];S=k[6];x=k[7];T=k[8];N=k[9];C=k[10];h=k[12];p=k[13];d=k[14];v=k[15];g=k[17];y=k[18];b=k[19];w=k[20]}if(MyCookieVal==""){E="undefined";S="undefined";x="undefined";T="undefined";N="undefined";C="undefined";h="undefined";p="undefined";d="undefined";v="undefined";g="undefined";y="undefined";b="undefined";w="undefined"}if(SiteLat<0){n="South";e=-SiteLat}else{n="North";e=SiteLat}if(SiteLon>0){r="East";t=SiteLon}else{r="West";t=-SiteLon}o=document.Position.SelectList.selectedIndex;HightAboveOcean=1*Height_over_ocean;m=map.getZoom();if(currentAddressResponse!="")v=currentAddressResponse;h=1*document.getElementById("AntSize").value;p=1*document.getElementById("Frequency").value;if(document.getElementById("c-band").checked==true)d="C";else if(document.getElementById("ku-band").checked==true)d="ku";else if(document.getElementById("user-band").checked==true)d="userband";else document.getElementById("ku-band").checked=true;i=e+":"+n+":"+t+":"+r+":"+E+":"+o+":"+S+":"+x+":"+T+":"+N+":"+C+":"+HightAboveOcean+":"+h+":"+p+":"+d+":"+v+":"+m+":"+g+":"+b+":"+w+";expires=Tue, 10 Jul 2040 23:59:59 UTC;";deleteAllCookies();document.cookie=i}function print_outages(){document.getElementById("outages").innerHTML=get_outage_dates_and_HAtransit(SatLon,SiteLon,SiteLat,season,Year,Frequency,AntSize,Height_over_ocean,Geosync_radius)}function clear_multiple_outages(){multipleoutagesoutput="";lastprintedoutage="";document.getElementById("outages").innerHTML=""}function print_multiple_outages(){multipleoutagesoutput=get_outage_dates_and_HAtransit(SatLon,SiteLon,SiteLat,season,Year,Frequency,AntSize,Height_over_ocean,Geosync_radius)+multipleoutagesoutput;document.getElementById("outages").innerHTML=multipleoutagesoutput}function PrintSave(){var e;var t=new Date;e=t.getFullYear();PrintWindow=window.open("","Print_window","");PrintWindow.oldWindow=top;var n="GEOSTATIONARY SATELLITE - SUN INTERFERENCE PREDICTIONS REPORT - (C) "+e+" JENS T. STRE http://www.satellite-calculations.com\n";n+="\n";n+="\n";n+="\n";n+="\n";n+='\n
GEOSTATIONARY SATELLITE - SUN INTERFERENCE PREDICTIONS REPORT
(C) "+e+' JENS T. STRE
http://www.satellite-calculations.com
\n';n+='\n
';n+='\n";n+='\n