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 difference(e,t){if(e>t)return Math.abs(e-t);else return Math.abs(t-e)}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 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()}function onchange_antenna_efficiency(){AntEfficiency=1*document.getElementById("Ant_Efficiency").value}function onchange_antenna_vertical_size(){AntVertSize=1*document.getElementById("AntVerticalSize").value;document.getElementById("AntVerticalSizeFeet").value=formatvalue(AntVertSize*metertofeet,4);document.getElementById("AntVerticalSizeInches").value=formatvalue(AntVertSize*metertoinch,5);SetCookie()}function onchange_antenna_vertical_size_feet(){var e;e=1*document.getElementById("AntVerticalSizeFeet").value;AntVertSize=e*feettometer;document.getElementById("AntVerticalSize").value=formatvalue(AntVertSize,4);document.getElementById("AntVerticalSizeInches").value=formatvalue(e*feettoinch,5);SetCookie()}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);document.getElementById("AntVerticalSize").value=formatvalue(AntSize,4);document.getElementById("AntVerticalSizeFeet").value=formatvalue(e*feettoinch,5);document.getElementById("AntVerticalSizeInches").value=formatvalue(e*feettoinch,5);SetCookie()}function onchange_antenna_vertical_size_inches(){var e;e=1*document.getElementById("AntVerticalSizeInches").value;AntVertSize=e*inchtometer;document.getElementById("AntVerticalSize").value=formatvalue(AntVertSize,4);document.getElementById("AntVerticalSizeFeet").value=formatvalue(e*inctofeet,5);SetCookie()}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);document.getElementById("AntVerticalSize").value=formatvalue(AntSize,4);document.getElementById("AntVerticalSizeFeet").value=formatvalue(e*inctofeet,5);document.getElementById("AntVerticalSizeInches").value=formatvalue(e,5);SetCookie()}function onchange_band(){if(document.getElementById("c-band").checked==true)Frequency=3.95;else if(document.getElementById("ku-band").checked==true)Frequency=11.95;else if(document.getElementById("user-band").checked==true)Frequency=1*document.getElementById("Frequency").value;document.getElementById("Frequency").value=Frequency;SetCookie()}function onchange_frequency(){document.getElementById("user-band").checked=true;Frequency=1*document.getElementById("Frequency").value;SetCookie()}function draw_footprint(e,t,n,r,i,s,o,u){var a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T;var N=new Array;var C;var k;k=6.6235;k=6.623688;w=1;S=1/Math.tan(Radians(i))*(1/Math.tan(Radians(i)))*Math.cos(Radians(u+r))*Math.cos(Radians(u+r));x=1/Math.tan(Radians(o))*(1/Math.tan(Radians(o)))*Math.sin(Radians(u+r))*Math.sin(Radians(u+r));E=S+x;C=Rev(Deg(Math.atan2(w,Math.sqrt(E))));if(o!=0){i=C}c=angulardifference(t,n);l=c;document.getElementById("SunInt_misc").innerHTML="Lon_SB: "+l;f=Deg(Math.acos(Math.cos(Radians(e))*Math.cos(Radians(l))));f=Rev(f);a=Deg(Math.atan2(Math.sin(Radians(f)),k-Math.cos(Radians(f))));if(s!="NA"){a=s*1}h=Deg(Math.acos(Math.cos(Radians(a))*Math.cos(Radians(i))+Math.sin(Radians(a))*Math.sin(Radians(i))*Math.cos(Radians(r))));w=Math.sin(Radians(r));E=Math.sin(Radians(a))*Math.cos(Radians(i))/Math.sin(Radians(i));E=E-Math.cos(Radians(a))*Math.cos(Radians(r));p=Deg(Math.atan2(w,E));d=Deg(Math.atan2(Math.sin(Radians(l)),Math.tan(Radians(e))))+p;v=Deg(Math.asin(k*Math.sin(Radians(h))))-h;m=Deg(Math.asin(Math.sin(Radians(v))*Math.cos(Radians(d))));g=Deg(Math.atan2(Math.tan(Radians(v))*Math.sin(Radians(d)),1));b=n-g;T=m;if(b<0)b=b+360;y=new google.maps.LatLng(T,b);return y}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 clearmarkers(){if(polygon1!=null)polygon1.setMap(null);for(i=0;i180)i=SatLon-360;else i=SatLon;if(coverage_polygon1!=null)coverage_polygon1.setMap(null);if(polygon1!=null)polygon1.setMap(null);if(coveragemarkers!=null)coveragemarkers.setMap(null);if(marker!=null)marker.setMap(null);for(n=0;n<36001;n++){r=(n+e)%36001;r=n/100;s=draw_footprint(0,i,i,r,8.683333333333334,"NA",0,0);if(!isNaN(s.lng())&&!isNaN(s.lat()))t.push(s)}var o={path:t,strokeColor:"green",strokeOpacity:1,strokeWeight:2};globalcoveragearray=t;coverage_polygon1=new google.maps.Polyline(o);coverage_polygon1.setMap(map)}function antennapattern(){var e,t;e=54;gainoffax=ITUR_BO1213_AntennaPattern(1*AntSize,1*AntEfficiency,1*Frequency,54,1.5);alert(gainoffax+" [dB]"+(e+gainoffax)+" [dB]");t=find_offaxis_for_gain_reduction(-3,1*AntSize,1*AntennaEfficiency);alert(-1+" [dB]"+(e-1)+" [dB] "+t)}function check_input_antenna_size(){var e,t;e=AntSize/(299792458/(1*Frequency*1e3*1e3*1e3));t=AntVertSize/(299792458/(1*Frequency*1e3*1e3*1e3));if(e<11||t<11){alert("Antenna diameter smaller than the ITU-R BO.1213-1 antenna pattern is specified for \nTry to increase the antenna diameter !")}}function ITUR_BO1213_AntennaPattern(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m;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)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/100),1*Frequency,54,r);if(s==99)return-1*1;if(s-1&&it!=1){if(isNaN(ut.lng())||isNaN(ut.lat())){nt=f+1;it=1}f=f-1;ut=b[f]}f=0;ut=b[f];var at;while(fD)lt=0;D=P;ot=P;for(f=1;flt)ct=36001-ft+lt;else if(ft180)J=J-360;if(J<-180)J=J+360;v=new google.maps.LatLng($,J);if(marker!=null)marker.setMap(null);{placeMarker(v)}var ht={html:"Polygon",path:w,strokeColor:"blue",strokeOpacity:1,strokeWeight:1,fillColor:"#0000FF",fillOpacity:.2};var pt={path:S,strokeColor:"red",strokeOpacity:1,strokeWeight:2,fillColor:"#0000FF",fillOpacity:.2};var dt={path:E,strokeColor:"red",strokeOpacity:1,strokeWeight:3};selection_polygon=new google.maps.Polyline(dt);selection_polygon.setMap(map)}else{}return w}function placeMarker(e){marker=new google.maps.Marker({position:e,map:map})}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("loadfootprint()",3e4)}function loadfootprint(){var e;if(polygon1!=null)polygon1.setMap(null);if(selection_polygon!=null)selection_polygon.setMap(null);if(extracted_footprint_polygon!=null)extracted_footprint_polygon.setMap(null);e=SatLon;outage_beamwidth=calculateantennabeamwidth(1*Frequency,1*AntSize,1*1*AntEfficiency)}function SetHtmlDefaults(){var e,t;t=new Date;Year=t.getUTCFullYear();Month=t.getUTCMonth()+1;document.getElementById("ku-band").checked=true;document.getElementById("AntSize").value=.72;document.getElementById("AntVerticalSize").value=.72;document.getElementById("Frequency").value=10.95;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];document.getElementById("AntVerticalSize").value=1*n[12];AntSize=1*n[12];AntVertSize=AntSize}else{AntSize=.6;document.getElementById("AntSize").value=.6;document.getElementById("AntVerticalSize").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);document.getElementById("AntVerticalSizeFeet").value=formatvalue(AntSize*metertofeet,4);document.getElementById("AntVerticalSizeInches").value=formatvalue(AntSize*metertoinch,5)}AntEfficiency=1*document.getElementById("Ant_Efficiency").value}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 initialize(){ReadCookie();currentselectedlocation=new google.maps.LatLng(SiteLat,SiteLon);SatelliteName="";Geosync_radius=42164.57;SetHtmlDefaults();multipleoutagesoutput="";lastprintedoutage="";infowindow=new google.maps.InfoWindow;geocoder=new google.maps.Geocoder;zoom=1*zoom;var e={scrollwheel:true,disableDoubleClickZoom:true,panControl:true,streetViewControl:false,zoom:zoom,center:currentselectedlocation,scaleControl:true,draggable:true,mapTypeId:"terrain"};map=new google.maps.Map(document.getElementById("map_canvas"),e);var t=document.createElement("div");var n={format:google.maps.adsense.AdFormat.BANNER,position:google.maps.ControlPosition.TOP_CENTER,backgroundColor:"grey",borderColor:"black",titleColor:"red",textColor:"black",urlColor:"blue",map:map,visible:true,publisherId:"ca-pub-1045325887862292"};adUnit=new google.maps.adsense.AdUnit(t,n);var r=document.createElement("div");var i={format:google.maps.adsense.AdFormat.BANNER,position:google.maps.ControlPosition.BOTTOM_CENTER,backgroundColor:"#C0BBB7",borderColor:"#C0BBB7",titleColor:"#222222",textColor:"#000000",urlColor:"#222222",map:map,visible:true,publisherId:"ca-pub-1045325887862292"};adUnit2=new google.maps.adsense.AdUnit(r,i);elevator1=new google.maps.ElevationService;map.setCenter(currentselectedlocation);setinfo_on_load_map();outage_beamwidth=calculateantennabeamwidth(Frequency,AntSize,70)}function satlongitudetotext(e){var t;if(e<180)t=formatvalue(e,5)+" E";else t=formatvalue(360-e,5)+" W ("+formatvalue(e,5)+" E)";return t}function convert_coordinates_to_text(e){var t;t="";if(e.lng()<0)t=Math.abs(formatvalue(e.lng(),7))+" W ";else t=Math.abs(formatvalue(e.lng(),7))+"E ";if(e.lat()<0)t=t+Math.abs(formatvalue(e.lat(),7))+" S ";else t=t+Math.abs(formatvalue(e.lat(),7))+" N ";return t}function get_last_part_of_address(e){var t,n,r;var i,s;var o;var u=new Array;var a=new Array;o="";return o}function update_footprint(){var e,t,n,r;if(document.getElementById("singlebeam").checked==true)clearmarkers();else{clearlastdrawn_footprint(arrayofpolygonslength_last_footprint)}AntSize=1*document.getElementById("AntSize").value;AntVertSize=1*document.getElementById("AntVerticalSize").value;Frequency=1*document.getElementById("Frequency").value;e=calculateantennabeamwidth(1*Frequency,1*AntSize,1*AntEfficiency);t=calculateantennabeamwidth(1*Frequency,1*AntVertSize,1*1*AntEfficiency);if(SatLon>180)CurrentSatLon=SatLon-360;else CurrentSatLon=SatLon;r=currentselectedlocation;n=Math.floor(1*document.getElementById("FootprintSkew").value);arrayofpolygonslength_last_footprint=arrayofpolygons.length;if(document.getElementById("masksidelobes").checked==true){strokeopacity=0;footprint_color="black";footprint_opacity_outside_main_lobe=.03;footprint_mainlobe_opacity=.05}else{footprint_opacity_outside_main_lobe=.02;footprint_mainlobe_opacity=.02;footprint_color="red";strokeopacity=1}check_input_antenna_size();wavelength_div_antennaHordiameter=AntSize/(299792458/(1*Frequency*1e3*1e3*1e3));wavelength_div_antennaVerdiameter=AntVertSize/(299792458/(1*Frequency*1e3*1e3*1e3));if(wavelength_div_antennaHordiameter<11||wavelength_div_antennaVerdiameter<11){return}e=find_offaxis_for_gain_reduction(-40,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-40,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var i={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var i=new google.maps.Polygon(i);arrayofpolygons.push(i);i.setMap(map);google.maps.event.addListener(i,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-35,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-35,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var s={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var o=new google.maps.Polygon(s);arrayofpolygons.push(o);o.setMap(map);google.maps.event.addListener(o,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-30,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-30,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var u={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var a=new google.maps.Polygon(u);arrayofpolygons.push(a);a.setMap(map);google.maps.event.addListener(a,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-29,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-29,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var f={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var l=new google.maps.Polygon(f);arrayofpolygons.push(l);l.setMap(map);google.maps.event.addListener(l,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-28,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-28,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var c={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var h=new google.maps.Polygon(c);arrayofpolygons.push(h);h.setMap(map);google.maps.event.addListener(h,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-27,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-27,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var p={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var d=new google.maps.Polygon(p);arrayofpolygons.push(d);d.setMap(map);google.maps.event.addListener(d,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-26,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-26,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var v={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var m=new google.maps.Polygon(v);arrayofpolygons.push(m);m.setMap(map);google.maps.event.addListener(m,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-25,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-25,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var g={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var y=new google.maps.Polygon(g);arrayofpolygons.push(y);y.setMap(map);google.maps.event.addListener(y,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-24,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-24,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var b={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var w=new google.maps.Polygon(b);arrayofpolygons.push(w);w.setMap(map);google.maps.event.addListener(w,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-23,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-23,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var E={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var S=new google.maps.Polygon(E);arrayofpolygons.push(S);S.setMap(map);google.maps.event.addListener(S,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-22,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-22,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var x={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var T=new google.maps.Polygon(x);arrayofpolygons.push(T);T.setMap(map);google.maps.event.addListener(T,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-21,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-21,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var N={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var C=new google.maps.Polygon(N);arrayofpolygons.push(C);C.setMap(map);google.maps.event.addListener(C,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-20,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-20,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var k={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var L=new google.maps.Polygon(k);arrayofpolygons.push(L);L.setMap(map);google.maps.event.addListener(L,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-19,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-19,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var A={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var O=new google.maps.Polygon(A);arrayofpolygons.push(O);O.setMap(map);google.maps.event.addListener(O,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-18,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-18,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var M={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var _=new google.maps.Polygon(M);arrayofpolygons.push(_);_.setMap(map);google.maps.event.addListener(_,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-17,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-17,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var D={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var P=new google.maps.Polygon(D);arrayofpolygons.push(P);P.setMap(map);google.maps.event.addListener(P,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-16,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-16,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var H={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var B=new google.maps.Polygon(H);arrayofpolygons.push(B);B.setMap(map);google.maps.event.addListener(B,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-15,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-15,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var j={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var F=new google.maps.Polygon(j);arrayofpolygons.push(F);F.setMap(map);google.maps.event.addListener(F,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-14,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-14,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var I={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var q=new google.maps.Polygon(I);arrayofpolygons.push(q);q.setMap(map);google.maps.event.addListener(q,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-13,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-13,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var R={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var U=new google.maps.Polygon(R);arrayofpolygons.push(U);U.setMap(map);google.maps.event.addListener(U,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-12,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-12,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var z={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var W=new google.maps.Polygon(z);arrayofpolygons.push(W);W.setMap(map);google.maps.event.addListener(W,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-11,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-11,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var X={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var V=new google.maps.Polygon(X);arrayofpolygons.push(V);V.setMap(map);google.maps.event.addListener(V,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-10,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-10,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var $={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var J=new google.maps.Polygon($);arrayofpolygons.push(J);J.setMap(map);google.maps.event.addListener(J,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-9,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-9,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var K={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var Q=new google.maps.Polygon(K);arrayofpolygons.push(Q);Q.setMap(map);google.maps.event.addListener(Q,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-8,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-8,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var G={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var Y=new google.maps.Polygon(G);arrayofpolygons.push(Y);Y.setMap(map);google.maps.event.addListener(Y,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-7,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-7,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var Z={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var et=new google.maps.Polygon(Z);arrayofpolygons.push(et);et.setMap(map);google.maps.event.addListener(et,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-6,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-6,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var tt={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var nt=new google.maps.Polygon(tt);arrayofpolygons.push(nt);nt.setMap(map);google.maps.event.addListener(nt,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-5,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-5,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var rt={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var it=new google.maps.Polygon(rt);arrayofpolygons.push(it);it.setMap(map);google.maps.event.addListener(it,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-4,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-4,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var st={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var ot=new google.maps.Polygon(st);arrayofpolygons.push(ot);ot.setMap(map);google.maps.event.addListener(ot,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-3,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-3,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var ut={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var at=new google.maps.Polygon(ut);arrayofpolygons.push(at);at.setMap(map);google.maps.event.addListener(at,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-2,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-2,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var ft={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var lt=new google.maps.Polygon(ft);arrayofpolygons.push(lt);lt.setMap(map);google.maps.event.addListener(lt,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-1,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-1,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var ct={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var ht=new google.maps.Polygon(ct);arrayofpolygons.push(ht);ht.setMap(map);google.maps.event.addListener(ht,"click",update_on_click_footprint)}e=find_offaxis_for_gain_reduction(-.5,1*AntSize,1*AntEfficiency);t=find_offaxis_for_gain_reduction(-.5,1*AntVertSize,1*AntEfficiency);if((e0&&e>0){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var pt={html:"Polygon",path:plotarray,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var dt=new google.maps.Polygon(pt);arrayofpolygons.push(dt);dt.setMap(map);google.maps.event.addListener(dt,"click",update_on_click_footprint)}if(document.getElementById("domasksidelobes").checked!=true){e=get_main_lobe_null(1*AntSize,1*AntEfficiency,1*Frequency);t=get_main_lobe_null(1*AntVertSize,1*AntEfficiency,1*Frequency);plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e,r,1*t,1*n);var vt={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var mt=new google.maps.Polygon(vt);arrayofpolygons.push(mt);mt.setMap(map);google.maps.event.addListener(mt,"click",update_on_click_footprint);plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e*2,r,1*t*2,1*n);var gt={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var yt=new google.maps.Polygon(gt);arrayofpolygons.push(yt);yt.setMap(map);google.maps.event.addListener(yt,"click",update_on_click_footprint);plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e*3,r,1*t*3,1*n);var bt={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var wt=new google.maps.Polygon(bt);arrayofpolygons.push(wt);wt.setMap(map);google.maps.event.addListener(wt,"click",update_on_click_footprint);plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e*4,r,1*t*4,1*n);var Et={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var St=new google.maps.Polygon(Et);arrayofpolygons.push(St);St.setMap(map);google.maps.event.addListener(St,"click",update_on_click_footprint);plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e*5,r,1*t*5,1*n);var xt={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var Tt=new google.maps.Polygon(xt);arrayofpolygons.push(Tt);Tt.setMap(map);google.maps.event.addListener(Tt,"click",update_on_click_footprint);plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e*6,r,1*t*6,1*n);var Nt={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var Ct=new google.maps.Polygon(Nt);arrayofpolygons.push(Ct);Ct.setMap(map);google.maps.event.addListener(Ct,"click",update_on_click_footprint);plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*e*7,r,1*t*7,1*n);var kt={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var Lt=new google.maps.Polygon(kt);arrayofpolygons.push(Lt);Lt.setMap(map);google.maps.event.addListener(Lt,"click",update_on_click_footprint)}var At,Ot,Mt;Ot=results[0].elevation;At=Ot*metertofeet;Mt=At*feettoinch}function loadlistners(){google.maps.event.addListener(map,"zoom_changed",function(){SetCookie()});google.maps.event.addListener(map,"click",function(t){var n=[];var r,i,s,o,u,a;var f=new Array;if(document.getElementById("singlebeam").checked==true)clearmarkers();var l=t.latLng;currentselectedlocation=l;SiteLat=currentselectedlocation.lat();SiteLon=currentselectedlocation.lng();SetCookie();reverseGeocode(currentselectedlocation);n.push(l);var c={locations:n};elevator1.getElevationForLocations(c,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;infowindow.setPosition(l);var n=infowindow.getPosition();var o,u;if(n.lng()<0)o="W";else o="E";if(n.lat()<0)u="S";else u="N";AntSize=1*document.getElementById("AntSize").value;AntVertSize=1*document.getElementById("AntVerticalSize").value;Frequency=1*document.getElementById("Frequency").value;r=calculateantennabeamwidth(1*Frequency,1*AntSize,1*AntEfficiency);i=calculateantennabeamwidth(1*Frequency,1*AntVertSize,1*AntEfficiency);if(SatLon>180)s=SatLon-360;else s=SatLon;arrayofpolygonslength_last_footprint=arrayofpolygons.length;a=Math.floor(1*document.getElementById("FootprintSkew").value);if(document.getElementById("masksidelobes").checked==true){strokeopacity=0;footprint_color="black";footprint_opacity_outside_main_lobe=.03;footprint_mainlobe_opacity=.05}else{footprint_opacity_outside_main_lobe=.02;footprint_mainlobe_opacity=.02;footprint_color="red";strokeopacity=1}check_input_antenna_size();wavelength_div_antennaHordiameter=AntSize/(299792458/(1*Frequency*1e3*1e3*1e3));wavelength_div_antennaVerdiameter=AntVertSize/(299792458/(1*Frequency*1e3*1e3*1e3));if(wavelength_div_antennaHordiameter<11||wavelength_div_antennaVerdiameter<11){return}r=find_offaxis_for_gain_reduction(-40,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-40,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var c={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var c=new google.maps.Polygon(c);arrayofpolygons.push(c);c.setMap(map);google.maps.event.addListener(c,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-35,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-35,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var h={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var p=new google.maps.Polygon(h);arrayofpolygons.push(p);p.setMap(map);google.maps.event.addListener(p,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-30,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-30,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var d={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var v=new google.maps.Polygon(d);arrayofpolygons.push(v);v.setMap(map);google.maps.event.addListener(v,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-29,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-29,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var m={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var g=new google.maps.Polygon(m);arrayofpolygons.push(g);g.setMap(map);google.maps.event.addListener(g,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-28,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-28,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var y={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var b=new google.maps.Polygon(y);arrayofpolygons.push(b);b.setMap(map);google.maps.event.addListener(b,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-27,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-27,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var w={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var E=new google.maps.Polygon(w);arrayofpolygons.push(E);E.setMap(map);google.maps.event.addListener(E,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-26,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-26,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var S={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var x=new google.maps.Polygon(S);arrayofpolygons.push(x);x.setMap(map);google.maps.event.addListener(x,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-25,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-25,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var T={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var N=new google.maps.Polygon(T);arrayofpolygons.push(N);N.setMap(map);google.maps.event.addListener(N,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-24,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-24,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var C={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var k=new google.maps.Polygon(C);arrayofpolygons.push(k);k.setMap(map);google.maps.event.addListener(k,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-23,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-23,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var L={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var A=new google.maps.Polygon(L);arrayofpolygons.push(A);A.setMap(map);google.maps.event.addListener(A,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-22,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-22,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var O={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var M=new google.maps.Polygon(O);arrayofpolygons.push(M);M.setMap(map);google.maps.event.addListener(M,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-21,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-21,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var _={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var D=new google.maps.Polygon(_);arrayofpolygons.push(D);D.setMap(map);google.maps.event.addListener(D,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-20,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-20,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var P={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var H=new google.maps.Polygon(P);arrayofpolygons.push(H);H.setMap(map);google.maps.event.addListener(H,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-19,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-19,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var B={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var j=new google.maps.Polygon(B);arrayofpolygons.push(j);j.setMap(map);google.maps.event.addListener(j,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-18,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-18,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var F={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var I=new google.maps.Polygon(F);arrayofpolygons.push(I);I.setMap(map);google.maps.event.addListener(I,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-17,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-17,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var q={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var R=new google.maps.Polygon(q);arrayofpolygons.push(R);R.setMap(map);google.maps.event.addListener(R,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-16,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-16,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var U={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var z=new google.maps.Polygon(U);arrayofpolygons.push(z);z.setMap(map);google.maps.event.addListener(z,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-15,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-15,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var W={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var X=new google.maps.Polygon(W);arrayofpolygons.push(X);X.setMap(map);google.maps.event.addListener(X,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-14,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-14,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var V={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var $=new google.maps.Polygon(V);arrayofpolygons.push($);$.setMap(map);google.maps.event.addListener($,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-13,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-13,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var J={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var K=new google.maps.Polygon(J);arrayofpolygons.push(K);K.setMap(map);google.maps.event.addListener(K,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-12,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-12,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var Q={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var G=new google.maps.Polygon(Q);arrayofpolygons.push(G);G.setMap(map);google.maps.event.addListener(G,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-11,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-11,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var Y={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var Z=new google.maps.Polygon(Y);arrayofpolygons.push(Z);Z.setMap(map);google.maps.event.addListener(Z,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-10,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-10,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var et={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var tt=new google.maps.Polygon(et);arrayofpolygons.push(tt);tt.setMap(map);google.maps.event.addListener(tt,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-9,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-9,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var nt={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var rt=new google.maps.Polygon(nt);arrayofpolygons.push(rt);rt.setMap(map);google.maps.event.addListener(rt,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-8,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-8,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var it={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var st=new google.maps.Polygon(it);arrayofpolygons.push(st);st.setMap(map);google.maps.event.addListener(st,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-7,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-7,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var ot={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var ut=new google.maps.Polygon(ot);arrayofpolygons.push(ut);ut.setMap(map);google.maps.event.addListener(ut,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-6,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-6,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var at={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var ft=new google.maps.Polygon(at);arrayofpolygons.push(ft);ft.setMap(map);google.maps.event.addListener(ft,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-5,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-5,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var lt={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var ct=new google.maps.Polygon(lt);arrayofpolygons.push(ct);ct.setMap(map);google.maps.event.addListener(ct,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-4,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-4,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var ht={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var pt=new google.maps.Polygon(ht);arrayofpolygons.push(pt);pt.setMap(map);google.maps.event.addListener(pt,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-3,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-3,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var dt={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var vt=new google.maps.Polygon(dt);arrayofpolygons.push(vt);vt.setMap(map);google.maps.event.addListener(vt,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-2,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-2,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var mt={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var gt=new google.maps.Polygon(mt);arrayofpolygons.push(gt);gt.setMap(map);google.maps.event.addListener(gt,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-1,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-1,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var yt={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var bt=new google.maps.Polygon(yt);arrayofpolygons.push(bt);bt.setMap(map);google.maps.event.addListener(bt,"click",update_on_click_footprint)}r=find_offaxis_for_gain_reduction(-.5,1*AntSize,1*AntEfficiency);i=find_offaxis_for_gain_reduction(-.5,1*AntVertSize,1*AntEfficiency);if((r0&&r>0){f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var wt={html:"Polygon",path:f,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var Et=new google.maps.Polygon(wt);arrayofpolygons.push(Et);Et.setMap(map);google.maps.event.addListener(Et,"click",update_on_click_footprint)}if(document.getElementById("domasksidelobes").checked!=true){r=get_main_lobe_null(1*AntSize,1*AntEfficiency,1*Frequency);i=get_main_lobe_null(1*AntVertSize,1*AntEfficiency,1*Frequency);f=print_footprint_on_google_map(1*s,1*r,l,1*i,1*a);var St={html:"Polygon",path:f,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var xt=new google.maps.Polygon(St);arrayofpolygons.push(xt);xt.setMap(map);google.maps.event.addListener(xt,"click",update_on_click_footprint);f=print_footprint_on_google_map(1*s,1*r*2,l,1*i*2,1*a);var Tt={html:"Polygon",path:f,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var Nt=new google.maps.Polygon(Tt);arrayofpolygons.push(Nt);Nt.setMap(map);google.maps.event.addListener(Nt,"click",update_on_click_footprint);f=print_footprint_on_google_map(1*s,1*r*3,l,1*i*3,1*a);var Ct={html:"Polygon",path:f,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var kt=new google.maps.Polygon(Ct);arrayofpolygons.push(kt);kt.setMap(map);google.maps.event.addListener(kt,"click",update_on_click_footprint);f=print_footprint_on_google_map(1*s,1*r*4,l,1*i*4,1*a);var Lt={html:"Polygon",path:f,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var At=new google.maps.Polygon(Lt);arrayofpolygons.push(At);At.setMap(map);google.maps.event.addListener(At,"click",update_on_click_footprint);f=print_footprint_on_google_map(1*s,1*r*5,l,1*i*5,1*a);var Ot={html:"Polygon",path:f,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var Mt=new google.maps.Polygon(Ot);arrayofpolygons.push(Mt);Mt.setMap(map);google.maps.event.addListener(Mt,"click",update_on_click_footprint);f=print_footprint_on_google_map(1*s,1*r*6,l,1*i*6,1*a);var _t={html:"Polygon",path:f,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var Dt=new google.maps.Polygon(_t);arrayofpolygons.push(Dt);Dt.setMap(map);google.maps.event.addListener(Dt,"click",update_on_click_footprint);f=print_footprint_on_google_map(1*s,1*r*7,l,1*i*7,1*a);var Pt={html:"Polygon",path:f,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var Ht=new google.maps.Polygon(Pt);arrayofpolygons.push(Ht);Ht.setMap(map);google.maps.event.addListener(Ht,"click",update_on_click_footprint)}map.setCenter(l);var Bt,jt,Ft;jt=e[0].elevation;Bt=jt*metertofeet;Ft=Bt*feettoinch;if(SiteMarker!=null)SiteMarker.setMap(null);PlaceSitemarker(l)}else{alert("No results found")}}else{alert("Elevation service failed due to: "+t)}})})}function update_on_click_footprint(e){var t=[];var n,r,i,s,o,u;var a=new Array;var f=e.latLng;currentselectedlocation=f;SiteLat=currentselectedlocation.lat();SiteLon=currentselectedlocation.lng();SetCookie();reverseGeocode(currentselectedlocation);t.push(f);var l={locations:t};elevator1.getElevationForLocations(l,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;infowindow.setPosition(f);var s=infowindow.getPosition();var o,l;if(s.lng()<0)o="W";else o="E";if(s.lat()<0)l="S";else l="N";AntSize=1*document.getElementById("AntSize").value;AntVertSize=1*document.getElementById("AntVerticalSize").value;Frequency=1*document.getElementById("Frequency").value;n=calculateantennabeamwidth(1*Frequency,1*AntSize,1*AntEfficiency);r=calculateantennabeamwidth(1*Frequency,1*AntVertSize,1*AntEfficiency);if(SatLon>180)i=SatLon-360;else i=SatLon;if(document.getElementById("singlebeam").checked==true)clearmarkers();u=Math.floor(1*document.getElementById("FootprintSkew").value);arrayofpolygonslength_last_footprint=arrayofpolygons.length;if(document.getElementById("masksidelobes").checked==true){strokeopacity=0;footprint_color="black";footprint_opacity_outside_main_lobe=.03;footprint_mainlobe_opacity=.05}else{footprint_opacity_outside_main_lobe=.02;footprint_mainlobe_opacity=.02;footprint_color="red";strokeopacity=1}check_input_antenna_size();wavelength_div_antennaHordiameter=AntSize/(299792458/(1*Frequency*1e3*1e3*1e3));wavelength_div_antennaVerdiameter=AntVertSize/(299792458/(1*Frequency*1e3*1e3*1e3));if(wavelength_div_antennaHordiameter<11||wavelength_div_antennaVerdiameter<11){return}n=find_offaxis_for_gain_reduction(-40,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-40,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var c={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var c=new google.maps.Polygon(c);arrayofpolygons.push(c);c.setMap(map);google.maps.event.addListener(c,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-35,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-35,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var h={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var p=new google.maps.Polygon(h);arrayofpolygons.push(p);p.setMap(map);google.maps.event.addListener(p,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-30,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-30,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var d={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var v=new google.maps.Polygon(d);arrayofpolygons.push(v);v.setMap(map);google.maps.event.addListener(v,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-29,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-29,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var m={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var g=new google.maps.Polygon(m);arrayofpolygons.push(g);g.setMap(map);google.maps.event.addListener(g,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-28,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-28,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var y={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var b=new google.maps.Polygon(y);arrayofpolygons.push(b);b.setMap(map);google.maps.event.addListener(b,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-27,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-27,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var w={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var E=new google.maps.Polygon(w);arrayofpolygons.push(E);E.setMap(map);google.maps.event.addListener(E,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-26,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-26,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var S={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var x=new google.maps.Polygon(S);arrayofpolygons.push(x);x.setMap(map);google.maps.event.addListener(x,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-25,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-25,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var T={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var N=new google.maps.Polygon(T);arrayofpolygons.push(N);N.setMap(map);google.maps.event.addListener(N,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-24,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-24,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var C={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var k=new google.maps.Polygon(C);arrayofpolygons.push(k);k.setMap(map);google.maps.event.addListener(k,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-23,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-23,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var L={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var A=new google.maps.Polygon(L);arrayofpolygons.push(A);A.setMap(map);google.maps.event.addListener(A,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-22,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-22,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var O={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var M=new google.maps.Polygon(O);arrayofpolygons.push(M);M.setMap(map);google.maps.event.addListener(M,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-21,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-21,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var _={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_opacity_outside_main_lobe,geodesic:true};var D=new google.maps.Polygon(_);arrayofpolygons.push(D);D.setMap(map);google.maps.event.addListener(D,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-20,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-20,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var P={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var H=new google.maps.Polygon(P);arrayofpolygons.push(H);H.setMap(map);google.maps.event.addListener(H,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-19,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-19,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var B={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var j=new google.maps.Polygon(B);arrayofpolygons.push(j);j.setMap(map);google.maps.event.addListener(j,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-18,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-18,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var F={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var I=new google.maps.Polygon(F);arrayofpolygons.push(I);I.setMap(map);google.maps.event.addListener(I,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-17,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-17,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var q={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var R=new google.maps.Polygon(q);arrayofpolygons.push(R);R.setMap(map);google.maps.event.addListener(R,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-16,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-16,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var U={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var z=new google.maps.Polygon(U);arrayofpolygons.push(z);z.setMap(map);google.maps.event.addListener(z,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-15,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-15,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var W={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var X=new google.maps.Polygon(W);arrayofpolygons.push(X);X.setMap(map);google.maps.event.addListener(X,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-14,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-14,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var V={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var $=new google.maps.Polygon(V);arrayofpolygons.push($);$.setMap(map);google.maps.event.addListener($,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-13,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-13,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var J={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var K=new google.maps.Polygon(J);arrayofpolygons.push(K);K.setMap(map);google.maps.event.addListener(K,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-12,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-12,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var Q={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var G=new google.maps.Polygon(Q);arrayofpolygons.push(G);G.setMap(map);google.maps.event.addListener(G,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-11,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-11,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var Y={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var Z=new google.maps.Polygon(Y);arrayofpolygons.push(Z);Z.setMap(map);google.maps.event.addListener(Z,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-10,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-10,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var et={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var tt=new google.maps.Polygon(et);arrayofpolygons.push(tt);tt.setMap(map);google.maps.event.addListener(tt,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-9,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-9,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var nt={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var rt=new google.maps.Polygon(nt);arrayofpolygons.push(rt);rt.setMap(map);google.maps.event.addListener(rt,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-8,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-8,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var it={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var st=new google.maps.Polygon(it);arrayofpolygons.push(st);st.setMap(map);google.maps.event.addListener(st,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-7,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-7,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var ot={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var ut=new google.maps.Polygon(ot);arrayofpolygons.push(ut);ut.setMap(map);google.maps.event.addListener(ut,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-6,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-6,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var at={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var ft=new google.maps.Polygon(at);arrayofpolygons.push(ft);ft.setMap(map);google.maps.event.addListener(ft,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-5,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-5,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var lt={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight5dB_div,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var ct=new google.maps.Polygon(lt);arrayofpolygons.push(ct);ct.setMap(map);google.maps.event.addListener(ct,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-4,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-4,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var ht={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var pt=new google.maps.Polygon(ht);arrayofpolygons.push(pt);pt.setMap(map);google.maps.event.addListener(pt,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-3,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-3,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var dt={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var vt=new google.maps.Polygon(dt);arrayofpolygons.push(vt);vt.setMap(map);google.maps.event.addListener(vt,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-2,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-2,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var mt={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var gt=new google.maps.Polygon(mt);arrayofpolygons.push(gt);gt.setMap(map);google.maps.event.addListener(gt,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-1,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-1,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var yt={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var bt=new google.maps.Polygon(yt);arrayofpolygons.push(bt);bt.setMap(map);google.maps.event.addListener(bt,"click",update_on_click_footprint)}n=find_offaxis_for_gain_reduction(-.5,1*AntSize,1*AntEfficiency);r=find_offaxis_for_gain_reduction(-.5,1*AntVertSize,1*AntEfficiency);if((n0&&n>0){a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var wt={html:"Polygon",path:a,strokeColor:line_color,strokeOpacity:strokeopacity,strokeWeight:strokeweight,fillColor:footprint_color,fillOpacity:footprint_mainlobe_opacity,geodesic:true};var Et=new google.maps.Polygon(wt);arrayofpolygons.push(Et);Et.setMap(map);google.maps.event.addListener(Et,"click",update_on_click_footprint)}if(document.getElementById("domasksidelobes").checked!=true){n=get_main_lobe_null(1*AntSize,1*AntEfficiency,1*Frequency);r=get_main_lobe_null(1*AntVertSize,1*AntEfficiency,1*Frequency);a=print_footprint_on_google_map(1*i,1*n,f,1*r,1*u);var St={html:"Polygon",path:a,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var xt=new google.maps.Polygon(St);arrayofpolygons.push(xt);xt.setMap(map);google.maps.event.addListener(xt,"click",update_on_click_footprint);a=print_footprint_on_google_map(1*i,1*n*2,f,1*r*2,1*u);var Tt={html:"Polygon",path:a,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var Nt=new google.maps.Polygon(Tt);arrayofpolygons.push(Nt);Nt.setMap(map);google.maps.event.addListener(Nt,"click",update_on_click_footprint);a=print_footprint_on_google_map(1*i,1*n*3,f,1*r*3,1*u);var Ct={html:"Polygon",path:a,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var kt=new google.maps.Polygon(Ct);arrayofpolygons.push(kt);kt.setMap(map);google.maps.event.addListener(kt,"click",update_on_click_footprint);a=print_footprint_on_google_map(1*i,1*n*4,f,1*r*4,1*u);var Lt={html:"Polygon",path:a,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var At=new google.maps.Polygon(Lt);arrayofpolygons.push(At);At.setMap(map);google.maps.event.addListener(At,"click",update_on_click_footprint);a=print_footprint_on_google_map(1*i,1*n*5,f,1*r*5,1*u);var Ot={html:"Polygon",path:a,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var Mt=new google.maps.Polygon(Ot);arrayofpolygons.push(Mt);Mt.setMap(map);google.maps.event.addListener(Mt,"click",update_on_click_footprint);a=print_footprint_on_google_map(1*i,1*n*6,f,1*r*6,1*u);var _t={html:"Polygon",path:a,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var Dt=new google.maps.Polygon(_t);arrayofpolygons.push(Dt);Dt.setMap(map);google.maps.event.addListener(Dt,"click",update_on_click_footprint);a=print_footprint_on_google_map(1*i,1*n*7,f,1*r*7,1*u);var Pt={html:"Polygon",path:a,strokeColor:"red",strokeOpacity:.3,strokeWeight:10,fillColor:footprint_color,fillOpacity:0,geodesic:true};var Ht=new google.maps.Polygon(Pt);arrayofpolygons.push(Ht);Ht.setMap(map);google.maps.event.addListener(Ht,"click",update_on_click_footprint)}map.setCenter(f);var Bt,jt,Ft;jt=e[0].elevation;Bt=jt*metertofeet;Ft=Bt*feettoinch;if(SiteMarker!=null)SiteMarker.setMap(null);PlaceSitemarker(f)}else{alert("No results found")}}else{alert("Elevation service failed due to: "+t)}})}function setinfo_on_load_map(){var e=[];currentselectedlocation=new google.maps.LatLng(SiteLat,SiteLon);reverseGeocode(currentselectedlocation);e.push(currentselectedlocation);var t={locations:e};elevator1.getElevationForLocations(t,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=e[0].elevation/1e3;infowindow.setPosition(currentselectedlocation);var n=infowindow.getPosition();if(e[0].elevation<0)Height_over_ocean=0;else Height_over_ocean=1*e[0].elevation;var r,i;if(n.lng()<0)r="W";else r="E";if(n.lat()<0)i="S";else i="N";var s,o,u;o=e[0].elevation;s=o*metertofeet;u=s*feettoinch;if(SiteMarker!=null)SiteMarker.setMap(null);PlaceSitemarker(currentselectedlocation);SetCookie()}else{alert("No results found")}}else{alert("Elevation service failed due to: "+t)}})}function open_single_satellite_view(){var e;var t;var n=new Array;t=document.Satellite.Name.value;n=t.split(":");satcatid=n[3];window.open("Catalog/"+satcatid+".htm",satcatid,"")}function SelectSatellite(){var e;var t=new Array;var n=new Date;e=document.Position.SelectList.value;t=e.split(":");SatLon=t[0];SatelliteName=t[4]}function setmapcenter(){var e,t,n,r,i,s,o,u,a,f,l;var c=new Array;var h=new Date;var p=new Array}function getgeolocation(){if(navigator.geolocation){navigator.geolocation.getCurrentPosition(function(e){var t=new google.maps.LatLng(e.coords.latitude,e.coords.longitude);currentselectedlocation=t;reverseGeocode(currentselectedlocation);map.setCenter.pos;map.setCenter(t);zoom=13;map.setZoom(13);SiteLat=currentselectedlocation.lat();SiteLon=currentselectedlocation.lng();setinfo_on_load_map();SetCookie()},function(){handleNoGeolocation(true)})}else{handleNoGeolocation(false)}}function handleNoGeolocation(e){if(e){var t="Error: The Geolocation service failed."}else{var t="Error: Your browser doesn't support geolocation."}}function geocoderequest(){var e=document.getElementById("address").value;geocoder.geocode({address:e,partialmatch:true},geocodeResult)}function geocodeResult(e,t){if(t=="OK"&&e.length>0){map.fitBounds(e[0].geometry.viewport);currentselectedlocation=map.getCenter();reverseGeocode(currentselectedlocation);zoom=13;map.setZoom(13);SiteLat=currentselectedlocation.lat();SiteLon=currentselectedlocation.lng();setinfo_on_load_map();SetCookie()}else{alert("Geocode was not successful for the following reason: "+t)}}function reverseGeocode(e){var t;var n=new Date;geocoder.geocode({latLng:e},reverseGeocodeResult)}function reverseGeocodeResult(e,t){currentReverseGeocodeResponse=e;if(t=="OK"){if(e.length==0){currentAddressResponse="None"}else{currentAddressResponse=e[0].formatted_address}}else{currentAddressResponse="Error"}}function ReadCookie(){var e,t,n,r,i,s,o,u;var a=new Array;var f=new Array;var l,c,h;u=40;s=document.cookie;if(s!==""){a=s.split(":");e=a[0];n=a[1];if(n=="South")SiteLat=-1*e;else SiteLat=1*e;t=a[2];r=a[3];if(r=="West")SiteLon=-1*t;else SiteLon=1*t;if(isNaN(e)||e=="undefined")SiteLat=60.1;if(isNaN(t)||t=="undefined")SiteLon=10.75;currentselectedlocation=new google.maps.LatLng(SiteLat,SiteLon);u=1*a[5];if(isNaN(a[16])||a[16]=="undefined")zoom=2;else zoom=1*a[16]}else{o=0;SiteLat=60.1;SiteLon=10.75;zoom=2}document.Position.SelectList.selectedIndex=u}function ShowCookie(){var e,t,n,r,i,s,o,u;var a=new Array;var f=new Array;var l,c,h,p;u=40;s=document.cookie;if(s!==""){a=s.split(":");p="COOKIE CONTENT:";p=p+"\nSite Latitude:"+a[0]+" "+a[1];p=p+"\r\nSite Latitude:"+a[2]+" "+a[3];p=p+"\r\nSite Position List Index:"+a[4];p=p+"\r\nSat Position List Index:"+a[5];p=p+"\r\nSet Location:"+a[6];p=p+"\r\nCalibrate pulsevalue:"+a[7];p=p+"\r\nCalibrate puls per HA degree:"+a[8];p=p+"\r\nPulse counter increasing in direction:"+a[9];p=p+"\r\nHourangle for calibrated position:"+a[10];p=p+"\r\nHight above ocean:"+a[11];p=p+"\r\nAntenna Size:"+1*a[12];p=p+"\r\nRx Frequency:"+1*a[13];p=p+"\r\nCookie14:"+a[14];p=p+"\r\nSite name:"+a[15];p=p+"\r\nGoogle Map Zoom:"+a[16];p=p+"\r\nAntenna hight above ground:"+1*a[17];p=p+"\r\nCookie18:"+a[18];p=p+"\r\nCookie19:"+a[19];p=p+"\r\nCookie20:"+a[19];alert(p)}else alert("Cookie is empty")}function get_timezone_offset_text(){var e=new Date;var t,n;n=String(String(e).split("(")[1]).split(")")[0];if(e.getTimezoneOffset()<0)t="UTC+"+ -1*Math.floor(e.getTimezoneOffset()/60)+"h";else if(e.getTimezoneOffset()==0)t="UTC";else t="UTC"+ -1*Math.floor(e.getTimezoneOffset()/60)+"h";if(n!="undefined")t=t+" ["+n+"]";return t}function get_timezone(){var e=new Date;var t,n;n=String(String(e).split("(")[1]).split(")")[0];if(e.getTimezoneOffset()<0)t="UTC+"+ -1*Math.floor(e.getTimezoneOffset()/60)+"h";else if(e.getTimezoneOffset()==0)t="UTC";else t="UTC"+ -1*Math.floor(e.getTimezoneOffset()/60)+"h";return t}function get_timezone_offset_value(){var e=new Date;var t;t=-1*e.getTimezoneOffset()/60;return t}function formatLocalTime(e){var t;var n=new Date;var r,i,s;n=e+get_timezone_offset_value()/24;r=n.getHours();alert(r);t=r+":"+i+":"+s;return t}function calculatebeamwidth(e,t,n,r){var i,s,o,u,a;s=3e8;u=Math.PI;o=s/(e*1e3*1e3*1e3);i=11/e/t+.25;if(i*i-r*r>0)a=Math.sqrt(i*i-r*r);else a="No outage angle, no possible outage";return a}function calculateantennabeamwidth(e,t,n){var r,i,s,o,u;i=3e8;o=Math.PI;s=i/(e*1e3*1e3*1e3);r=11/e/t;return r}function formatvalue(e,t){var n="**************************";var r,i;var s="999999999999999999999999";var o=""+e;var u=parseFloat(o);if(o.length<=t)return o;if(o.indexOf("e")!=-1||u>parseFloat(s.substring(0,t)+".4"))return n.substring(0,t);var a=""+(u+(u-parseFloat(o.substring(0,t))));r=a.substring(0,t);return r}function Div(e,t){return(e-e%t)/t}function Rev(e){var t;t=e-Math.floor(e/360)*360;return t}function Radians(e){var t;t=e*Math.PI/180;return t}function Deg(e){var t;t=e*180/Math.PI;return t}function log10(e){return Math.log(e)/Math.log(10)}function trim(e){return e.replace(/^\s+|\s+$/g,"")}function ltrim(e){return e.replace(/^\s+/,"")}function rtrim(e){return e.replace(/\s+$/,"")}var zoom;var elevator1;var infowindow;var SiteLon,SiteLat,SatLon,Height_over_ocean,AntSize,Frequency,Geosync_radius,Day,Month,Year;var season,SatelliteName,SatNameCurrentIndex;var currentAddressResponse;var map;var currentselectedlocation=new google.maps.LatLng(60.19,10.81);var geocoder,multipleoutagesoutput,lastprintedoutage,marker,autointerval,polygon1,outage_beamwidth;var coverage_polygon1,polygon_for_alt_plot,testpolygon;var coveragemarkers,Nan1markers,NaN2markers,GlobalNaN1markers,GlobalNaN2markers;var selection_polygon,extracted_footprint_polygon,coveragearray_for_alternative_footprint_plot;var polygon_max_min_lat_for_outage,polyline_peaklat;var inchtometer,feettometer,metertoinch,metertofeet,inchtofeet,feettoinch,SiteMarker,AntVertSize;var arrayofpolygons=new Array;var polygonindex,oppolygon1,oppolygon2,oppolygon3,oppolygon4,oppolygon5,oppolygon6,oppolygon7,oppolygon8;var arrayofpolygonslength_last_footprint,footprint_3dBopacity,footprint_mainlobe_opacity,max_half_power_beam_width;var strokeopacity,strokeweight,footprint_color,line_color,strokeweight5dB_div,wavelength_div_antennaHordiameter,wavelength_div_antennaVerdiameter;var footprint_opacity_outside_main_lobe,AntEfficiency;strokeopacity=1;strokeweight5dB_div=1.2;strokeweight=.5;footprint_color="black";line_color="black";footprint_opacity_outside_main_lobe=.04;footprint_mainlobe_opacity=.04;var footprint_array=[];var globalcoveragearray=[];polygonindex=0;footprint_3dBopacity=.02;max_half_power_beam_width=8.683333333333334;inchtometer=.0254;inctofeet=1/12;feettometer=inchtometer*12;metertoinch=1/inchtometer;metertofeet=metertoinch/12;feettoinch=1*12;SatelliteName="";multipleoutagesoutput="";lastprintedoutage=""