function deleteAllCookies(){var a=document.cookie.split(";");for(var b=0;b-1?c.substr(0,d):c;document.cookie=e+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"}}function difference(a,b){if(a>b)return Math.abs(a-b);else return Math.abs(b-a)}function angulardifference(a,b){var c;if(a>=180)a=a-360;if(b>=180)b=b-360;if(a<-180)a=360-a;if(b<-180)b=360-b;if(b>a)c=b-a;if(b<=a)c=-(a-b);if(c>180)c=c-360;if(c<-180)c=180-c;return c}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_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 a;a=1*document.getElementById("AntVerticalSizeFeet").value;AntVertSize=a*feettometer;document.getElementById("AntVerticalSize").value=formatvalue(AntVertSize,4);document.getElementById("AntVerticalSizeInches").value=formatvalue(a*feettoinch,5);SetCookie()}function onchange_antenna_size_feet(){var a;a=1*document.getElementById("AntSizeFeet").value;AntSize=a*feettometer;document.getElementById("AntSize").value=formatvalue(AntSize,4);document.getElementById("AntSizeInches").value=formatvalue(a*feettoinch,5);document.getElementById("AntVerticalSize").value=formatvalue(AntSize,4);document.getElementById("AntVerticalSizeFeet").value=formatvalue(a*feettoinch,5);document.getElementById("AntVerticalSizeInches").value=formatvalue(a*feettoinch,5);SetCookie()}function onchange_antenna_vertical_size_inches(){var a;a=1*document.getElementById("AntVerticalSizeInches").value;AntVertSize=a*inchtometer;document.getElementById("AntVerticalSize").value=formatvalue(AntVertSize,4);document.getElementById("AntVerticalSizeFeet").value=formatvalue(a*inctofeet,5);SetCookie()}function onchange_antenna_size_inches(){var a;a=1*document.getElementById("AntSizeInches").value;AntSize=a*inchtometer;document.getElementById("AntSize").value=formatvalue(AntSize,4);document.getElementById("AntSizeFeet").value=formatvalue(a*inctofeet,5);document.getElementById("AntVerticalSize").value=formatvalue(AntSize,4);document.getElementById("AntVerticalSizeFeet").value=formatvalue(a*inctofeet,5);document.getElementById("AntVerticalSizeInches").value=formatvalue(a,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(a,b,c,d,e,f,g,h){var i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;var z=new Array;var A;u=1;w=1/Math.tan(Radians(e))*(1/Math.tan(Radians(e)))*Math.cos(Radians(h+d))*Math.cos(Radians(h+d));x=1/Math.tan(Radians(g))*(1/Math.tan(Radians(g)))*Math.sin(Radians(h+d))*Math.sin(Radians(h+d));v=w+x;A=Rev(Deg(Math.atan2(u,Math.sqrt(v))));if(g!=0){e=A}l=angulardifference(b,c);k=l;document.getElementById("SunInt_misc").innerHTML="Lon_SB: "+k;j=Deg(Math.acos(Math.cos(Radians(a))*Math.cos(Radians(k))));j=Rev(j);i=Deg(Math.atan2(Math.sin(Radians(j)),6.6235-Math.cos(Radians(j))));if(f!="NA"){i=f*1}m=Deg(Math.acos(Math.cos(Radians(i))*Math.cos(Radians(e))+Math.sin(Radians(i))*Math.sin(Radians(e))*Math.cos(Radians(d))));u=Math.sin(Radians(d));v=Math.sin(Radians(i))*Math.cos(Radians(e))/Math.sin(Radians(e));v=v-Math.cos(Radians(i))*Math.cos(Radians(d));n=Deg(Math.atan2(u,v));o=Deg(Math.atan2(Math.sin(Radians(k)),Math.tan(Radians(a))))+n;p=Deg(Math.asin(6.6235*Math.sin(Radians(m))))-m;q=Deg(Math.asin(Math.sin(Radians(p))*Math.cos(Radians(o))));r=Deg(Math.atan2(Math.tan(Radians(p))*Math.sin(Radians(o)),1));t=c-r;y=q;if(t<0)t=t+360;s=new google.maps.LatLng(y,t);return s}function PlaceCoveragemarkers(a){var b="http://maps.google.com/mapfiles/marker_whiteA.png";coveragemarkers=new google.maps.Marker({position:a,map:map,icon:b});var c="Coverage Marker
"}function PlaceNan1markers(a){var b="http://maps.google.com/mapfiles/marker_purpleA.png";Nan1markers=new google.maps.Marker({position:a,map:map,icon:b});var c="NaN1 start
"}function PlaceNaN2markers(a){var b="http://maps.google.com/mapfiles/marker_yellowA.png";NaN2markers=new google.maps.Marker({position:a,map:map,icon:b});var c="NaN2 stop
"}function PlaceGlobalNaN1markers(a){var b="http://maps.google.com/mapfiles/dd-start.png";GlobalNaN1markers=new google.maps.Marker({position:a,map:map,icon:b});var c="GobalNaN1 Start
"}function PlaceGlobalNaN2markers(a){var b="http://maps.google.com/mapfiles/dd-end.png";GlobalNaN2markers=new google.maps.Marker({position:a,map:map,icon:b});var c="GobalNaN2 Stop
"}function PlaceSitemarker(a){var b="http://www.birdtheme.org/useful/images/square.png";SiteMarker=new google.maps.Marker({position:a,map:map,icon:b});var c="SiteMarker
"}function clearmarkers(){if(polygon1!=null)polygon1.setMap(null);for(i=0;i180)e=SatLon-360;else e=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(c=0;c<36001;c++){d=(c+a)%36001;d=c/100;f=draw_footprint(0,e,e,d,8.683333333333334,"NA",0,0);if(!isNaN(f.lng())&&!isNaN(f.lat()))b.push(f)}var g={path:b,strokeColor:"green",strokeOpacity:1,strokeWeight:2};globalcoveragearray=b;coverage_polygon1=new google.maps.Polyline(g);coverage_polygon1.setMap(map)}function print_footprint_on_google_map(a,b,c,d,e){var f,g,h,i;var j,k,l,m,n,o,p,q,r;var s=[];var t=[];var u=[];var v=[];var w=[];var x,y,z,A,B,C,D,E;var F,G,H,I,J,K;var L=new Array;var M;var N,O,P,Q,R,S,T,U,V,W,X;var Y=new Date;var Z=new Array;var $=[];var _=new Array;i=0;x=SatLon;V=c.lat();if(c.lng()<0)W=360+c.lng();else W=c.lng();X=Math.floor(e);if(1==1){for(j=0;j<361;j++){l=j;o=draw_footprint(V,W,a,l,b,"NA",d,X);k=new google.maps.LatLng(o.lat(),o.lng());t[j]=k;if(!isNaN(k.lng())&&!isNaN(k.lat()))s.push(k);else{}}var ab=new Array;var bb=[];var cb,db,eb,fb,gb;var hb=new google.maps.LatLng;j=t.length-1;hb=t[j];while(j>-1&&eb!=1){if(isNaN(hb.lng())||isNaN(hb.lat())){cb=j+1;eb=1}j=j-1;hb=t[j]}j=0;hb=t[j];var ib;while(jH)kb=0;H=I;gb=I;for(j=1;jkb)lb=36001-jb+kb;else if(jb180)W=W-360;if(W<-180)W=W+360;p=new google.maps.LatLng(V,W);if(marker!=null)marker.setMap(null);{placeMarker(p)}var mb={html:"Polygon",path:u,strokeColor:"blue",strokeOpacity:1,strokeWeight:1,fillColor:"#0000FF",fillOpacity:.2};var nb={path:w,strokeColor:"red",strokeOpacity:1,strokeWeight:2,fillColor:"#0000FF",fillOpacity:.2};var ob={path:v,strokeColor:"red",strokeOpacity:1,strokeWeight:3};selection_polygon=new google.maps.Polyline(ob);selection_polygon.setMap(map)}else{}return u}function placeMarker(a){marker=new google.maps.Marker({position:a,map:map})}function DegEastFormat(a){var b;if(a<0)b=360+a;else b=a;return b}function start_moving_marker_on_map(){clearInterval(autointerval);loadfootprint();autointerval=setInterval("loadfootprint()",3e4)}function loadfootprint(){var a;if(polygon1!=null)polygon1.setMap(null);if(selection_polygon!=null)selection_polygon.setMap(null);if(extracted_footprint_polygon!=null)extracted_footprint_polygon.setMap(null);a=SatLon;outage_beamwidth=calculateantennabeamwidth(1*Frequency,1*AntSize,70)}function SetHtmlDefaults(){var a,b;b=new Date;Year=b.getUTCFullYear();Month=b.getUTCMonth()+1;document.getElementById("ku-band").checked=true;document.getElementById("AntSize").value=.72;document.getElementById("AntVerticalSize").value=.72;document.getElementById("Frequency").value=10.95;a=document.cookie;if(a==null){document.getElementById("ku-band").checked=1;Frequency=11.95}else{var c=new Array;c=a.split(":");if(c[14]=="C")document.getElementById("c-band").checked=true;else if(c[14]=="ku")document.getElementById("ku-band").checked=true;else if(c[14]=="userband")document.getElementById("user-band").checked=true;else document.getElementById("ku-band").checked=true;if(!isNaN(c[12])&&c[12]!="undefined"&&c[12]!=""){document.getElementById("AntSize").value=1*c[12];document.getElementById("AntVerticalSize").value=1*c[12];AntSize=1*c[12];AntVertSize=AntSize}else{AntSize=.6;document.getElementById("AntSize").value=.6;document.getElementById("AntVerticalSize").value=.6}if(!isNaN(c[13])&&c[13]!="undefined"&&c[13]!=""){Frequency=1*c[13];document.getElementById("Frequency").value=1*1*c[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)}}function SetCookie(){var a,b,c,d,e;var f,g;var h,i,j,k;var l,m,n,o,p,q,r,s,t,u;var v,w,x,y,z,A,m,n,o;var B=new Array;var C=new Array;MyCookieVal=document.cookie;if(MyCookieVal!==""){B=MyCookieVal.split(":");v=B[4];w=B[6];x=B[7];y=B[8];z=B[9];A=B[10];m=B[12];n=B[13];o=B[14];p=B[15];r=B[17];s=B[18];t=B[19];u=B[20]}if(MyCookieVal==""){v="undefined";w="undefined";x="undefined";y="undefined";z="undefined";A="undefined";m="undefined";n="undefined";o="undefined";p="undefined";r="undefined";s="undefined";t="undefined";u="undefined"}if(SiteLat<0){c="South";a=-SiteLat}else{c="North";a=SiteLat}if(SiteLon>0){d="East";b=SiteLon}else{d="West";b=-SiteLon}g=document.Position.SelectList.selectedIndex;HightAboveOcean=1*Height_over_ocean;q=map.getZoom();if(currentAddressResponse!="")p=currentAddressResponse;m=1*document.getElementById("AntSize").value;n=1*document.getElementById("Frequency").value;if(document.getElementById("c-band").checked==true)o="C";else if(document.getElementById("ku-band").checked==true)o="ku";else if(document.getElementById("user-band").checked==true)o="userband";else document.getElementById("ku-band").checked=true;e=a+":"+c+":"+b+":"+d+":"+v+":"+g+":"+w+":"+x+":"+y+":"+z+":"+A+":"+HightAboveOcean+":"+m+":"+n+":"+o+":"+p+":"+q+":"+r+":"+t+":"+u+";expires=Tue, 10 Jul 2040 23:59:59 UTC;";deleteAllCookies();document.cookie=e}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 a={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"),a);var b=document.createElement("div");var c={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(b,c);var d=document.createElement("div");var e={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(d,e);elevator1=new google.maps.ElevationService;map.setCenter(currentselectedlocation);setinfo_on_load_map();outage_beamwidth=calculateantennabeamwidth(Frequency,AntSize,70)}function satlongitudetotext(a){var b;if(a<180)b=formatvalue(a,5)+" E";else b=formatvalue(360-a,5)+" W ("+formatvalue(a,5)+" E)";return b}function convert_coordinates_to_text(a){var b;b="";if(a.lng()<0)b=Math.abs(formatvalue(a.lng(),7))+" W ";else b=Math.abs(formatvalue(a.lng(),7))+"E ";if(a.lat()<0)b=b+Math.abs(formatvalue(a.lat(),7))+" S ";else b=b+Math.abs(formatvalue(a.lat(),7))+" N ";return b}function get_last_part_of_address(a){var b,c,d;var e,f;var g;var h=new Array;var i=new Array;g="";return g}function update_footprint(){var a,b,c,d;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;a=calculateantennabeamwidth(1*Frequency,1*AntSize,70);b=calculateantennabeamwidth(1*Frequency,1*AntVertSize,70);if(SatLon>180)CurrentSatLon=SatLon-360;else CurrentSatLon=SatLon;d=currentselectedlocation;c=Math.floor(1*document.getElementById("FootprintSkew").value);arrayofpolygonslength_last_footprint=arrayofpolygons.length;plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*a,d,1*b,1*c);var e={html:"Polygon",path:plotarray,strokeColor:"blue",strokeOpacity:0,strokeWeight:2,fillColor:"red",fillOpacity:footprint_3dBopacity};if(oppolygon1!=null)google.maps.event.clearListeners(oppolygon1,"click");oppolygon1=new google.maps.Polygon(e);arrayofpolygons.push(oppolygon1);oppolygon1.setMap(map);google.maps.event.addListener(oppolygon1,"click",update_on_click_footprint);plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*a*2,d,2*b,1*c);var f={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:0,strokeWeight:1,fillColor:"red",fillOpacity:footprint_mainlobe_opacity};if(oppolygon2!=null)google.maps.event.clearListeners(oppolygon2,"click");oppolygon2=new google.maps.Polygon(f);arrayofpolygons.push(oppolygon2);oppolygon2.setMap(map);google.maps.event.addListener(oppolygon2,"click",update_on_click_footprint);if(document.getElementById("masksidelobes").checked==true){plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*a*4,d,4*b,1*c);var g={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};if(oppolygon3!=null)google.maps.event.clearListeners(oppolygon3,"click");oppolygon3=new google.maps.Polygon(g);arrayofpolygons.push(oppolygon3);oppolygon3.setMap(map);google.maps.event.addListener(oppolygon3,"click",update_on_click_footprint);plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*a*8,d,8*b,1*c);var h={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};if(oppolygon4!=null)google.maps.event.clearListeners(oppolygon4,"click");oppolygon4=new google.maps.Polygon(h);arrayofpolygons.push(oppolygon4);oppolygon4.setMap(map);google.maps.event.addListener(oppolygon4,"click",update_on_click_footprint);plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*a*16,d,16*b,1*c);var i={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};if(oppolygon5!=null)google.maps.event.clearListeners(oppolygon5,"click");oppolygon5=new google.maps.Polygon(i);arrayofpolygons.push(oppolygon5);oppolygon5.setMap(map);google.maps.event.addListener(oppolygon5,"click",update_on_click_footprint);plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*a*32,d,32*b,1*c);var j={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};if(oppolygon6!=null)google.maps.event.clearListeners(oppolygon6,"click");oppolygon6=new google.maps.Polygon(j);arrayofpolygons.push(oppolygon6);oppolygon6.setMap(map);google.maps.event.addListener(oppolygon6,"click",update_on_click_footprint);plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*a*64,d,64*b,1*c);var k={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};if(oppolygon7!=null)google.maps.event.clearListeners(oppolygon7,"click");oppolygon7=new google.maps.Polygon(k);arrayofpolygons.push(oppolygon7);oppolygon7.setMap(map);google.maps.event.addListener(oppolygon7,"click",update_on_click_footprint);plotarray=print_footprint_on_google_map(1*CurrentSatLon,1*a*128,d,128*b,1*c);var l={html:"Polygon",path:plotarray,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};if(oppolygon8!=null)google.maps.event.clearListeners(oppolygon8,"click");oppolygon8=new google.maps.Polygon(l);arrayofpolygons.push(oppolygon8);oppolygon8.setMap(map);google.maps.event.addListener(oppolygon8,"click",update_on_click_footprint)}var m,n,o;n=results[0].elevation;m=n*metertofeet;o=m*feettoinch}function loadlistners(){google.maps.event.addListener(map,"zoom_changed",function(){SetCookie()});google.maps.event.addListener(map,"click",function(b){var c=[];var d,e,f,g,h,i;var j=new Array;if(document.getElementById("singlebeam").checked==true)clearmarkers();var k=b.latLng;currentselectedlocation=k;SiteLat=currentselectedlocation.lat();SiteLon=currentselectedlocation.lng();SetCookie();reverseGeocode(currentselectedlocation);c.push(k);var l={locations:c};elevator1.getElevationForLocations(l,function(a,b){if(b==google.maps.ElevationStatus.OK){if(a[0]){if(a[0].elevation<0)Height_over_ocean=0;else Height_over_ocean=1*a[0].elevation/1e3;infowindow.setPosition(k);var c=infowindow.getPosition();var g,h;if(c.lng()<0)g="W";else g="E";if(c.lat()<0)h="S";else h="N";AntSize=1*document.getElementById("AntSize").value;AntVertSize=1*document.getElementById("AntVerticalSize").value;Frequency=1*document.getElementById("Frequency").value;d=calculateantennabeamwidth(1*Frequency,1*AntSize,70);e=calculateantennabeamwidth(1*Frequency,1*AntVertSize,70);if(SatLon>180)f=SatLon-360;else f=SatLon;arrayofpolygonslength_last_footprint=arrayofpolygons.length;i=Math.floor(1*document.getElementById("FootprintSkew").value);j=print_footprint_on_google_map(1*f,1*d,k,1*e,1*i);var l={html:"Polygon",path:j,strokeColor:"blue",strokeOpacity:0,strokeWeight:2,fillColor:"red",fillOpacity:footprint_3dBopacity};oppolygon1=new google.maps.Polygon(l);arrayofpolygons.push(oppolygon1);oppolygon1.setMap(map);google.maps.event.addListener(oppolygon1,"click",update_on_click_footprint);j=print_footprint_on_google_map(1*f,1*d*2,k,2*e,1*i);var m={html:"Polygon",path:j,strokeColor:"red",strokeOpacity:0,strokeWeight:1,fillColor:"red",fillOpacity:footprint_mainlobe_opacity};oppolygon2=new google.maps.Polygon(m);arrayofpolygons.push(oppolygon2);oppolygon2.setMap(map);google.maps.event.addListener(oppolygon2,"click",update_on_click_footprint);if(document.getElementById("masksidelobes").checked==true){j=print_footprint_on_google_map(1*f,1*d*4,k,4*e,1*i);var n={html:"Polygon",path:j,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};oppolygon3=new google.maps.Polygon(n);arrayofpolygons.push(oppolygon3);oppolygon3.setMap(map);google.maps.event.addListener(oppolygon3,"click",update_on_click_footprint);j=print_footprint_on_google_map(1*f,1*d*8,k,8*e,1*i);var o={html:"Polygon",path:j,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};oppolygon4=new google.maps.Polygon(o);arrayofpolygons.push(oppolygon4);oppolygon4.setMap(map);google.maps.event.addListener(oppolygon4,"click",update_on_click_footprint);j=print_footprint_on_google_map(1*f,1*d*16,k,16*e,1*i);var p={html:"Polygon",path:j,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};oppolygon5=new google.maps.Polygon(p);arrayofpolygons.push(oppolygon5);oppolygon5.setMap(map);google.maps.event.addListener(oppolygon5,"click",update_on_click_footprint);j=print_footprint_on_google_map(1*f,1*d*32,k,32*e,1*i);var q={html:"Polygon",path:j,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};oppolygon6=new google.maps.Polygon(q);arrayofpolygons.push(oppolygon6);oppolygon6.setMap(map);google.maps.event.addListener(oppolygon6,"click",update_on_click_footprint);j=print_footprint_on_google_map(1*f,1*d*64,k,64*e,1*i);var r={html:"Polygon",path:j,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};oppolygon7=new google.maps.Polygon(r);arrayofpolygons.push(oppolygon7);oppolygon7.setMap(map);google.maps.event.addListener(oppolygon7,"click",update_on_click_footprint);j=print_footprint_on_google_map(1*f,1*d*128,k,128*e,1*i);var s={html:"Polygon",path:j,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};oppolygon8=new google.maps.Polygon(s);arrayofpolygons.push(oppolygon8);oppolygon8.setMap(map);google.maps.event.addListener(oppolygon8,"click",update_on_click_footprint)}map.setCenter(k);var t,u,v;u=a[0].elevation;t=u*metertofeet;v=t*feettoinch;if(SiteMarker!=null)SiteMarker.setMap(null);PlaceSitemarker(k)}else{alert("No results found")}}else{alert("Elevation service failed due to: "+b)}})})}function update_on_click_footprint(a){var b=[];var c,d,e,f,g,h;var i=new Array;var j=a.latLng;currentselectedlocation=j;SiteLat=currentselectedlocation.lat();SiteLon=currentselectedlocation.lng();SetCookie();reverseGeocode(currentselectedlocation);b.push(j);var k={locations:b};elevator1.getElevationForLocations(k,function(a,b){if(b==google.maps.ElevationStatus.OK){if(a[0]){if(a[0].elevation<0)Height_over_ocean=0;else Height_over_ocean=1*a[0].elevation/1e3;infowindow.setPosition(j);var f=infowindow.getPosition();var g,k;if(f.lng()<0)g="W";else g="E";if(f.lat()<0)k="S";else k="N";AntSize=1*document.getElementById("AntSize").value;AntVertSize=1*document.getElementById("AntVerticalSize").value;Frequency=1*document.getElementById("Frequency").value;c=calculateantennabeamwidth(1*Frequency,1*AntSize,70);d=calculateantennabeamwidth(1*Frequency,1*AntVertSize,70);if(SatLon>180)e=SatLon-360;else e=SatLon;if(document.getElementById("singlebeam").checked==true)clearmarkers();h=Math.floor(1*document.getElementById("FootprintSkew").value);arrayofpolygonslength_last_footprint=arrayofpolygons.length;i=print_footprint_on_google_map(1*e,1*c,j,1*d,1*h);var l={html:"Polygon",path:i,strokeColor:"blue",strokeOpacity:0,strokeWeight:2,fillColor:"red",fillOpacity:footprint_3dBopacity};oppolygon1=new google.maps.Polygon(l);arrayofpolygons.push(oppolygon1);oppolygon1.setMap(map);google.maps.event.addListener(oppolygon1,"click",update_on_click_footprint);i=print_footprint_on_google_map(1*e,1*c*2,j,2*d,1*h);var m={html:"Polygon",path:i,strokeColor:"red",strokeOpacity:0,strokeWeight:1,fillColor:"red",fillOpacity:footprint_mainlobe_opacity};oppolygon2=new google.maps.Polygon(m);arrayofpolygons.push(oppolygon2);oppolygon2.setMap(map);google.maps.event.addListener(oppolygon2,"click",update_on_click_footprint);if(document.getElementById("masksidelobes").checked==true){i=print_footprint_on_google_map(1*e,1*c*4,j,4*d,1*h);var n={html:"Polygon",path:i,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};oppolygon3=new google.maps.Polygon(n);arrayofpolygons.push(oppolygon3);oppolygon3.setMap(map);google.maps.event.addListener(oppolygon3,"click",update_on_click_footprint);i=print_footprint_on_google_map(1*e,1*c*8,j,8*d,1*h);var o={html:"Polygon",path:i,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};oppolygon4=new google.maps.Polygon(o);arrayofpolygons.push(oppolygon4);oppolygon4.setMap(map);google.maps.event.addListener(oppolygon4,"click",update_on_click_footprint);i=print_footprint_on_google_map(1*e,1*c*16,j,16*d,1*h);var p={html:"Polygon",path:i,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};oppolygon5=new google.maps.Polygon(p);arrayofpolygons.push(oppolygon5);oppolygon5.setMap(map);google.maps.event.addListener(oppolygon5,"click",update_on_click_footprint);i=print_footprint_on_google_map(1*e,1*c*32,j,32*d,1*h);var q={html:"Polygon",path:i,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};oppolygon6=new google.maps.Polygon(q);arrayofpolygons.push(oppolygon6);oppolygon6.setMap(map);google.maps.event.addListener(oppolygon6,"click",update_on_click_footprint);i=print_footprint_on_google_map(1*e,1*c*64,j,64*d,1*h);var r={html:"Polygon",path:i,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};oppolygon7=new google.maps.Polygon(r);arrayofpolygons.push(oppolygon7);oppolygon7.setMap(map);google.maps.event.addListener(oppolygon7,"click",update_on_click_footprint);i=print_footprint_on_google_map(1*e,1*c*128,j,128*d,1*h);var s={html:"Polygon",path:i,strokeColor:"red",strokeOpacity:1,strokeWeight:1,fillColor:"red",fillOpacity:0};oppolygon8=new google.maps.Polygon(s);arrayofpolygons.push(oppolygon8);oppolygon8.setMap(map);google.maps.event.addListener(oppolygon8,"click",update_on_click_footprint)}map.setCenter(j);var t,u,v;u=a[0].elevation;t=u*metertofeet;v=t*feettoinch;if(SiteMarker!=null)SiteMarker.setMap(null);PlaceSitemarker(j)}else{alert("No results found")}}else{alert("Elevation service failed due to: "+b)}})}function setinfo_on_load_map(){var a=[];currentselectedlocation=new google.maps.LatLng(SiteLat,SiteLon);reverseGeocode(currentselectedlocation);a.push(currentselectedlocation);var b={locations:a};elevator1.getElevationForLocations(b,function(a,b){if(b==google.maps.ElevationStatus.OK){if(a[0]){if(a[0].elevation<0)Height_over_ocean=0;else Height_over_ocean=a[0].elevation/1e3;infowindow.setPosition(currentselectedlocation);var c=infowindow.getPosition();if(a[0].elevation<0)Height_over_ocean=0;else Height_over_ocean=1*a[0].elevation;var d,e;if(c.lng()<0)d="W";else d="E";if(c.lat()<0)e="S";else e="N";var f,g,h;g=a[0].elevation;f=g*metertofeet;h=f*feettoinch;if(SiteMarker!=null)SiteMarker.setMap(null);PlaceSitemarker(currentselectedlocation);SetCookie()}else{alert("No results found")}}else{alert("Elevation service failed due to: "+b)}})}function open_single_satellite_view(){var a;var b;var c=new Array;b=document.Satellite.Name.value;c=b.split(":");satcatid=c[3];window.open("Catalog/"+satcatid+".htm",satcatid,"")}function SelectSatellite(){var a;var b=new Array;var c=new Date;a=document.Position.SelectList.value;b=a.split(":");SatLon=b[0];SatelliteName=b[4]}function setmapcenter(){var a,b,c,d,e,f,g,h,i,j,k;var l=new Array;var m=new Date;var n=new Array}function getgeolocation(){if(navigator.geolocation){navigator.geolocation.getCurrentPosition(function(a){var b=new google.maps.LatLng(a.coords.latitude,a.coords.longitude);currentselectedlocation=b;reverseGeocode(currentselectedlocation);map.setCenter.pos;map.setCenter(b);zoom=13;map.setZoom(13);SiteLat=currentselectedlocation.lat();SiteLon=currentselectedlocation.lng();setinfo_on_load_map();SetCookie()},function(){handleNoGeolocation(true)})}else{handleNoGeolocation(false)}}function handleNoGeolocation(a){if(a){var b="Error: The Geolocation service failed."}else{var b="Error: Your browser doesn't support geolocation."}}function geocoderequest(){var a=document.getElementById("address").value;geocoder.geocode({address:a,partialmatch:true},geocodeResult)}function geocodeResult(a,b){if(b=="OK"&&a.length>0){map.fitBounds(a[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: "+b)}}function reverseGeocode(a){var b;var c=new Date;geocoder.geocode({latLng:a},reverseGeocodeResult)}function reverseGeocodeResult(a,b){currentReverseGeocodeResponse=a;if(b=="OK"){if(a.length==0){currentAddressResponse="None"}else{currentAddressResponse=a[0].formatted_address}}else{currentAddressResponse="Error"}}function ReadCookie(){var a,b,c,d,e,f,g,h;var i=new Array;var j=new Array;var k,l,m;h=40;f=document.cookie;if(f!==""){i=f.split(":");a=i[0];c=i[1];if(c=="South")SiteLat=-1*a;else SiteLat=1*a;b=i[2];d=i[3];if(d=="West")SiteLon=-1*b;else SiteLon=1*b;if(isNaN(a)||a=="undefined")SiteLat=60.1;if(isNaN(b)||b=="undefined")SiteLon=10.75;currentselectedlocation=new google.maps.LatLng(SiteLat,SiteLon);h=1*i[5];if(isNaN(i[16])||i[16]=="undefined")zoom=2;else zoom=1*i[16]}else{g=0;SiteLat=60.1;SiteLon=10.75;zoom=2}document.Position.SelectList.selectedIndex=h}function ShowCookie(){var a,b,c,d,e,f,g,h;var i=new Array;var j=new Array;var k,l,m,n;h=40;f=document.cookie;if(f!==""){i=f.split(":");n="COOKIE CONTENT:";n=n+"\nSite Latitude:"+i[0]+" "+i[1];n=n+"\r\nSite Latitude:"+i[2]+" "+i[3];n=n+"\r\nSite Position List Index:"+i[4];n=n+"\r\nSat Position List Index:"+i[5];n=n+"\r\nSet Location:"+i[6];n=n+"\r\nCalibrate pulsevalue:"+i[7];n=n+"\r\nCalibrate puls per HA degree:"+i[8];n=n+"\r\nPulse counter increasing in direction:"+i[9];n=n+"\r\nHourangle for calibrated position:"+i[10];n=n+"\r\nHight above ocean:"+i[11];n=n+"\r\nAntenna Size:"+1*i[12];n=n+"\r\nRx Frequency:"+1*i[13];n=n+"\r\nCookie14:"+i[14];n=n+"\r\nSite name:"+i[15];n=n+"\r\nGoogle Map Zoom:"+i[16];n=n+"\r\nAntenna hight above ground:"+1*i[17];n=n+"\r\nCookie18:"+i[18];n=n+"\r\nCookie19:"+i[19];n=n+"\r\nCookie20:"+i[19];alert(n)}else alert("Cookie is empty")}function get_timezone_offset_text(){var a=new Date;var b,c;c=String(String(a).split("(")[1]).split(")")[0];if(a.getTimezoneOffset()<0)b="UTC+"+ -1*Math.floor(a.getTimezoneOffset()/60)+"h";else if(a.getTimezoneOffset()==0)b="UTC";else b="UTC"+ -1*Math.floor(a.getTimezoneOffset()/60)+"h";if(c!="undefined")b=b+" ["+c+"]";return b}function get_timezone(){var a=new Date;var b,c;c=String(String(a).split("(")[1]).split(")")[0];if(a.getTimezoneOffset()<0)b="UTC+"+ -1*Math.floor(a.getTimezoneOffset()/60)+"h";else if(a.getTimezoneOffset()==0)b="UTC";else b="UTC"+ -1*Math.floor(a.getTimezoneOffset()/60)+"h";return b}function get_timezone_offset_value(){var a=new Date;var b;b=-1*a.getTimezoneOffset()/60;return b}function formatLocalTime(a){var b;var c=new Date;var d,e,f;c=a+get_timezone_offset_value()/24;d=c.getHours();alert(d);b=d+":"+e+":"+f;return b}function calculatebeamwidth(a,b,c,d){var e,f,g,h,i;f=3e8;h=Math.PI;g=f/(a*1e3*1e3*1e3);e=11/a/b+.25;if(e*e-d*d>0)i=Math.sqrt(e*e-d*d);else i="No outage angle, no possible outage";return i}function calculateantennabeamwidth(a,b,c){var d,e,f,g,h;e=3e8;g=Math.PI;f=e/(a*1e3*1e3*1e3);d=11/a/b;return d}function formatvalue(a,b){var c="**************************";var d,e;var f="999999999999999999999999";var g=""+a;var h=parseFloat(g);if(g.length<=b)return g;if(g.indexOf("e")!=-1||h>parseFloat(f.substring(0,b)+".4"))return c.substring(0,b);var i=""+(h+(h-parseFloat(g.substring(0,b))));d=i.substring(0,b);return d}function Div(a,b){return(a-a%b)/b}function Rev(a){var b;b=a-Math.floor(a/360)*360;return b}function Radians(a){var b;b=a*Math.PI/180;return b}function Deg(a){var b;b=a*180/Math.PI;return b}function trim(a){return a.replace(/^\s+|\s+$/g,"")}function ltrim(a){return a.replace(/^\s+/,"")}function rtrim(a){return a.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;var footprint_array=[];var globalcoveragearray=[];polygonindex=0;footprint_3dBopacity=.2;footprint_mainlobe_opacity=.2;inchtometer=.0254;inctofeet=1/12;feettometer=inchtometer*12;metertoinch=1/inchtometer;metertofeet=metertoinch/12;feettoinch=1*12;SatelliteName="";multipleoutagesoutput="";lastprintedoutage=""