var elevator1,elevator2,elevator3,elevator,elevator4; var map; var chart1,chart2,chart3; var infowindow = new google.maps.InfoWindow(); var polyline1,polyline2,polyline3; var horizon_elevation_angle=0; var last_elevation=0; var endlocation; var height_offset_corrected_for_earth_sfere; var copy_pointtopointdistance; var satellite_elevation=20484/1000; // for test Lærdal var SatLon=359;//0.8; var r_sat=4216864/100; var Mont_Everest=3000;//8850; var compass_angle; var drawpath1finished="False"; var drawpath2finished="False" var drawpath3finished="False"; var zoom;//=13; var count_down=10; var doubleclickdisabled="False"; var first_elevation,first_distance,elevation_site,first_elevation_angle var sample_resolution var currentAddressResponse; var thissitelocation,currentsitelocation; var selectedsitelon,selectedsitelat,Lat,Lon,zoomlevel; var SatLatitude,CurrentAltitude,AntennaHightAboveGround,currentselectedlocation,SatNameCurrentIndex; var chart13,countdown,countdownvalue,Interval1,satelliteposition; var Browser = { Version: function() { var version = 999; // we assume a sane browser if (navigator.appVersion.indexOf("MSIE") != -1) // bah, IE again, lets downgrade version number version = parseFloat(navigator.appVersion.split("MSIE")[1]); //version=99; return version; } } Lat=3777/100; Lon=(36000-12242)/100; zoomlevel=2; currentselectedlocation = new google.maps.LatLng( Lat,Lon); SatNameCurrentIndex=359; //document.getElementById("antenna_height").value=0; AntennaHightAboveGround=0; var geocoder = new google.maps.Geocoder(); CurrentAltitude=0; countdown="False"; countdownvalue=10; google.maps.LatLng.prototype.distanceFrom = function(latlng) { var lat = [this.lat(), latlng.lat()] var lng = [this.lng(), latlng.lng()] var R = 6378137; var dLat = (lat[1]-lat[0]) * Math.PI / 180; var dLng = (lng[1]-lng[0]) * Math.PI / 180; var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(lat[0] * Math.PI / 180 ) * Math.cos(lat[1] * Math.PI / 180 ) * Math.sin(dLng/2) * Math.sin(dLng/2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); var d = R * c; return Math.round(d); } function sleep(ms) { var dt = new Date(); dt.setTime(dt.getTime() + ms); while (new Date().getTime() < dt.getTime()); } function getURL_with_location(){ var URLloc,URLloc2; var tmpstring; var selctedsatlon; var satposarray=new Array(); var SatelliteName,CatID; tmpstring=document.Position.SelectList.value; // finn satellitt navn // finn valgt satcatid // finn valgt satellitt posisjon // finn valgt lokasjon satposarray=tmpstring.split(":"); //' Reads 6 cookie values in to the array //satposarray[0];= lon // lat //document.getElementById("satellite_latitude").value=satposarray[1]; if (satposarray[0]>180) selctedsatlon=1*satposarray[0]-360 else selctedsatlon=1*satposarray[0]; SatLatitude=1*satposarray[1]; //alert(satposarray[4]); SatelliteName=satposarray[4]; CatID=satposarray[3]; SatelliteName=SatelliteName.replace(/\s+$/,""); URLloc='http://www.satellite-calculations.com/SatShadow/satfinder.php?satpos='+selctedsatlon+'/satname='+SatelliteName+'/satcatid='+CatID+'/location='+currentselectedlocation.lat()+','+currentselectedlocation.lng(); document.getElementById("URL_location_lockoff").innerHTM=''; http://www.satellite-calculations.com/Satellite/Catalog/catalogID.php?28358 URLloc2='../Satellite/Catalog/catalogID.php?'+CatID; document.getElementById("URL_location_lock").innerHTML='Turn on location lock in URL'; document.getElementById("open_satellite_details").innerHTML='Open detailed satellite information'; } function getURL_without_location(){ var URLloc; var tmpstring; var selctedsatlon; var satposarray=new Array(); var SatelliteName,CatID; tmpstring=document.Position.SelectList.value; // finn satellitt navn // finn valgt satcatid // finn valgt satellitt posisjon // finn valgt lokasjon satposarray=tmpstring.split(":"); //' Reads 6 cookie values in to the array //satposarray[0];= lon // lat //document.getElementById("satellite_latitude").value=satposarray[1]; if (satposarray[0]>180) selctedsatlon=1*satposarray[0]-360 else selctedsatlon=1*satposarray[0]; SatLatitude=1*satposarray[1]; //alert(satposarray[4]); SatelliteName=satposarray[4]; CatID=satposarray[3]; SatelliteName=SatelliteName.replace(/\s+$/,""); URLloc='http://www.satellite-calculations.com/SatShadow/satfinder.php?satpos='+selctedsatlon+'/satname='+SatelliteName+'/satcatid='+CatID; document.getElementById("URL_location_lockoff").innerHTML=''; document.getElementById("URL_location_lockoff").innerHTML='Turn off location lock in URL'; URLloc2='../Satellite/Catalog/catalogID.php?'+CatID; document.getElementById("open_satellite_details").innerHTML='Open detailed satellite information'; } function createCookieByName(name,value,days,path) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"+path; } function readCookieByName(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name,path) { createCookieByName(name,"",-1,path); } function createCookieByName(name,value,days,path) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path="+path; //alert(name+"="+value+expires+"; path="+path) ; } function readCookieByName(name) { var nameEQ = name + "="; var ca = document.cookie.split(";"); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==" ") c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } //alert(c.substring(nameEQ.length,c.length)); return null; } function eraseCookie(name,path) { createCookieByName(name,"",-1,path); } function calculate_elevation_angle(distance,height){ var toRad,toDeg,pi,angle toRad=Math.PI/180; toDeg=180/Math.PI; angle=toDeg*Math.atan(height/distance); return(angle); // 8850m //Tan(0.1grad) =8850/TAN0.1 mont everest worst case. For å oppnå 0.1grad nøyaktighet // 8850m er ikke over horisonten ved en avstand på ca. 672km } function calculate_height_from_elevation_and_distance(distance,elevationangle){ var toRad,toDeg,pi,angle toRad=Math.PI/180; toDeg=180/Math.PI; elevationangle=toRad*elevationangle; height=Math.tan(elevationangle)*distance; return(height); // 8850m //Tan(0.1grad) =8850/TAN0.1 mont everest worst case. For å oppnå 0.1grad nøyaktighet // 8850m er ikke over horisonten ved en avstand på ca. 672km } /* function calculateBearing(location1,location2) { var p1 = location1; var p2 = location2; with (Math) { var lat1 = p1.lat() * (PI/180); var lon1 = p1.lng() * (PI/180); var lat2 = p2.lat() * (PI/180); var lon2 = p2.lng() * (PI/180); var d = 2*asin(sqrt( pow((sin((lat1-lat2)/2)),2) + cos(lat1)*cos(lat2)*pow((sin((lon1-lon2)/2)),2))); var bearing = atan2(sin(lon1-lon2)*cos(lat2), cos(lat1)*sin(lat2)-sin(lat1)*cos(lat2)*cos(lon1-lon2)) / -(PI/180); bearing = bearing < 0 ? 360 + bearing : bearing; var bearing = 360 - bearing + 90; // 0 degrees at 3 o'clock and counting couterclockwise //GLog.write('Bearing: ' + bearing % 360) bearing =(360-bearing+90) % 360 ; } return(bearing); } */ function calculateBearing(location1,location2) { var p1 = location1; var p2 = location2; var lat1 = p1.lat() * (Math.PI/180); var lon1 = p1.lng() * (Math.PI/180); var lat2 = p2.lat() * (Math.PI/180); var lon2 = p2.lng() * (Math.PI/180); var d = 2*Math.asin(Math.sqrt( Math.pow((Math.sin((lat1-lat2)/2)),2) + Math.cos(lat1)*Math.cos(lat2)*Math.pow((Math.sin((lon1-lon2)/2)),2))); var bearing = Math.atan2(Math.sin(lon1-lon2)*Math.cos(lat2), Math.cos(lat1)*Math.sin(lat2)-Math.sin(lat1)*Math.cos(lat2)*Math.cos(lon1-lon2)) / -(Math.PI/180); bearing = bearing < 0 ? 360 + bearing : bearing; var bearing = 360 - bearing + 90; // 0 degrees at 3 o'clock and counting couterclockwise //GLog.write('Bearing: ' + bearing % 360) bearing =(360-bearing+90) % 360 ; return(bearing); } function ifbelowhorison(satelevation,terrainelevation){ document.getElementById("tilt").innerHTML="Tilt=Sat Elevation:"+formatvalue((1*satellite_elevation),3)+" °"; if ((navigator.appName=="Microsoft Internet Explorer"))//||(navigator.appName=="Opera")) { // make special output for MSIE document.getElementById("newgstreetdiv").style.backgroundImage="url('http://maps.googleapis.com/maps/api/streetview?size=500x500&location="+currentselectedlocation.lat()+","+currentselectedlocation.lng()+"&heading="+compass_angle+"&fov=90&pitch="+1*(satellite_elevation)+"&sensor=false')"; // ok works in non IE } else { document.getElementById("newgstreetdiv").innerHTML=""; // seems to work document.getElementById("newgstreetdiv").style.backgroundImage="url('http://maps.googleapis.com/maps/api/streetview?size=500x500&location="+currentselectedlocation.lat()+","+currentselectedlocation.lng()+"&heading="+compass_angle+"&fov=90&pitch="+1*(satellite_elevation)+"&sensor=false')"; // ok works in non IE } /* if (terrainelevation>satelevation) { document.getElementById("mapcell").style.borderWidth = "thick"; document.getElementById("mapcell").style.borderColor ="red"; } else { document.getElementById("mapcell").style.borderWidth = "thick"; document.getElementById("mapcell").style.borderColor ="green"; } */ } function teststyle(){ document.getElementById("testboxtest").style.display="inline"; document.getElementById("map_canvas").style.display="none"; document.getElementById("profilestreet").style.display="none"; document.getElementById("showmap").style.display="inline"; document.getElementById("fb_gplus_twitter").style.display="none"; } function teststyle2(){ document.getElementById("testboxtest").style.display="none"; document.getElementById("map_canvas").style.display="block"; document.getElementById("profilestreet").style.display="inline"; document.getElementById("showmap").style.display="none"; document.getElementById("fb_gplus_twitter").style.display="inline"; } function setsatelliteposition(){ satelliteposition = new google.maps.LatLng(0, document.getElementById("satellite_longitude").value); /* if (1*document.getElementById("satellite_longitude").value<0) SatLon=360+1*document.getElementById("satellite_longitude").value else SatLon=1*document.getElementById("satellite_longitude").value; //SatLon=360-0.8; if (1*document.getElementById("satellite_longitude").value<0) document.getElementById("sat_pos").innerHTML=formatvalue(Math.abs(1*document.getElementById("satellite_longitude").value),2)+"°W" else document.getElementById("sat_pos").innerHTML=formatvalue(1*document.getElementById("satellite_longitude").value,2)+"°E"; */ document.getElementById("azimuth").innerHTML = formatvalue(calculateBearing(currentselectedlocation,satelliteposition), 3)+"°"; SelectSatellite(); //r_sat=1*satposarray[2]; //SatLatitude=1*satposarray[1]; satellite_elevation=Elevation2(SatLon,currentselectedlocation.lat(),currentselectedlocation.lng(),0*CurrentAltitude,1*SatLatitude,1*r_sat); if (1*document.getElementById("satellite_longitude").value<0) SatLon=360+1*document.getElementById("satellite_longitude").value else SatLon=1*document.getElementById("satellite_longitude").value; //SatLon=360-0.8; if (1*document.getElementById("satellite_longitude").value<0) document.getElementById("sat_pos").innerHTML=formatvalue(Math.abs(1*document.getElementById("satellite_longitude").value),2)+"°W" else document.getElementById("sat_pos").innerHTML=formatvalue(1*document.getElementById("satellite_longitude").value,2)+"°E"; document.getElementById("sat_pos2").innerHTML=document.getElementById("sat_pos").innerHTML; } function Radians(number) { var rad rad=number*Math.PI/180; return(rad) } function setinfowindowinitialize(){ // Retrieve the clicked location and push it on the array //alert(1); infowindow.setPosition(currentselectedlocation ); var possite = infowindow.getPosition(); infowindow.setContent("Position is "+possite.lat()+" "+possite.lng() ); infowindow.open(map); } function compensate_altitude_for_two_locations(currentsitelocation,elevationtestlocation){ var f,r_sat,r_eq,Rstation,Ra,Rz,alfa_r,alfa_rx_sitelat,alfa_rx_testlat,firstcoordinates var y,y1,y2,x,x2,x3,pointtopointdistance,hight_offset,katet var SiteLon=currentsitelocation.lng(); var SiteLat=currentsitelocation.lat(); var TestLon=elevationtestlocation.lng(); var TestLat=elevationtestlocation.lat(); // Mont Everest 8850m er ikke over horisonten ved en avstand på ca. 672km earth_omkrets=40000*1000;//m earth_radius=40000*1000/(2*Math.PI); f=(1/298.257) ; // Earth flattning factor r_sat=42164.57; // Distance from earth centre to satellite in km r_eq=6378.14*1000 ; // Earth radius in km y=Math.sin(Radians(SiteLat))*earth_radius; y2=Math.sin(Radians(TestLat))*earth_radius; y1=y-y2; x=Math.cos(Radians(TestLat))*earth_radius; x3=Math.cos(Radians(SiteLat))*earth_radius; x2=x-x3; pointtopointdistance=Math.sqrt(x2*x2+y1*y1); copy_pointtopointdistance=pointtopointdistance; katet=Math.sqrt(earth_radius*earth_radius-(pointtopointdistance/2)*(pointtopointdistance/2)); hight_offset=katet-earth_radius; // ser ut til å kjøre korrekt nå. alfa_rx_sitelat=r_eq*Math.sin(Radians(SiteLat)) ; firstcoordinates="x="+alfa_rx_sitelat; //alert(alfa_rx_sitelat); alfa_rx_testlat=r_eq*Math.sin(Radians(TestLat)) ; //alert(firstcoordinates+"\r\nx="+alfa_rx_testlat+"\r\nOffset="+1*(alfa_rx_testlat-alfa_rx_sitelat) ); //alert(alfa_rx_testlat+" "+alfa_rx_sitelat+" "+1*(alfa_rx_testlat-alfa_rx_sitelat)); return(1*(hight_offset)); } // The following path marks a general path from Mt. // currentselectedlocation, the highest point in the continental United // States to Badwater, Death Vallet, the lowest point. // Load the Visualization API and the columnchart package. function ShowCookie() { // var Lat,Lon,LatDir,LonDir,CookieValue,MyCookieVal,HightAboveOcean,SatNameCurrentIndex var ValArray=new Array(); var SubArray=new Array(); var Calibrate_pulsevalue,Calibrate_pulse_per_ha_degree,calibrate_inc_direction,cookie_decoded_content SatNameCurrentIndex =40 ; MyCookieVal=readCookieByName("NewSatShadowCalc"); //MyCookieVal=readCookieByName("IESS412_11parameter"); //MyCookieVal=document.cookie; //alert(MyCookieVal); if (MyCookieVal !== '') // If cookie has value then set users defaults { ValArray=MyCookieVal.split(":"); //' Reads 6 cookie values in to the array cookie_decoded_content='COOKIE CONTENT:'; cookie_decoded_content=cookie_decoded_content+'\nSite Latitude:'+ValArray[0]+' '+ValArray[1]; cookie_decoded_content=cookie_decoded_content+'\r\nSite Latitude:'+ValArray[2]+' '+ValArray[3]; cookie_decoded_content=cookie_decoded_content+'\r\nSite Position List Index:'+ValArray[4]; cookie_decoded_content=cookie_decoded_content+'\r\nSat Position List Index:'+ValArray[5]; cookie_decoded_content=cookie_decoded_content+'\r\nSet Location:'+ValArray[6]; cookie_decoded_content=cookie_decoded_content+'\r\nCalibrate pulsevalue:'+ValArray[7]; cookie_decoded_content=cookie_decoded_content+'\r\nCalibrate puls per HA degree:'+ValArray[8]; cookie_decoded_content=cookie_decoded_content+'\r\nPulse counter increasing in direction:'+ValArray[9]; cookie_decoded_content=cookie_decoded_content+'\r\nHourangle for calibrated position:'+ValArray[10]; cookie_decoded_content=cookie_decoded_content+'\r\nHight above ocean:'+ValArray[11]; cookie_decoded_content=cookie_decoded_content+'\r\nAntenna Size:'+1*ValArray[12]; cookie_decoded_content=cookie_decoded_content+'\r\nRx Frequency:'+1*ValArray[13]; cookie_decoded_content=cookie_decoded_content+'\r\nCookie14:'+ValArray[14]; cookie_decoded_content=cookie_decoded_content+'\r\nSite name:'+ValArray[15]; cookie_decoded_content=cookie_decoded_content+'\r\nGoogle Map Zoom:'+ValArray[16]; cookie_decoded_content=cookie_decoded_content+'\r\nAntenna hight above ground:'+1*ValArray[17]; cookie_decoded_content=cookie_decoded_content+'\r\nCookie18:'+ValArray[18]; cookie_decoded_content=cookie_decoded_content+'\r\nCookie19:'+ValArray[19]; cookie_decoded_content=cookie_decoded_content+'\r\nCookie20:'+ValArray[19]; alert(cookie_decoded_content); } else alert('Cookie is empty'); //alert('Site Latitude:'+ValArray[0]+' '+ValArray[1]+'\r\nSite Latitude:'+ValArray[2]+' '+ValArray[3]); //61.10301827211036:North:7.51039981842041:East:0:231:undefined:NaN:NaN:0:undefined:0:undefined:undefined:undefined:Hanseskogen 31B, 6887 Lærdal, Norway:16:undefined:undefined:undefined //0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 //60.14367412766545:North:10.806244800000059:East:0:230:undefined:NaN:NaN:0:undefined:265:undefined:undefined:undefined:User defined location:15:5:undefined:undefined //CookieValue=Lat+":"+LatDir+":"+Lon+":"+LonDir+":"+SitePosCurrentIndex+":"+SatNameCurrentIndex+":"+SetLocation+":"+Calibrate_pulsevalue+":"+Calibrate_pulse_per_ha_degree+":"+calibrate_inc_direction+":"+HA_for_calibrated_position+":"+HightAboveOcean+":"+cookie12+":"+cookie13+":"+cookie14+":"+cookie15+":"+cookie16+":"+cookie17+":"+cookie19+":"+cookie20+";expires=Tue, 10 Jul 2040 23:59:59 UTC;"; } function initialize(lt,ln) { //alert("init"); //document.getElementById("debug_info").style.display="none"; ReadCookie(); if (isNaN(lt)||(lt=="NA")) Lat=Lat else Lat=lt; if (isNaN(ln) ||(ln=="NA")) Lon=Lon else Lon=ln; currentselectedlocation = new google.maps.LatLng( Lat,Lon); if (isNaN(lt)||(lt=="NA")) getURL_with_location() else getURL_without_location(); zoom=1*zoomlevel; //alert(currentselectedlocation); //alert(zoom); detect_browser(); //alert(currentselectedlocation); var myOptions = { scrollwheel: true, disableDoubleClickZoom: true, panControl: true, streetViewControl: false, zoom: zoom, center: currentselectedlocation, scaleControl:true, draggable:true, mapTypeId: 'terrain' } /* var myStyles = [ { featureType: "", stylers: [ { Invert_lightness: 'true' } ] } ]; */ map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var adUnitDiv = document.createElement('div'); var adUnitOptions = { 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(adUnitDiv, adUnitOptions); var adUnitDiv3 = document.createElement('div'); var adUnitOptions3 = { format: google.maps.adsense.AdFormat.X_LARGE_VERTICAL_LINK_UNIT, position: google.maps.ControlPosition.LEFT_TOP, backgroundColor: '#C0BBB7', borderColor: '#C0BBB7', titleColor: '#222222', textColor: '#000000', urlColor: '#222222', map: map, visible: true, publisherId: 'ca-pub-1045325887862292' } adUnit3 = new google.maps.adsense.AdUnit(adUnitDiv3, adUnitOptions3); var adUnitDiv2 = document.createElement('div'); var adUnitOptions2 = { 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(adUnitDiv2, adUnitOptions2); var adUnitDiv4 = document.createElement('div'); var adUnitOptions4 = { 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' } adUnit4 = new google.maps.adsense.AdUnit(adUnitDiv4, adUnitOptions4); var adUnitDiv5 = document.createElement('div'); var adUnitOptions5 = { format: google.maps.adsense.AdFormat.VERTICAL_BANNER, position: google.maps.ControlPosition.RIGHT_TOP, backgroundColor: '#C0BBB7', borderColor: '#C0BBB7', titleColor: '#222222', textColor: '#000000', urlColor: '#222222', map: map, visible: true, publisherId: 'ca-pub-1045325887862292' } adUnit5 = new google.maps.adsense.AdUnit(adUnitDiv5, adUnitOptions5); // Create an ElevationService. elevator1 = new google.maps.ElevationService(); elevator2 = new google.maps.ElevationService(); elevator3 = new google.maps.ElevationService(); elevator4 = new google.maps.ElevationService(); elevatordrawRoadPath2= new google.maps.ElevationService(); // Draw the path, using the Visualization API and the Elevation service. if (SatLon<180) document.getElementById("sat_pos").innerHTML=formatvalue(SatLon, 3)+"°E" else document.getElementById("sat_pos").innerHTML=formatvalue((360-SatLon), 3)+"°W"; //alert(zoomlevel); currentselectedlocation = new google.maps.LatLng(Lat , Lon); // set map center too.. setsatelliteposition(); setElevationInfoScreen(); reverseGeocode(currentselectedlocation); document.getElementById("el_info").innerHTML=""; document.getElementById("terrain_elevation").innerHTML=""; document.getElementById("el_limit").innerHTML=""; document.getElementById("sat_el").innerHTML=formatvalue(satellite_elevation, 3)+"°"; document.getElementById("azimuth").innerHTML = formatvalue(calculateBearing(currentselectedlocation,satelliteposition), 3)+"°"; loadlistners(); /* 8 JUNE setToRed(); count_down=10; */ } function setposition(){ drawPath(); //setinfowindowinitialize(); } function loadlistners(){ google.maps.event.addListener(map, 'mousemove',function getElevationMouseOver(event) { var locations = []; // Retrieve the clicked location and push it on the array var clickedLocation = event.latLng; locations.push(clickedLocation); var possite = infowindow.getPosition(); document.getElementById("lngspan").innerHTML =formatvalue(possite.lng(), 3)+"°"; document.getElementById("latspan").innerHTML = formatvalue(possite.lat(), 3)+"°";// //document.getElementById("mouseoveraltitude").innerHTML = formatvalue(results[0].elevation, 3)+" meters"; document.getElementById("azimuth").innerHTML = formatvalue(calculateBearing(currentselectedlocation,satelliteposition), 3)+"°"; }); google.maps.event.addListener(map, 'zoom_changed',function writecookie(){ SetGoogleMapZoomCookie(); }); google.maps.event.addListener(map, 'dblclick',function getElevationClicked(event) { var locations = []; setToRed(); count_down=10; setsatelliteposition(); document.getElementById("el_info").innerHTML=""; document.getElementById("terrain_elevation").innerHTML=""; document.getElementById("el_limit").innerHTML=""; document.getElementById("sat_el").innerHTML=formatvalue(satellite_elevation, 3)+"°"; document.getElementById("azimuth").innerHTML = formatvalue(calculateBearing(currentselectedlocation,satelliteposition), 3)+"°"; // Retrieve the clicked location and push it on the array var clickedLocation = event.latLng; currentselectedlocation=clickedLocation; Lat=currentselectedlocation.lat(); Lon=currentselectedlocation.lng(); document.earth.this_site_longitude.value=Lat; document.earth.this_site_latitude.value=Lon; SetGoogleMapCookie(); reverseGeocode(currentselectedlocation); locations.push(clickedLocation); document.getElementById("azimuth").innerHTML = formatvalue(calculateBearing(currentselectedlocation,satelliteposition), 3)+"°"; //alert(center.lat());//+center.lat()+" "+center.lng() + // Open an info window indicating the elevation at the clicked position // Create a LocationElevationRequest object using the array's one value var positionalRequest = { 'locations': locations } // Initiate the location request elevator1.getElevationForLocations(positionalRequest, function(results, status) { if (status == google.maps.ElevationStatus.OK) { // Retrieve the first result if (results[0]) { // infowindow.setPosition(clickedLocation); // var possite = infowindow.getPosition(); if (results[0].elevation<0) document.getElementById("altitude").innerHTML = formatvalue(0, 3)+" meters" else document.getElementById("altitude").innerHTML = formatvalue(results[0].elevation, 3)+" meters"; if (results[0].elevation>0) document.getElementById("info_popuptext").innerHTML="Address:"+currentAddressResponse+"
Position: "+formatvalue(possite.lat(),3)+"° "+formatvalue(possite.lng(),3) + "°
Altitude: " + formatvalue(results[0].elevation,3) + " meters." else document.getElementById("info_popuptext").innerHTML="Address:"+currentAddressResponse+"
Position: "+formatvalue(possite.lat(),3)+"° "+formatvalue(possite.lng(),3) + "°
Altitude: 0 (sea depth=" + formatvalue(-1*results[0].elevation,3) + " meters)"; CurrentAltitude=1*results[0].elevation; //SetGoogleMapCookie(); // if (results[0].elevation>0) infowindow.setContent("Address:"+currentAddressResponse+"
Position is "+formatvalue(possite.lat(),6)+" "+formatvalue(possite.lng(),6) + "
The altitude at this point
is " + formatvalue(results[0].elevation,3) + " meters.") // else infowindow.setContent("Address:"+currentAddressResponse+"
Position is "+formatvalue(possite.lat(),3)+" "+formatvalue(possite.lng(),3) + "
The altitude at this point
is 0 meters (sea depth=" + formatvalue(-1*results[0].elevation,3) + " meters)") // infowindow.open(map); } else { alert("No results found"); } } else { alert("Elevation service failed due to: " + status); } }); infowindow.setPosition(currentselectedlocation); var possite = infowindow.getPosition(); infowindow.setContent(document.getElementById("sat_name").innerHTML+"@"+document.getElementById("sat_pos").innerHTML+"
Azimuth(true north): "+formatvalue(calculateBearing(currentselectedlocation,satelliteposition), 3)+"°
Elevation: "+formatvalue(satellite_elevation, 3)+"°"+"
"+document.getElementById("output_belowterrain").innerHTML+"
"+document.getElementById("info_popuptext").innerHTML ); infowindow.open(map); polyline1.setMap(null); //elevationPath2.setMap(null); //sleep(1000); drawPath(); setToRed(); //polyline2.setMap(null); polyline3.setMap(null);//pathRequest3.setMap(null); elevationPath3.setMap(null); //15 JUNI //sleep(1000); //drawPath2(endlocation); setToRed(); drawPath3(endlocation); // 15 JUNI setToRed(); } ); // end click } function setElevationInfoScreen() { var locations = []; reverseGeocode(currentselectedlocation); locations.push(currentselectedlocation); // Create a LocationElevationRequest object using the array's one value var positionalRequest = { 'locations': locations } // Initiate the location request elevator4.getElevationForLocations(positionalRequest, function(results, status) { if (status == google.maps.ElevationStatus.OK) { // Retrieve the first result if (results[0]) { infowindow.setPosition(currentselectedlocation); map.setCenter(currentselectedlocation); var possite = currentselectedlocation; document.getElementById("lngspan").innerHTML =formatvalue(possite.lng(),3)+"°"; document.getElementById("latspan").innerHTML = formatvalue(possite.lat(),3)+"°";// if (results[0].elevation<0) document.getElementById("altitude").innerHTML = formatvalue(0, 3)+" meters" else document.getElementById("altitude").innerHTML = formatvalue(results[0].elevation, 3)+" meters"; //document.getElementById("altitude").innerHTML = formatvalue(results[0].elevation,3)+" meters"; CurrentAltitude=1*results[0].elevation; document.earth.this_site_longitude.value=possite.lng(); document.earth.this_site_latitude.value=possite.lat(); if (results[0].elevation>0) document.getElementById("info_popuptext").innerHTML="Address:"+currentAddressResponse+"
Position: "+formatvalue(possite.lat(),3)+"° "+formatvalue(possite.lng(),3) + "°
Altitude: " + formatvalue(results[0].elevation,3) + " meters." else document.getElementById("info_popuptext").innerHTML="Address:"+currentAddressResponse+"
Position: "+formatvalue(possite.lat(),3)+"° "+formatvalue(possite.lng(),3) + "°
Altitude: 0(sea depth=" + formatvalue(-1*results[0].elevation,3) + " meters)"; // infowindow.open(map); } else { alert("No results found"); } } else { alert("Elevation service failed due to: " + status); } }); } function open_single_satellite_view() { var catalog; var tmpstring; var satarray=new Array(); tmpstring=document.Position.SelectList.value; satarray=tmpstring.split(":"); //' Reads value array which is separated by ":", satcatid at index 3 satcatid=satarray[3]; //SingleSatPath,satcatid //alert("http://www.online.no"); //catalog="Catalog\"; //open2("http://www.online.no",1); //ondblclick= window.open("Catalog/"+satcatid+".htm",satcatid,''); //ondblclick="open2(window.location.href+'#38095',1)" } function open_170h_predictions() { var catalog; var tmpstring; var satarray=new Array(); tmpstring=document.Position.SelectList.value; satarray=tmpstring.split(":"); //' Reads value array which is separated by ":", satcatid at index 3 satcatid=satarray[3] window.open("170HourListings/170h_listing_"+satcatid+".htm","170h_predictions_"+satcatid,''); } function writetestout(){ document.Position.SelectList.disabled = true ; document.getElementById("misc").innerHTML=Date(); document.getElementById("waitinfotext").style.color = "red"; document.getElementById("waitinfotext").innerHTML = "Wait 10 seconds before next action !"; document.getElementById("output_wait").style.color = document.getElementById("waitinfotext").style.color; document.getElementById("output_wait").innerHTML=document.getElementById("waitinfotext").innerHTML; //document.getElementById("waitinfotext2").style.color = "red"; //document.getElementById("waitinfotext2").innerHTML = "Wait 10 seconds before next doubleclick in map!"; doubleclickdisabled="True"; // disable mouse events } function enable_mouseevents(){ countdown="False"; Interval1=window.clearInterval(Interval1); document.Position.SelectList.disabled = false ; document.getElementById("waitinfotext").style.color = "blue"; document.getElementById("waitinfotext").innerHTML = "Ready for next action !"; document.getElementById("output_wait").style.color = document.getElementById("waitinfotext").style.color; document.getElementById("output_wait").innerHTML=document.getElementById("waitinfotext").innerHTML; // enable mouse event // document.getElementById("waitinfotext2").style.color = "blue"; // document.getElementById("waitinfotext2").innerHTML = "Ready for next doubleclick in map !"; // enable mouse event google.maps.event.clearListeners(map, 'click'); doubleclickdisabled="False"; google.maps.event.clearListeners(map, 'mousemove'); google.maps.event.clearListeners(map, 'drag'); loadlistners(); var myOptions = { //scrollwheel: true, //disableDoubleClickZoom: true, //panControl: true, // streetViewControl: false, //zoom: zoom, //center: currentselectedlocation, //scaleControl:true, draggable:true//, //mapTypeId: 'terrain' } map.setOptions({options: myOptions}); } function function_count_down(){ //alert(countdownvalue); if (countdown=="True") { countdownvalue=countdownvalue-1; if (countdownvalue>0) document.getElementById("waitinfotext").innerHTML = "Wait "+countdownvalue+" seconds before next action !" else { document.getElementById("waitinfotext").style.color = "blue"; document.getElementById("waitinfotext").innerHTML = "Ready for next action !"; Interval1=window.clearInterval(Interval1); document.Position.SelectList.disabled = false ; } document.getElementById("output_wait").style.color = document.getElementById("waitinfotext").style.color; document.getElementById("output_wait").innerHTML=document.getElementById("waitinfotext").innerHTML; } } function drawPath() { SelectSatellite(); satellite_elevation=Elevation2(SatLon,currentselectedlocation.lat(),currentselectedlocation.lng(),0*CurrentAltitude,1*SatLatitude,1*r_sat); //if (chart1!=null) chart1.clearChart(); // Create a new chart in the elevation_chart DIV. // chart1 = new google.visualization.ColumnChart(document.getElementById("elevation_chart1")); var path1 = [ currentselectedlocation, satelliteposition]; // Create a PathElevationRequest object using this array. // Ask for 256 samples along that path. var pathRequest1 = { 'path': path1, 'samples': 512 } // Initiate the path request. elevator1.getElevationAlongPath(pathRequest1, plotElevation); drawpath1finished="True"; compass_angle=calculateBearing(currentselectedlocation,satelliteposition) ; // now disable mouseevents and wait var myOptions = { //scrollwheel: true, //disableDoubleClickZoom: true, //panControl: true, //streetViewControl: false, //zoom: zoom, //center: currentselectedlocation, //scaleControl:true, draggable:false//, //mapTypeId: 'terrain' } map.setOptions({options: myOptions}); map.setOptions(myOptions); google.maps.event.clearListeners(map, 'click'); google.maps.event.clearListeners(map, 'mousemove'); google.maps.event.addListener(map, 'drag',do_nothing()); google.maps.event.addListener(map, 'click',do_nothing()); google.maps.event.addListener(map, 'mousemove',do_nothing()); countdown="True"; countdownvalue=10; Interval1=self.setInterval("function_count_down()",1000); //window.setInterval("function_count_down()", 1000); //window.setInterval "count_down()",1000,JavaScript writetestout(); window.setTimeout("enable_mouseevents()", 10000); } function drawPath2(endinglocation) { // Create a new chart in the elevation_chart DIV. // chart2 = new google.visualization.ColumnChart(document.getElementById("elevation_chart2")); var path2 = [ currentselectedlocation, endinglocation]; // Create a PathElevationRequest object using this array. // Ask for 512 samples along that path. var pathRequest2 = { 'path': path2, 'samples': 100 } // Initiate the path request. elevator2.getElevationAlongPath(pathRequest2, plotElevation2); drawpath2finished="True"; } function drawRoadPath2(endinglocation) { var pathroad2 = [ currentselectedlocation, endinglocation]; // Create a PathElevationRequest object using this array. // Ask for 100 samples along that road path. var RoadPathRequest2 = { 'path': pathroad2, 'samples': Math.floor(sample_resolution) } // Initiate the path request. elevatordrawRoadPath2.getElevationAlongPath(RoadPathRequest2, plotElevationRoadpath2); //alert(Math.floor(sample_resolution)); } function drawPath3(endinglocation) { //chart3.clearChart();chart1.clearChart(); //if (chart3!=null) chart3.clearChart(); //chart3 = new google.visualization.ColumnChart(document.getElementById("elevation_chart3")); var path3 = [ currentselectedlocation, endinglocation]; // Create a PathElevationRequest object using this array. // Ask for 512 samples along that path. var pathRequest3 = { 'path': path3, 'samples': 512 } elevator3.getElevationAlongPath(pathRequest3, plotElevation3); drawpath3finished="True"; // Add our over/out handlers. } function barMouseOver(e) { // chart3.setSelection([e]).column; } function barMouseOut(e) { // chart3.setSelection([{'row': null, 'column': null}]); } // Takes an array of ElevationResult objects, draws the path on the map // and plots the elevation profile on a Visualization API ColumnChart. function plotElevation(results, status) { if (status == google.maps.ElevationStatus.OK) { elevations = results; // Extract the elevation samples from the returned results // and store them in an array of LatLngs. var current_height_offset=0; var last_dist; var use_first_point="False"; var current_alt_for_this_satellite; var current_location_index; var altlimitbeforefirstsample="False"; var belowterrain="False"; var plotlinecolor2="blue"; document.getElementById("firstloc").innerHTML=""; document.getElementById("firstlocdist").innerHTML=""; // elevationPath1=null; var elevationPath1 = []; CurrentAltitude=1*elevations[0].elevation; //alert( CurrentAltitude); for (var i = 0; i < results.length; i++) { elevationPath1.push(elevations[i].location); // beregn maks elevasjon her beregn avstand fra site koordinat til gjeldende lokasjon //and than just use the function like that: var loc1 = currentselectedlocation; var loc2 = elevations[i].location; var dist = loc2.distanceFrom(loc1); current_alt_for_this_satellite=Math.sin(Radians(satellite_elevation))*dist; if ((i==1)&& (current_alt_for_this_satellite>Mont_Everest)) use_first_point="True" else use_first_point="False"; //thiselevation=Math.Adist if (i>0 && ( (current_alt_for_this_satellite-100 &&satellite_elevation height_offset_corrected_for_earth_sfere=compensate_altitude_for_two_locations(loc1,loc2); current_height_offset=height_offset_corrected_for_earth_sfere; //height_offset_corrected_for_earth_sfere=0; elevations[i].elevation=elevations[i].elevation+height_offset_corrected_for_earth_sfere; //alert(current_height_offset); last_dist=dist; thiselevation=calculate_elevation_angle(dist,1*(elevations[i].elevation-elevations[0].elevation)); if (thiselevation>satellite_elevation) belowterrain="True"; if ((thiselevation>last_elevation) && (thiselevation>horizon_elevation_angle)) horizon_elevation_angle=thiselevation; last_elevation=thiselevation; // stop ved første hindring endlocation=elevations[i].location; // hva om første sjekkpunkt er over mont ev ? altlimitbeforefirstsample="True"; // i første "sveip" er det over 13000m mellom hvert punkt, Mont Everest høyde nås før første sample // denne er ok som grov søk document.getElementById("firstloc").innerHTML=formatvalue(thiselevation,3)+"°( "+formatvalue(satellite_elevation,3)+"° ) index="+i+" "+Date(); document.getElementById("firstlocdist").innerHTML=formatvalue(last_dist,3)+"m index="+i+" "+Date()+endlocation; } if (belowterrain=="True") plotlinecolor2="red"; } if (altlimitbeforefirstsample=="True") endlocation=elevations[1].location; //document.getElementById("el1_info").innerHTML=horizon_elevation_angle+" deg h="+height_offset_corrected_for_earth_sfere+" Dist= "+dist+" ppdist="+copy_pointtopointdistance+" Resolution:"+1*(dist/512)+" meters per sample"; // Display a polyline of the elevation path. var pathOptions1 = { path: elevationPath1, strokeColor: plotlinecolor2, opacity: 1, strokeWeight:2, map: map } polyline1 = new google.maps.Polyline(pathOptions1); // Extract the data from which to populate the chart. // Because the samples are equidistant, the 'Sample' // column here does double duty as distance along the // X axis. var data = new google.visualization.DataTable(); data.addColumn('string', 'Sample'); data.addColumn('number', 'Elevation'); // data.addColumn('meters', 'Meters'); //for (var i = 0; i < results.length; i++) { for (var i = 0; i < current_location_index; i++) { data.addRow(['', elevations[i].elevation]); // che // data.addRow(['', i]); } //polyline1.setMap(null); // erases polymap // Draw the chart using the data within its DIV. /* document.getElementById("elevation_chart1").style.display = 'block'; chart1.draw(data, { width: 440, height: 200, legend: 'none', titleY: 'Elevation (m)' // titleX 'Distance (m)' }); */ } //sleep(8000); drawPath3(endlocation); } function plotElevation2(results, status) { if (status == google.maps.ElevationStatus.OK) { elevations = results; // Extract the elevation samples from the returned results // and store them in an array of LatLngs. var current_height_offset=0; var elevationPath2 = []; last_elevation=0; var belowterrain="False"; var plotlinecolor="black"; var lastindexruntwo=0; var current_alt_for_this_satellite; for (var i = 0; i < results.length; i++) { elevationPath2.push(elevations[i].location); // beregn maks elevasjon her beregn avstand fra site koordinat til gjeldende lokasjon //and than just use the function like that: var loc1 = currentselectedlocation; var loc2 = elevations[i].location; var dist = loc2.distanceFrom(loc1); var lastdist=0; //thiselevation=Math.Adist //&& ( current_alt_for_this_satellite0 && ( (current_alt_for_this_satellitesatellite_elevation) belowterrain="True"; if ((thiselevation>last_elevation) && (thiselevation>horizon_elevation_angle)) horizon_elevation_angle=thiselevation; last_elevation=thiselevation; lastdist=dist; endlocation=elevations[i].location; } if (belowterrain=="True") plotlinecolor="red"; } var pathOptions2 = { path: elevationPath2, strokeColor: plotlinecolor, opacity: 1, strokeWeight:4, map: map } polyline2 = new google.maps.Polyline(pathOptions2); // Extract the data from which to populate the chart. // Because the samples are equidistant, the 'Sample' // column here does double duty as distance along the // X axis. var data = new google.visualization.DataTable(); data.addColumn('string', 'Sample'); data.addColumn('number', 'Elevation'); // data.addColumn('meters', 'Meters'); for (var i = 0; i < results.length; i++) { // for (var i = 0; i < lastindexruntwo; i++) { data.addRow(['', elevations[i].elevation]); // data.addRow(['', i]); } // Draw the chart using the data within its DIV. /* document.getElementById("elevation_chart2").style.display = 'block'; chart2.draw(data, { width: 640, height: 200, legend: 'none', titleY: 'Elevation (m)' // titleX 'Distance (m)' }); */ } } function plotElevationRoadpath2(results, status) { if (status == google.maps.ElevationStatus.OK) { elevations = results; // Extract the elevation samples from the returned results // and store them in an array of LatLngs. var elevationRoadPath2 = []; var thiselevation; elevationRoadPath2.push(elevations[0].location); elevationRoadPath2.push(elevations[1].location); //and than just use the function like that: var loc1 = currentselectedlocation; var loc2 = elevations[1].location; var dist = loc2.distanceFrom(loc1); // alert(elevations[0].location+" "+elevations[1].location+" "+dist); elevation_site=elevations[0].elevation; first_elevation=elevations[1].elevation; first_distance=dist; thiselevation=calculate_elevation_angle(dist,1*(elevation_site-first_elevation)); if (first_elevation<0) first_elevation=0; if (elevation_site<0) elevation_site=0; first_elevation_angle=calculate_elevation_angle(dist,1*(first_elevation-elevation_site)); if ((first_elevation<0)||(elevation_site<0)) first_elevation_angle=0; document.getElementById("siteelevation").innerHTML="Location altitude: "+formatvalue(elevation_site,3)+" m"; document.getElementById("first_elevation").innerHTML="First elevation sample: "+formatvalue(first_elevation,3)+" m"; document.getElementById("first_distance").innerHTML="First elevation distance: "+formatvalue(first_distance,3)+" m"; document.getElementById("first_elevation_angle").innerHTML="First elevation angle*: "+formatvalue(first_elevation_angle,3)+" °"; //alert("Korriger tilt"); // korriger tilt med utregnet first elevation dersom den er mindre enn 5,71° ~ dvs. 10% // bratteste vei i Norge 27% 15.1° korriger tilt med utregnet first elevation dersom den er mindre enn 5,71° ~ dvs. 10% // må lage en ny elevation request fra site til første sample for å finne veiens hellning. //dvs. 26-100m. Kan trolig gjøre 100 samples . Oppløsning 26cm-1m // if (Math.abs(first_elevation_angle)<0) { // document.getElementById("tilt").innerHTML="Corrected Tilt:"+formatvalue((1*satellite_elevation+first_elevation_angle),3)+" °"; //document.getElementById("googlestreeturl").innerHTML ="\"\"/"; document.getElementById("gstreetpic").innerHTML ="\"\"/"; //alert(first_elevation_angle); } else { } } } function detect_browser(){ document.getElementById("BrowserCodeName").innerHTML=navigator.appCodeName; document.getElementById("BrowserName").innerHTML=navigator.appName; document.getElementById("BrowserVersion").innerHTML=navigator.appVersion; document.getElementById("CookiesEnabled").innerHTML=navigator.cookieEnabled; document.getElementById("Platform").innerHTML=navigator.platform; document.getElementById("Useragentheader").innerHTML=navigator.userAgent; document.getElementById("IE_VER").innerHTML=Browser.Version(); /*
Browser CodeName:
Browser Name:
Browser Version:
Cookies Enabled:
Platform:
User-agent header:
*/ } function plotElevation3(results, status) { // 1 if (status == google.maps.ElevationStatus.OK) { //2 elevations = results; var elevationPath3 = []; // Extract the elevation samples from the returned results // and store them in an array of LatLngs. var current_height_offset=0; horizon_elevation_angle=-2; last_elevation=0; var current_alt_for_this_satellite; var abort_at_index; var obstruction_found="False"; var plotcolour="green"; var min_terrain_elevation,min_terrain_elevation_distance,min_terrain_altitude,height_above_obstruction; var terrain_clearance_in_metersh; var max_elevation_along_path=0; var min_elevation_along_path=10000; // 10000 meters min_terrain_elevation=0; min_terrain_elevation_distance=0; min_terrain_altitude=0; AntennaHightAboveGround=1*document.getElementById("antenna_height").value; //alert(AntennaHightAboveGround); document.getElementById("secondrunfirstloc").innerHTML=""; document.getElementById("secondrunfirstlocdist").innerHTML=""; for (var i = 0; i < results.length; i++) { //3 if (obstruction_found=="False") elevationPath3.push(elevations[i].location); // beregn maks elevasjon her beregn avstand fra site koordinat til gjeldende lokasjon //and than just use the function like that: var loc1 = currentselectedlocation; var loc2 = elevations[i].location; var dist = loc2.distanceFrom(loc1); var lastdist=0; //thiselevation=Math.Adist //&& ( current_alt_for_this_satelliteelevations[i].elevation) min_elevation_along_path=elevations[i].elevation; if (i>0 ){// 4 //height_offset_corrected_for_earth_sfere=compensate_altitude_for_two_locations(loc1,loc2); height_offset_corrected_for_earth_sfere=0; current_height_offset=height_offset_corrected_for_earth_sfere; //height_offset_corrected_for_earth_sfere=0; if (elevations[i].elevation<0) elevations[i].elevation=0 else elevations[i].elevation=elevations[i].elevation+height_offset_corrected_for_earth_sfere; thiselevation=calculate_elevation_angle(dist,1*(elevations[i].elevation-elevations[0].elevation-AntennaHightAboveGround)); if ((thiselevation>last_elevation) && (thiselevation>horizon_elevation_angle)) {//5 horizon_elevation_angle=thiselevation; min_terrain_elevation=thiselevation; min_terrain_elevation_distance=dist; min_terrain_altitude=elevations[i].elevation; height_above_obstruction=calculate_height_from_elevation_and_distance(min_terrain_elevation_distance,satellite_elevation); terrain_clearance_in_meters=1*height_above_obstruction+1*elevations[0].elevation+1*AntennaHightAboveGround-1*min_terrain_altitude; }//5 last_elevation=thiselevation; lastdist=dist; endlocation=elevations[i].location; // alert(dist+" El"+thiselevation+" i="+i+" "+elevations[i].elevation+" - "+elevations[0].elevation+" = "+(elevations[i].elevation-elevations[0].elevation)); // get the last location // må sjekke høyden ved høyeste hinder if ((thiselevation>satellite_elevation) && (obstruction_found=="False")) {//6 // terminate search here, satellite obstructed by terrain obstruction_found="True"; abort_at_index=i; plotcolour="red"; document.getElementById("secondrunfirstloc").innerHTML=formatvalue(thiselevation,3)+"°( "+formatvalue(satellite_elevation,3)+"° ) index="+i+" "+Date(); document.getElementById("secondrunfirstlocdist").innerHTML="First obstruction at "+formatvalue(lastdist,3)+"m "+formatvalue(thiselevation,3)+"° abindex="+abort_at_index+"("+results.length+")"+" "+Date(); // return; }//6 // get the first 4-5 locations and draw a new path } //4 if i>0 }// 3 end*** for (var i = 0; i < results.length; i++)*** //alert(dist+" El"+horizon_elevation_angle); document.getElementById("sat_el").innerHTML=formatvalue(satellite_elevation,3)+" °"; if (satellite_elevation"; } else document.getElementById("el_limit").innerHTML="Satellite is "+formatvalue((satellite_elevation-horizon_elevation_angle),3)+"° below terrain"; if (satellite_elevation==-99) document.getElementById("sat_el").innerHTML="Below horizon °"; } else { document.getElementById("el_limit").style.color="green"; document.getElementById("el_limit").innerHTML="Satellite is "+formatvalue((satellite_elevation-horizon_elevation_angle),3)+"° above terrain"; document.getElementById("sat_el").innerHTML=formatvalue(satellite_elevation,3)+" °"; } sample_resolution=dist/512; document.getElementById("output_belowterrain").innerHTML=document.getElementById("el_limit").innerHTML; document.getElementById("output_belowterrain").style.color=document.getElementById("el_limit").style.color; document.getElementById("el_info").innerHTML="Terrain elevation: "+formatvalue(horizon_elevation_angle,3)+"°
Earth sphere altitude correction="+formatvalue(height_offset_corrected_for_earth_sfere,3)+"m
Distance= "+formatvalue(dist,3)+"m
point to point distance="+formatvalue(copy_pointtopointdistance,3)+"m"+"
Resolution:"+formatvalue((dist/512),3)+" meters per sample"; document.getElementById("terrain_elevation").innerHTML="Max Terrain elevation: "+formatvalue(horizon_elevation_angle,3)+"° at distance "+Math.floor(min_terrain_elevation_distance)+" meters"; document.getElementById("sample_info").innerHTML="Resolution:"+formatvalue((dist/512),3)+" meters per sample"; ifbelowhorison(satellite_elevation,horizon_elevation_angle); document.getElementById("terrain_clearance").innerHTML=Math.floor(terrain_clearance_in_meters)+" meters at distance "+Math.floor(min_terrain_elevation_distance)+" meters"; CurrentAltitude=1*elevations[0].elevation; infowindow.setPosition(currentselectedlocation); var possite = infowindow.getPosition(); if (terrain_clearance_in_meters<0) infowindow.setContent(document.getElementById("sat_name").innerHTML+"@"+document.getElementById("sat_pos").innerHTML+"
Azimuth(true north): "+formatvalue(calculateBearing(currentselectedlocation,satelliteposition), 3)+"°
Elevation: "+formatvalue(satellite_elevation, 3)+"°"+"
"+document.getElementById("output_belowterrain").innerHTML+" ("+Math.floor(terrain_clearance_in_meters)+"meters)
"+document.getElementById("info_popuptext").innerHTML ) else infowindow.setContent(document.getElementById("sat_name").innerHTML+"@"+document.getElementById("sat_pos").innerHTML+"
Azimuth(true north): "+formatvalue(calculateBearing(currentselectedlocation,satelliteposition), 3)+"°
Elevation: "+formatvalue(satellite_elevation, 3)+"°"+"
"+document.getElementById("output_belowterrain").innerHTML+"
"+document.getElementById("info_popuptext").innerHTML ); infowindow.open(map); drawRoadPath2(elevations[1].location); var pathOptions3 = { path: elevationPath3, strokeColor: plotcolour, //'red' opacity: 1, strokeWeight:4, map: map } polyline3 = new google.maps.Polyline(pathOptions3); // Extract the data from which to populate the chart. // Because the samples are equidistant, the 'Sample' // column here does double duty as distance along the // X axis. var data = new google.visualization.DataTable(); var datared = new google.visualization.DataTable(); var altplot; var satpathvalue,altplot2,altitudeclearance; datared.addColumn('string', 'Distance[m]'); datared.addColumn('number', 'Terrain Altitude[m]'); var loc1 = currentselectedlocation; var loc2; var dist; for (var i = 0; i < results.length; i++) { loc2 = elevations[i].location; dist = loc2.distanceFrom(loc1); if (elevations[i].elevation<0) altplot=0 else altplot=elevations[i].elevation; datared.addRow([dist.toString(),1*formatvalue(altplot,5)]); } data.addColumn('string', 'Distance[m]'); data.addColumn('number', 'Terrain Altitude[m]'); data.addColumn('number', 'Terrain clearance[m]'); for (var i = 0; i < results.length; i++) { loc2 = elevations[i].location; dist = loc2.distanceFrom(loc1); if (elevations[i].elevation<0) altplot=0 else altplot=elevations[i].elevation; // datared.addRow([dist,elevations[i].elevation]); // data.addRow([dist.toString(),1*formatvalue(altplot,5)]); if ((i % 2)==0) { satpathvalue=1*Math.floor(1*elevations[0].elevation+1*AntennaHightAboveGround +calculate_height_from_elevation_and_distance(dist,satellite_elevation) ); altplot2=0; } else { satpathvalue=0; altplot2=1*Math.floor(altplot); } altplot2=1*Math.floor(altplot); satpathvalue=1*Math.floor(1*elevations[0].elevation+1*AntennaHightAboveGround+calculate_height_from_elevation_and_distance(dist,satellite_elevation) ); altitudeclearance=Math.floor(satpathvalue-altplot2); if (altitudeclearance<0) altitudeclearance=0; if (satellite_elevation<0) { altitudeclearance=0; altplot2=0; } if ((satpathvalue 50) { // disable in MSIE //chart13 = new google.visualization.SteppedAreaChart(document.getElementById("elevation_chart13")); if (Browser.Version() > 0){ // ie load always document.getElementById("elevation_chart13").style.display = 'inline'; chart13.draw(data, { width: 800, height: 300, backgroundColor: {stroke:'black', fill:'#C0BBB7',strokeSize: 2}, colors: ['red','blue'], isStacked: true, legend:{position:'top'}, vAxis: { title: 'Altitude [m]', viewWindowMode:'explicit', viewWindow:{ max:max_elevation_along_path+100, min:min_elevation_along_path } } }); } // end if (Browser.Version() > 8) //} // end if (Browser.Version() > 50) v2... } // end if (status == google.maps.ElevationStatus.OK) } // end function function testoutput() { return(20); } function Elevation2(SatLon,SiteLat,SiteLon,Height_over_ocean,SatLat,r) { var Rstation,f,r_eq,r_sat,Ra,Rz,alfa_r,alfa_rx,alfa_ry,refraction,alfa_rz,alfa_r_north,alfa_r_zenith,El_geometric,TLE_r_sat var El_observed,Elevation,SatLat var x,a0,a1,a2,a3,a4 var tmpstring; var satposarray=new Array(); a0=0.58804392; a1=-0.17941557 a2=0.29906946E-1; a3=-0.25187400E-2; a4=0.82622101E-4; //tmpstring=document.Satellite.Name.value; //satposarray=tmpstring.split(":"); //TLE_r_sat=1*satposarray[2];//sat r //SatLat=1*satposarray[1];// sat lat // TEST WITH NO FLATTENING f=0;// (1/298.257) ; // Earth flattning factor r_sat=42164.57; // Distance from earth centre to satellite in km r_eq=6378.14 ; // Earth radius in km r_sat=r; //alert("r_sat "+r_sat+" SatLat "+SatLat+" Elevation"); Rstation= r_eq/( Math.sqrt( 1 - f*(2-f)*Math.sin(Radians(SiteLat))*Math.sin(Radians(SiteLat)) ) ) ; Ra= (Rstation+Height_over_ocean)*Math.cos(Radians(SiteLat)) ; Rz= (Rstation*(1-f)*(1-f)+Height_over_ocean)*Math.sin(Radians(SiteLat)); alfa_r=r_sat-Rstation ; /* alfa_rx=r_sat*Math.cos(Radians(SatLon-SiteLon)) -Ra ; alfa_ry=r_sat*Math.sin(Radians(SatLon-SiteLon)) ; alfa_rz=-Rz; */ alfa_rx=r_sat*Math.cos(Radians(SatLat))*Math.cos(Radians(SatLon-SiteLon)) -Ra ; alfa_ry=r_sat*Math.cos(Radians(SatLat))*Math.sin(Radians(SatLon-SiteLon)) ; alfa_rz=r_sat*Math.sin(Radians(SatLat))-Rz; // //alfa_rx=r_sat*Math.cos(Radians(SatLon))*Math.cos(Radians(SatLon-SiteLon)) -Ra ; //alfa_ry=r_sat*Math.cos(Radians(SatLon))*Math.sin(Radians(SatLon-SiteLon)) ; //alfa_rz=r_sat*Math.sin(Radians(SatLon)) -Rz; alfa_r_north=-alfa_rx*Math.sin(Radians(SiteLat)) + alfa_rz*Math.cos(Radians(SiteLat)) ; alfa_r_zenith=alfa_rx*Math.cos(Radians(SiteLat)) +alfa_rz*Math.sin(Radians(SiteLat)) ; El_geometric=Deg(Math.atan2( alfa_r_zenith , Math.sqrt(alfa_r_north*alfa_r_north+alfa_ry*alfa_ry))); //document.Simple.Elevation.value=formatvalue(El_geometric,5); // no earth flattening //alert("El_geometric "+El_geometric+" Elevation"); // END TEST NO FLATTENING f=(1/298.257) ; // Earth flattning factor r_sat=42164.57; // Distance from earth centre to satellite in km r_eq=6378.14 ; // Earth radius in km r_sat=r; // Rstation= r_eq/( Math.sqrt( 1 - f*(2-f)*Math.sin(Radians(SiteLat))*Math.sin(Radians(SiteLat)) ) ) ; Ra= (Rstation+Height_over_ocean)*Math.cos(Radians(SiteLat)) ; Rz= (Rstation*(1-f)*(1-f)+Height_over_ocean)*Math.sin(Radians(SiteLat)); alfa_r=r_sat-Rstation ; //alert(Height_over_ocean); /* alfa_rx=r_sat*Math.cos(Radians(SatLon-SiteLon)) -Ra ; alfa_ry=r_sat*Math.sin(Radians(SatLon-SiteLon)) ; alfa_rz=-Rz; */ alfa_rx=r_sat*Math.cos(Radians(SatLat))*Math.cos(Radians(SatLon-SiteLon)) -Ra ; alfa_ry=r_sat*Math.cos(Radians(SatLat))*Math.sin(Radians(SatLon-SiteLon)) ; alfa_rz=r_sat*Math.sin(Radians(SatLat))-Rz; // //alfa_rx=r_sat*Math.cos(Radians(SatLon))*Math.cos(Radians(SatLon-SiteLon)) -Ra ; //alfa_ry=r_sat*Math.cos(Radians(SatLon))*Math.sin(Radians(SatLon-SiteLon)) ; //alfa_rz=r_sat*Math.sin(Radians(SatLon)) -Rz; alfa_r_north=-alfa_rx*Math.sin(Radians(SiteLat)) + alfa_rz*Math.cos(Radians(SiteLat)) ; alfa_r_zenith=alfa_rx*Math.cos(Radians(SiteLat)) +alfa_rz*Math.sin(Radians(SiteLat)) ; El_geometric=Deg(Math.atan2( alfa_r_zenith , Math.sqrt(alfa_r_north*alfa_r_north+alfa_ry*alfa_ry))); //alert("El_geometric "+El_geometric+" Elevation"); x=Math.abs(El_geometric+0.589); refraction=Math.abs(a0+a1*x+a2*x*x+a3*x*x*x +a4*x*x*x*x) ; if (El_geometric>10.2) { El_observed=El_geometric+0.01617*(Math.cos(Radians(Math.abs(El_geometric)))/Math.sin(Radians(Math.abs(El_geometric))) ); // refraction for high elevation //document.Atmospheric.Refraction.value=formatvalue(0.01617*(Math.cos(Radians(Math.abs(El_geometric)))/Math.sin(Radians(Math.abs(El_geometric))) ),5); } else { El_observed=El_geometric+refraction ; //document.Atmospheric.Refraction.value=formatvalue(refraction,5); } //document.Geometric.Elevation.value=formatvalue(El_geometric,5); // compensated for earth flattening // compensated for b if (alfa_r_zenith<-3000) El_observed=-99; //alert("El_observed "+El_observed+" Elevation"+" refraction " +refraction); //alert(El_observed); return(El_observed); //return(El_observed); // includes flattening and refraction } function Deg(number) { var rad rad=number*180/Math.PI; return(rad) } function infomessage(){ //alert("Kartet er klikkbart nå !\r\nPga. begrensninger i Google map service\r\nmå man vente ca. 8-10 sekunder mellom hver kart klikk!"); } function checkifdblclickdisabled(){ if (doubleclickdisabled=="True") alert("Map not ready.. try again in a few seconds "); } function calculateonsatchange(){ if (doubleclickdisabled=="False") { setsatelliteposition(); setElevationInfoScreen(); SetGoogleMapCookie(); polyline1.setMap(null); drawPath(); setToRed(); polyline3.setMap(null);//pathRequest3.setMap(null); elevationPath3.setMap(null); setToRed(); drawPath3(endlocation); // first setToRed(); } else alert("Map not ready.. try again in a few seconds(doubleclick on selected satellite)"); } function setToRed() { // document.getElementById("waitinfotext").style.color = "red"; // document.getElementById("waitinfotext").innerHTML = "Wait 10 seconds before next click in map !"; // setTimeout ( "setToBlack()", 10000 ); } function setToBlack() { // document.getElementById("waitinfotext").style.color = "blue"; // document.getElementById("waitinfotext").innerHTML = "Ready to accept next click in map !"; } function do_nothing(){ } function formatvalue(num,places) { var strOP,i,decimals,newdecimals,integer,newstring,numcopy var ss=new Array() numcopy=num; var a = Math.pow(10,Math.abs(places) == places ? places : 2); strOP=String(Math.round(num * a) / a).replace(/^(\d)/," $1"); if (num<0) strOP=" "+strOP; // put " " on negative numbers //num=parseFloat(strOP); ss = strOP.split(".");// split string by . what about zero..? if ((num!==0)&&(ss.length>1)) { decimals=ss[1]; integer=ss[0]; if (decimals.length=0) strOP=" "+strOP; return(strOP) } function getgeolocation(){ // Try HTML5 geolocation if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var pos = new google.maps.LatLng(position.coords.latitude,position.coords.longitude); currentselectedlocation=pos; reverseGeocode(currentselectedlocation); // map.setCenter.pos; // infowindow = new google.maps.InfoWindow({ // map: map, // position: pos, // content: 'Location found using HTML5.' // }); setsatelliteposition(); map.setCenter(pos); setElevationInfoScreen(); map.setZoom(13); Lat=currentselectedlocation.lat(); Lon=currentselectedlocation.lng(); document.earth.this_site_longitude.value=Lon; document.earth.this_site_latitude.value=Lat; SetGoogleMapCookie(); polyline1.setMap(null); drawPath(); setToRed(); polyline3.setMap(null);//pathRequest3.setMap(null); elevationPath3.setMap(null); setToRed(); drawPath3(endlocation); // first setToRed(); SetGoogleMapCookie(); }, function() { handleNoGeolocation(true); }); // if navigator.geolocation... } else { // Browser doesn't support Geolocation handleNoGeolocation(false); } } function handleNoGeolocation(errorFlag) { if (errorFlag) { var content = 'Error: The Geolocation service failed.'; } else { var content = 'Error: Your browser doesn\'t support geolocation.'; } } function geocoderequest() { var address = document.getElementById("address").value; geocoder.geocode({ 'address': address, 'partialmatch': true}, geocodeResult); } function geocodeResult(results, status) { if (status == 'OK' && results.length > 0) { map.fitBounds(results[0].geometry.viewport); currentselectedlocation=map.getCenter(); reverseGeocode(currentselectedlocation); map.setZoom(13); setsatelliteposition(); setElevationInfoScreen(); Lat=currentselectedlocation.lat(); Lon=currentselectedlocation.lng(); document.earth.this_site_longitude.value=Lon; document.earth.this_site_latitude.value=Lat; SetGoogleMapCookie(); polyline1.setMap(null); drawPath(); setToRed(); polyline3.setMap(null);//pathRequest3.setMap(null); elevationPath3.setMap(null); setToRed(); drawPath3(endlocation); // first setToRed(); } else { alert("Geocode was not successful for the following reason: " + status); } } function reverseGeocode(sitelocation) { var foundaddress; var reverseGeocodedLast = new Date(); geocoder.geocode({latLng:sitelocation},reverseGeocodeResult); } function reverseGeocodeResult(results, status) { currentReverseGeocodeResponse = results; if(status == 'OK') { if(results.length == 0) { currentAddressResponse="None"; } else { currentAddressResponse=results[0].formatted_address; } } else { currentAddressResponse="Error"; } //alert(currentReverseGeocodeResponse); } function ReadCookie(){ var CookieValue,MyCookieVal,HeightAboveOcean,AntennaSize,ReceiveFrequency,SitePosCurrentIndex; // sitelat,sitelon var ValArray=new Array(); var SubArray=new Array(); SatNameCurrentIndex =0 ; MyCookieVal=readCookieByName("NewSatShadowCalc"); //alert(MyCookieVal); //MyCookieVal=document.cookie; //alert(MyCookieVal); //alert("Read cookiemap "+MyCookieVal); if ((MyCookieVal !== "")&&(MyCookieVal !== null)) // If cookie has value then set users defaults { ValArray=MyCookieVal.split(":"); //' Reads 6 cookie values in to the array Lat=ValArray[0]; LatDir=ValArray[1]; Lon=ValArray[2]; LonDir=ValArray[3]; if (LonDir=="West") Lon=-Lon; if (LatDir=="South") Lat=-Lat; if ( (isNaN(ValArray[11]))||(ValArray[11]=="undefined") ) CurrentAltitude=0 else CurrentAltitude=ValArray[11]; SatNameCurrentIndex=0; if ( (isNaN(ValArray[17]))||(ValArray[17]=="undefined") ) { document.getElementById("antenna_height").value=2; AntennaHightAboveGround=2; } else { document.getElementById("antenna_height").value=1*ValArray[17]; AntennaHightAboveGround=1*ValArray[17]; } if ( (isNaN(ValArray[16]))||(ValArray[16]=="undefined") ) zoomlevel=2 else zoomlevel=1*ValArray[16]; zoom=zoomlevel; } else { // set any Lon,Lat 37.77,-122.42 Lat=3777/100; Lon=(36000-12242)/100; zoom=2; CurrentAltitude=0; zoomlevel=2; // currentselectedlocation = new google.maps.LatLng( Lat,Lon); SatNameCurrentIndex=0; document.getElementById("antenna_height").value=2; AntennaHightAboveGround=2; //SelectSatellite(); // setsatelliteposition(); //SetGoogleMapCookie(); alert("Missing cookies- Using default cookie setting!"); } document.Position.SelectList.selectedIndex=SatNameCurrentIndex; //' Set default Satellite document.earth.this_site_longitude.value=Lon; document.earth.this_site_latitude.value=Lat; //alert(document.getElementById("site_longitude").value); } function SelectSatellite() { var tmpstring; var satposarray=new Array(); tmpstring=document.Position.SelectList.value; satposarray=tmpstring.split(":"); //' Reads 6 cookie values in to the array //satposarray[0];= lon // lat document.getElementById("satellite_latitude").value=satposarray[1]; if (satposarray[0]>180) document.getElementById("satellite_longitude").value=1*satposarray[0]-360 else document.getElementById("satellite_longitude").value=1*satposarray[0]; r_sat=1*satposarray[2]; SatLatitude=1*satposarray[1]; //alert(satposarray[4]); document.getElementById("sat_name").innerHTML=satposarray[4]; document.getElementById("sat_name2").innerHTML=satposarray[4]; //alert(document.getElementById("satellite_longitude").value); // ok } function SetGoogleMapCookie() { var LatDir,LonDir,CookieValue,FullCookieValue//,Lat,Lon,zoom var SitePosCurrentIndex var Calibrate_pulsevalue,Calibrate_pulse_per_ha_degree,calibrate_inc_direction,HeightAboveOcean var cookie11,cookie12,cookie13,cookie14,cookie15,cookie16,cookie17,cookie18,cookie19,cookie20 var ValArray=new Array(); var SubArray=new Array(); MyCookieVal=readCookieByName("NewSatShadowCalc"); //alert("Set cookiemap "+MyCookieVal); if ((MyCookieVal !== "") && (MyCookieVal !== null)) // If cookie has value then set users defaults { ValArray=MyCookieVal.split(":"); //' Reads 6 cookie values in to the array cookie12=ValArray[12]; cookie13=ValArray[13]; cookie14=ValArray[14]; //cookie15=ValArray[15]; cookie16=map.getZoom(); //alert(cookie16); cookie17=ValArray[17]; cookie18=ValArray[18]; cookie19=ValArray[19]; cookie20=ValArray[20]; } else { // set any Lon,Lat 37.77,-122.42 Lat=3777/100; Lon=(36000-12242)/100; zoom=2; CurrentAltitude=0; zoomlevel=2; // currentselectedlocation = new google.maps.LatLng( Lat,Lon); SatNameCurrentIndex=0; document.getElementById("antenna_height").value=2; AntennaHightAboveGround=2; //SelectSatellite(); // setsatelliteposition(); //SetGoogleMapCookie(); alert("Missing cookies- Using default cookie setting!"); } zoomlevel=map.getZoom(); //alert(zoomlevel); //alert("Store cookie"+zoomlevel); //address_found=address.address; if (Lat<0) LatDir="South" else LatDir="North"; if (Lon<0) LonDir="West" else LonDir="East"; Lat=1*Math.abs(Lat); Lon=1*Math.abs(Lon); ValArray[5]=document.Position.SelectList.selectedIndex; //alert(ValArray[5]); //cookie15=address_found; cookie17=1*document.getElementById("antenna_height").value; //alert(ValArray[5]); ValArray[11]=CurrentAltitude; //alert(ValArray[11]); //61.10301827211036:North:7.51039981842041:East:0:231:undefined:NaN:NaN:0:undefined:0:undefined:undefined:undefined:Hanseskogen 31B, 6887 Lærdal, Norway:16:undefined:undefined:undefined //0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 //60.14367412766545:North:10.806244800000059:East:0:230:undefined:NaN:NaN:0:undefined:265:undefined:undefined:undefined:User defined location:15:5:undefined:undefined CookieValue=Lat+":"+LatDir+":"+Lon+":"+LonDir+":"+ValArray[4]+":"+ValArray[5]+":"+ValArray[6]+":"+ValArray[7]+":"+ValArray[8]+":"+ValArray[9]+":"+ValArray[10]+":"+ValArray[11]+":"+cookie12+":"+cookie13+":"+cookie14+":"+cookie15+":"+cookie16+":"+cookie17+":"+cookie19+":"+cookie20+";expires=Tue, 10 Jul 2040 23:59:59 UTC;"; //alert("Delete cookie"); eraseCookie("NewSatShadowCalc","/SatShadow"); //alert("Store new cookie"); createCookieByName("NewSatShadowCalc",CookieValue,365,"/SatShadow") ; //alert(CookieValue); //deleteAllCookies(); //document.cookie=""; //document.cookie =CookieValue +"path=/SatShadow"; // Store cookie //ReadCookie();// for lookangles } function SetGoogleMapZoomCookie() { var CookieValue var cookie11,cookie12,cookie13,cookie14,cookie15,cookie16,cookie17,cookie18,cookie19,cookie20 var ValArray=new Array(); var SubArray=new Array(); //MyCookieVal=document.cookie; MyCookieVal=readCookieByName("NewSatShadowCalc"); //alert("Set cookiemap "+MyCookieVal); if ((MyCookieVal !== "") && (MyCookieVal !== null)) // If cookie has value then set users defaults { ValArray=MyCookieVal.split(":"); //' Reads 6 cookie values in to the array cookie12=ValArray[12]; cookie13=ValArray[13]; cookie14=ValArray[14]; cookie15=ValArray[15]; cookie16=map.getZoom(); cookie17=ValArray[17]; cookie18=ValArray[18]; cookie19=ValArray[19]; cookie20=ValArray[20]; } //else alert("No Cookie stored"); //zoomlevel=map.getZoom(); CookieValue=ValArray[0]+":"+ValArray[1]+":"+ValArray[2]+":"+ValArray[3]+":"+ValArray[4]+":"+ValArray[5]+":"+ValArray[6]+":"+ValArray[7]+":"+ValArray[8]+":"+ValArray[9]+":"+ValArray[10]+":"+ValArray[11]+":"+cookie12+":"+cookie13+":"+cookie14+":"+cookie15+":"+cookie16+":"+cookie17+":"+cookie19+":"+cookie20+";expires=Tue, 10 Jul 2040 23:59:59 UTC;"; //deleteAllCookies(); //document.cookie=""; //document.cookie =CookieValue+"path=/SatShadow/SatShadow_noads_arginput_test.htm;"; // Store cookie eraseCookie("NewSatShadowCalc","/SatShadow"); createCookieByName("NewSatShadowCalc",CookieValue,365,"/SatShadow") ; } function deleteAllCookies() { var cookies = document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; var eqPos = cookie.indexOf("="); var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie; document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; } } // if the browser is IE and versionnumber less than 9 load old columnchart, other browsers & IE9 load new corechart if (Browser.Version() < 55) google.load("visualization", "1", {packages: ["columnchart"]}) else google.load("visualization", "1", {packages:["corechart"]}); //if (Browser.Version() > 8) google.load("visualization", "1", {packages:["corechart"]}); //alert('Browser version: '+Browser.Version()); //google.load("visualization", "1", {packages:["corechart"]}); // temp test 16 aug //google.setOnLoadCallback(initialize); //google.setOnLoadCallback(setposition);