
function RemoteFlightTrackerUpdate(id,aa,ba){this.id=id;this.guid=aa;this.adType=ba;this.statusCode='';this.status='';this.latitude=0;this.longitude=0;this.formattedLatitude='';this.formattedLongitude='';this.altitude=0;this.altitudeInMeters=0;this.speedInMiles=0;this.speedInKM=0;this.bearing=0;this.distanceToTravelInMiles=0;this.distanceToTravelInKM=0;this.distanceTraveledInMiles=0;this.distanceTraveledInKM=0;this.actualAircraftType='';this.scheduledAircraftType='';this.secure=false;this.actualAirTime='';this.actualBlockTime='';this.lastLatitude=0;this.lastLongitude=0;this.latlng=[];this.checkAgain=1;this.actualGateDepartureDate='';this.estimatedGateDepartureDate='';this.actualRunwayDepartureDate='';this.estimatedRunwayDepartureDate='';this.actualGateArrivalDate='';this.estimatedGateArrivalDate='';this.actualRunwayArrivalDate='';this.estimatedRunwayArrivalDate='';this.international='';}
RemoteFlightTrackerUpdate.prototype.getHTTPRequest=function(){if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest();else if(typeof ActiveXObject!="undefined"){try{return new ActiveXObject("Msxml2.XMLHTTP");}
catch(exception){try{return new ActiveXObject("Microsoft.XMLHTTP");}
catch(exception2){}}}
return null;}
RemoteFlightTrackerUpdate.prototype.requestUpdate=function(ca){var da=this.getHTTPRequest();if(da==null)return;var ea=null;if((null!=this.secure)&&(this.secure))ea=contextPath+"/FlightTracker/flightTrackerUpdate.do";else ea=contextPath+"/FlightTracker/flightTrackerUpdate.do";ea+="?id="+this.id;if(null!=guid)ea+="&guid="+this.guid;if(null!=adType)ea+="&adType="+this.adType;var fa=this;da.open("get",ea,true);da.onreadystatechange=function(){if(da.readyState==4){if(null==da.responseXML)return;var ga=[];var ha=da.responseXML.getElementsByTagName("Flight");if(ha.length==1){fa.statusCode=ha[0].getAttribute("StatusCode");fa.status=ha[0].getAttribute("Status");fa.latitude=ha[0].getAttribute("Latitude");fa.formattedLatitude=ha[0].getAttribute("FormattedLatitude");fa.longitude=ha[0].getAttribute("Longitude");if(fa.latitude&&fa.longitude&&(fa.lastLatitude!=fa.latitude)&&(fa.lastLongitude!=fa.longitude)){fa.lastLatitude=fa.latitude;fa.lastLongitude=fa.longitude;fa.latlng.push(new GLatLng(fa.latitude,fa.longitude));}
fa.formattedLongitude=ha[0].getAttribute("FormattedLongitude");fa.altitude=ha[0].getAttribute("Altitude");fa.altitudeInMeters=ha[0].getAttribute("AltitudeInMeters");fa.speedInMiles=ha[0].getAttribute("SpeedInMiles");fa.speedInKM=ha[0].getAttribute("SpeedInKM");fa.bearing=ha[0].getAttribute("Bearing");fa.distanceToTravelInMiles=ha[0].getAttribute("DistanceToTravelInMiles");fa.distanceToTravelInKM=ha[0].getAttribute("DistanceToTravelInKM");fa.distanceTraveledInMiles=ha[0].getAttribute("DistanceTraveledInMiles");fa.distanceTraveledInKM=ha[0].getAttribute("DistanceTraveledInKM");fa.actualAircraftType=ha[0].getAttribute("ActualAircraftType");fa.scheduledAircraftType=ha[0].getAttribute("ScheduledAircraftType");fa.actualBlockTime=ha[0].getAttribute("ActualBlockTime");fa.actualAirTime=ha[0].getAttribute("ActualAirTime");fa.actualGateDepartureDate=ha[0].getAttribute("ActualGateDepartureDate");fa.estimatedGateDepartureDate=ha[0].getAttribute("EstimatedGateDepartureDate");fa.actualRunwayDepartureDate=ha[0].getAttribute("ActualRunwayDepartureDate");fa.estimatedRunwayDepartureDate=ha[0].getAttribute("EstimatedRunwayDepartureDate");fa.actualGateArrivalDate=ha[0].getAttribute("ActualGateArrivalDate");fa.estimatedGateArrivalDate=ha[0].getAttribute("EstimatedGateArrivalDate");fa.actualRunwayArrivalDate=ha[0].getAttribute("ActualRunwayArrivalDate");fa.estimatedRunwayArrivalDate=ha[0].getAttribute("EstimatedRunwayArrivalDate");fa.international=ha[0].getAttribute("International");}
ha=da.responseXML.getElementsByTagName("Results");fa.checkAgain=ha[0].getAttribute("CheckAgain");ca.call();}};da.send(null);}
var adHtml="";var snippetCache=[];var snippetShowing=null;var dateStartedInMilliseconds=(new Date()).getTime();var updateFrequency=1;var dateLastUpdated=null;function cachedSnippet(aa,ba){this.url=aa;this.timeToCache=ba;this.div=null;this.lastDisplayed=null;this.reload=false;}
function hideAd(){var ad=xGetElementById("ad");ad.style.visibility="hidden";}
function showAd(){hideSnippet();var ad=xGetElementById("ad");xInnerHtml(ad,adHtml);ad.style.visibility="visible";xZIndex(ad,99);}
function hideSnippet(){if(null!=snippetShowing){snippetShowing.div.style.visibility="hidden";snippetShowing=null;}}
function showSnippet(){index=Math.floor(Math.random()*107);var ca=snippetCache[Math.floor(Math.random()*snippetCache.length)];if((-1!=ca.timeToCache)&&(null!=ca.lastDisplayed)){var da=((new Date().valueOf())-ca.lastDisplayed)/1000;if(da>ca.timeToCache)ca.reload=true;}
if((ca.div==null)||(ca.reload==true)){ca.reload=false;if(ca.div==null){var ea=xCreateElement("div");ea.style.position='absolute';ea.style.visibility="hidden";ea.style.width=300+"px";ea.style.height=250+"px";ea.style.top="0px";ea.style.left="0px";var fa=xGetElementById('topRightBlockAdSense');xAppendChild(fa,ea);ca.div=ea;}
xInnerHtml(ca.div,ca.url);ca.lastDisplayed=new Date().valueOf();}
hideAd();ca.div.style.visibility="visible";xZIndex(ca,99);snippetShowing=ca;}
var autoZoom=true;var mapStyle="street";var mapControl=null;var dialogUp=false;var flightHistoryId;var timerId;var flightTrackerUpdate;var updateRef=0;var polyline;var initialLatLong=[];var departLatitude=999.0;var departLongitude=999.0;var arriveLatitude=999.0;var arriveLongitude=999.0;var flightLatitude=999.0;var flightLongitude=999.0;var showMap=false;var map;var flightMarker;var firstCall=true;var justLoaded=true;var status="";var guid="";var adType="";trackerLoad=function(){flightMapLoad();flightTrackerUpdate=new RemoteFlightTrackerUpdate(flightHistoryId,guid,adType);if(initialLatLong.length!=0){flightTrackerUpdate.latlng=initialLatLong.reverse();flightTrackerUpdate.lastLatitude=flightLatitude;flightTrackerUpdate.lastLongitude=flightLongitude;if(!xIE4Up||isIE7orUp()){polyline=new GPolyline(flightTrackerUpdate.latlng,'#FF6633');map.addOverlay(polyline);}}
else flightTrackerUpdate.latlng=[];timerId=setTimeout("updateTracker()",10);}
trackerUnLoad=function(){stopTracker();}
function updateTracker(){updateRef++;clearTimeout(timerId);timerId=0;if(updateRef==1){var ga=new Date();var ha=updateFrequency*60000;if((dateLastUpdated==null)||((ga.getTime()-dateLastUpdated.getTime())>ha)){flightTrackerUpdate.requestUpdate(trackerCallback);dateLastUpdated=new Date();}
else{timerId=setTimeout("updateTracker()",10000);}
if(updateFrequency=1){if((ga.getTime()-dateStartedInMilliseconds)>=120000)updateFrequency=3;}
if(!justLoaded)showAd();else justLoaded=false;}
else{if(updateRef==2){if(showMap){xGetElementById("map").style.visibility="visible";xGetElementById("mapmenu").style.visibility="visible";var ia=new GLatLng(flightTrackerUpdate.latitude,flightTrackerUpdate.longitude);map.setCenter(ia);if(autoZoom)map.setZoom(5);else if(mapStyle=="rotate")map.setMapType(G_HYBRID_MAP);}}
else if(updateRef==3){if(showMap&&autoZoom&&mapStyle=="rotate")map.setMapType(G_HYBRID_MAP);}
else if(updateRef==4){showSnippet();if(showMap){var ia=new GLatLng(flightTrackerUpdate.latitude,flightTrackerUpdate.longitude);map.setCenter(ia);if(autoZoom)map.setZoom(7);else if(mapStyle=="rotate")map.setMapType(G_SATELLITE_MAP);}}
else if(updateRef==5){if(showMap&&autoZoom&&mapStyle=="rotate")map.setMapType(G_SATELLITE_MAP);}
else if(updateRef==6){updateRef=0;if(showMap){if(autoZoom)map.setZoom(3);else if(mapStyle=="rotate")map.setMapType(G_NORMAL_MAP);}}
timerId=setTimeout("updateTracker()",10000);}}
trackerCallback=function(){if(flightTrackerUpdate.formattedLatitude)xInnerHtml(xGetElementById("flightFormattedLatitude"),flightTrackerUpdate.formattedLatitude);else xInnerHtml(xGetElementById("flightFormattedLatitude"),"Unknown");if(flightTrackerUpdate.formattedLongitude)xInnerHtml(xGetElementById("flightFormattedLongitude"),flightTrackerUpdate.formattedLongitude);else xInnerHtml(xGetElementById("flightFormattedLongitude"),"Unknown");if(flightTrackerUpdate.altitude)xInnerHtml(xGetElementById("altitude"),flightTrackerUpdate.altitude+" feet ("+flightTrackerUpdate.altitudeInMeters+" meters)");else xInnerHtml(xGetElementById("altitude"),"Unknown");if(flightTrackerUpdate.bearing)xInnerHtml(xGetElementById("bearing"),flightTrackerUpdate.bearing);else xInnerHtml(xGetElementById("bearing"),"Unknown");xInnerHtml(xGetElementById("scheduledAircraftType"),flightTrackerUpdate.scheduledAircraftType+" (Scheduled)");xInnerHtml(xGetElementById("actualAircraftType"),flightTrackerUpdate.actualAircraftType+" (Actual)");if(flightTrackerUpdate.scheduledAircraftType)xGetElementById("scheduledAircraftTypeRow").className="show";else xGetElementById("scheduledAircraftTypeRow").className="hide";if(flightTrackerUpdate.actualAircraftType)xGetElementById("actualAircraftTypeRow").className="show";else xGetElementById("actualAircraftTypeRow").className="hide";if(flightTrackerUpdate.distanceToTravelInMiles)xInnerHtml(xGetElementById("distanceToTravel"),flightTrackerUpdate.distanceToTravelInMiles+" miles ("+flightTrackerUpdate.distanceToTravelInKM+" km)");else xInnerHtml(xGetElementById("distanceToTravel"),"Unknown");if(flightTrackerUpdate.distanceTraveledInMiles)xInnerHtml(xGetElementById("distanceTraveled"),flightTrackerUpdate.distanceTraveledInMiles+" miles ("+flightTrackerUpdate.distanceTraveledInKM+" km)");else xInnerHtml(xGetElementById("distanceTraveled"),"Unknown");if(flightTrackerUpdate.speedInMiles)xInnerHtml(xGetElementById("speed"),flightTrackerUpdate.speedInMiles+" mph ("+flightTrackerUpdate.speedInKM+" kph)");else xInnerHtml(xGetElementById("speed"),"Unknown");if(flightTrackerUpdate.actualGateDepartureDate)xInnerHtml(xGetElementById("departureActual"),flightTrackerUpdate.actualGateDepartureDate);else if(flightTrackerUpdate.actualRunwayDepartureDate)xInnerHtml(xGetElementById("departureActual"),flightTrackerUpdate.actualRunwayDepartureDate+" (runway)");else if(flightTrackerUpdate.estimatedGateDepartureDate)xInnerHtml(xGetElementById("departureActual"),flightTrackerUpdate.estimatedGateDepartureDate+" (Estimated)");else if(flightTrackerUpdate.estimatedRunwayDepartureDate)xInnerHtml(xGetElementById("departureActual"),flightTrackerUpdate.estimatedRunwayDepartureDate+" (Estimated runway)");if(flightTrackerUpdate.actualGateArrivalDate)xInnerHtml(xGetElementById("arrivalActual"),flightTrackerUpdate.actualGateArrivalDate);else if(flightTrackerUpdate.actualRunwayArrivalDate)xInnerHtml(xGetElementById("arrivalActual"),flightTrackerUpdate.actualRunwayArrivalDate+" (runway)");else if(flightTrackerUpdate.estimatedGateArrivalDate)xInnerHtml(xGetElementById("arrivalActual"),flightTrackerUpdate.estimatedGateArrivalDate+" (Estimated)");else if(flightTrackerUpdate.estimatedRunwayArrivalDate)xInnerHtml(xGetElementById("arrivalActual"),flightTrackerUpdate.estimatedRunwayArrivalDate+" (Estimated runway)");xInnerHtml(xGetElementById("status"),flightTrackerUpdate.status);if((null!=flightTrackerUpdate.longitude)&&(null!=flightTrackerUpdate.latitude)&&(null!=flightTrackerUpdate.bearing)){var ja=new GPoint(flightTrackerUpdate.longitude,flightTrackerUpdate.latitude);var ka=new GLatLng(flightTrackerUpdate.latitude,flightTrackerUpdate.longitude);var la=createIcon(getPlaneImageUrl(flightTrackerUpdate.bearing),25,25);if(flightMarker)map.removeOverlay(flightMarker);flightMarker=new GMarker(ja,la);map.addOverlay(flightMarker);if(!xIE4Up||isIE7orUp()){if(polyline)map.removeOverlay(polyline);if(flightTrackerUpdate.latlng.length>1){polyline=new GPolyline(flightTrackerUpdate.latlng,'#FF6633');map.addOverlay(polyline);}}
var ma=map.getBounds();var na=map.fromLatLngToDivPixel(ma.getNorthEast());var oa=map.fromLatLngToDivPixel(ma.getSouthWest());var pa=map.fromLatLngToDivPixel(ka);if((pa.x+30)>=na.x)map.panTo(ka);if((pa.y-30)<=na.y)map.panTo(ka);if((pa.x-30)<=oa.x)map.panTo(ka);if((pa.y+30)>=oa.y)map.panTo(ka);}
xGetElementById("map").style.visibility="hidden";xGetElementById("mapmenu").style.visibility="hidden";xGetElementById("scheduledInfo").style.visibility="hidden";xGetElementById("errorPositionInfo").style.visibility="hidden";xGetElementById("errorPositionalInternationalDep").style.visibility="hidden";xGetElementById("errorPositionalInternationalArr").style.visibility="hidden";xGetElementById("departedGateInfo").style.visibility="hidden";if(flightTrackerUpdate.statusCode=="L"){if(flightTrackerUpdate.scheduledAircraftType){xInnerHtml(xGetElementById("landed_scheduledAircraftType"),flightTrackerUpdate.scheduledAircraftType);xGetElementById("landed_scheduledAircraftTypeRow").className="show";}
if(flightTrackerUpdate.actualAircraftType){xInnerHtml(xGetElementById("landed_actualAircraftType"),flightTrackerUpdate.actualAircraftType);xGetElementById("landed_actualAircraftTypeRow").className="show";}
if(flightTrackerUpdate.actualBlockTime){xInnerHtml(xGetElementById("landed_duration"),getDuration(flightTrackerUpdate.actualBlockTime));xGetElementById("landed_durationRow").className="show";}
else if(flightTrackerUpdate.actualAirTime){xInnerHtml(xGetElementById("landed_duration"),getDuration(flightTrackerUpdate.actualAirTime)+" (runway to runway)");xGetElementById("landed_durationRow").className="show";}
xInnerHtml(xGetElementById("landed_status"),flightTrackerUpdate.status);xGetElementById("landedInfo").style.visibility="visible";showMap=false;}
else if(flightTrackerUpdate.statusCode=="D"){xInnerHtml(xGetElementById("diverted_status"),flightTrackerUpdate.status);xGetElementById("divertedInfo").style.visibility="visible";showMap=false;}
else if(flightTrackerUpdate.statusCode=="C"){xGetElementById("cancelledInfo").style.visibility="visible";showMap=false;}
else if(flightTrackerUpdate.statusCode=="S"){xGetElementById("scheduledInfo").style.visibility="visible";showMap=false;timerId=setTimeout("updateTracker()",flightTrackerUpdate.checkAgain);}
else if((flightTrackerUpdate.statusCode=="A")||(flightTrackerUpdate.statusCode=="R")){if(!flightTrackerUpdate.latitude&&!flightTrackerUpdate.longitude){if(flightTrackerUpdate.actualGateDepartureDate&&!flightTrackerUpdate.actualRunwayDepartureDate&&(flightTrackerUpdate.international!="Dep")){xGetElementById("departedGateInfo").style.visibility="visible";showMap=false;}
else{if(flightTrackerUpdate.international=="Dep")xGetElementById("errorPositionalInternationalDep").style.visibility="visible";else if(flightTrackerUpdate.international=="Arr")xGetElementById("errorPositionalInternationalArr").style.visibility="visible";else xGetElementById("errorPositionInfo").style.visibility="visible";showMap=false;}}
else if(firstCall){xGetElementById("map").style.visibility="visible";xGetElementById("mapmenu").style.visibility="visible";showMap=true;firstCall=false;}
else{xGetElementById("map").style.visibility="visible";xGetElementById("mapmenu").style.visibility="visible";showMap=true;}
timerId=setTimeout("updateTracker()",10000);}
else{xGetElementById("unknownInfo").style.visibility="visible";showMap=false;}}
function getDuration(qa){var ra=Math.floor(qa/60);var sa=qa-(ra*60);return ra+" hours "+sa+" minutes"}
function stopTracker(){if(timerId){clearTimeout(timerId);timerId=0;}}
function createIcon(ta,ua,h){var va=new GIcon();va.image=ta;va.iconSize=new GSize(ua,h);va.iconAnchor=new GPoint(ua/2,h/2);va.infoWindowAnchor=new GPoint(ua/2,h/2);return va;}
function getPlaneImageUrl(wa){image='//dem5xqcn61lj8.cloudfront.net/AirportTracker/airplane_sm_orange_';if((wa>348.75)||(wa<=11.25))return image+"360.png";else if((wa>11.25)&&(wa<=33.75))return image+"22_5.png";else if((wa>33.75)&&(wa<=56.25))return image+"45.png";else if((wa>56.25)&&(wa<=78.75))return image+"67_5.png";else if((wa>78.75)&&(wa<=101.25))return image+"90.png";else if((wa>101.25)&&(wa<=123.75))return image+"112_5.png";else if((wa>123.75)&&(wa<=146.25))return image+"135.png";else if((wa>146.25)&&(wa<=168.75))return image+"157_5.png";else if((wa>168.75)&&(wa<=191.25))return image+"180.png";else if((wa>191.25)&&(wa<=213.75))return image+"202_5.png";else if((wa>213.75)&&(wa<=236.25))return image+"225.png";else if((wa>236.25)&&(wa<=258.75))return image+"247_5.png";else if((wa>258.75)&&(wa<=281.25))return image+"270.png";else if((wa>281.25)&&(wa<=303.75))return image+"292_5.png";else if((wa>303.75)&&(wa<=326.25))return image+"315.png";else return image+"337_5.png";}
function setupGoogleMap(xa,ya,za){if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map"));map.setCenter(new GLatLng(xa,ya),za);GEvent.addListener(map,"click",function(){changeAutoZoom(false);});GEvent.addListener(map,"dragstart",function(){changeAutoZoom(false);});if((flightLatitude!=999.0)||(flightLongitude!=999.0)){var Aa=new GPoint(flightLongitude,flightLatitude);var Ba=createIcon(getPlaneImageUrl(bearingToArrival),25,25);flightMarker=new GMarker(Aa,Ba);map.addOverlay(flightMarker);}
if((departLatitude!=999.0)||(departLongitude!=999.0)){var Ca=new GPoint(departLongitude,departLatitude);var Da=createIcon("//dem5xqcn61lj8.cloudfront.net/FlightTracker/icon_airport_depart.png",36,36);var Ea=new GMarker(Ca,Da);var Fa=new GMarker(Ca,Da);map.addOverlay(Fa);}
if((arriveLatitude!=999.0)||(arriveLongitude!=999.0)){var Ga=new GPoint(arriveLongitude,arriveLatitude);var Ha=createIcon("//dem5xqcn61lj8.cloudfront.net/FlightTracker/icon_airport_arrive.png",36,36);var Ia=new GMarker(Ga,Ha);map.addOverlay(Ia);}
setTileOverlays(weather_tiles_url,false);if(showRadar)toggleOV('radar');}}
function flightMapLoad(){var Ja=4;if(status=="S"||status=="C"){flightLatitude=departLatitude;flightLongitude=departLongitude;}
else if(status=="L"){flightLatitude=arriveLatitude;flightLongitude=arriveLongitude;}
setupGoogleMap(flightLatitude,flightLongitude,Ja);}
xAddEventListener(window,'load',trackerLoad,false);xAddEventListener(window,'unLoad',stopTracker,false);function changeFTImages(Ka,La,Ma){if(Ma==1)xGetElementById(Ka).src='//dem5xqcn61lj8.cloudfront.net/FlightTracker/'+La+'_over.gif';else if(Ma==2)xGetElementById(Ka).src='//dem5xqcn61lj8.cloudfront.net/FlightTracker/'+La+'_on.gif';else xGetElementById(Ka).src='//dem5xqcn61lj8.cloudfront.net/FlightTracker/'+La+'_off.gif';}
function toggleAutoZoom(){changeAutoZoom(!autoZoom);}
function changeAutoZoom(Na){autoZoom=Na;if(autoZoom){if(mapControl){map.removeControl(mapControl);mapControl=null;}
xGetElementById("autoZoom").checked=true;}
else if(!mapControl){mapControl=new GSmallMapControl();map.addControl(mapControl);xGetElementById("autoZoom").checked=false;}}
function showOptions(){if(dialogUp)return;xGetElementById("options").style.visibility="visible";var Oa=xGetElementById("optionsForm");if(mapStyle=="street")Oa.mapStyle[0].checked=true;else if(mapStyle=="satellite")Oa.mapStyle[1].checked=true;else if(mapStyle=="hybrid")Oa.mapStyle[2].checked=true;else Oa.mapStyle[3].checked=true;Oa.autoZoom.checked=autoZoom;dialogUp=true;}
function hideOptions(Pa){xGetElementById("options").style.visibility="hidden";if(Pa){var Qa=xGetElementById("optionsForm");if(Qa.mapStyle[0].checked){map.setMapType(G_NORMAL_MAP);mapStyle="street";}
else if(Qa.mapStyle[1].checked){map.setMapType(G_SATELLITE_MAP);mapStyle="satellite";}
else if(Qa.mapStyle[2].checked){map.setMapType(G_HYBRID_MAP);mapStyle="hybrid";}
else mapStyle="rotate";changeAutoZoom(Qa.autoZoom.checked);}
dialogUp=false;}
function setMapType(Ra){if(Ra=='street'){map.setMapType(G_NORMAL_MAP);mapStyle="street";}
else if(Ra=='satellite'){map.setMapType(G_SATELLITE_MAP);mapStyle="satellite";}
else if(Ra=='hybrid'){map.setMapType(G_HYBRID_MAP);mapStyle="hybrid";}
else if(Ra=='physical'){map.setMapType(G_PHYSICAL_MAP);mapStyle="physical";}
else mapStyle="rotate";}
function AirNavGoogleMapControl(){}
AirNavGoogleMapControl.prototype=new GControl(true);AirNavGoogleMapControl.prototype.initialize=function(aa){var ba=document.createElement('div');ba.innerHTML='<div class="airNavCredit">Certain Flight Positional Data Provided by <a target="_blank" href="http://www.airnavsystems.com/cgi-bin/ANserver/ANOrder.exe?action=visit&referrer=flightstats">AirNav Systems</a></div>';aa.getContainer().appendChild(ba);return ba;}
AirNavGoogleMapControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(0,5));}
var overlay_array=new Array();var weather_tiles_dict={2:['x0y1','x1y1'],3:['x0y2','x0y3','x1y2','x1y3','x2y2','x2y3'],4:['x0y4','x0y5','x0y6','x0y7','x1y4','x1y5','x1y6','x1y7','x2y4','x2y5','x2y6','x2y7','x3y4','x3y5','x3y6','x3y7','x4y4','x4y5','x4y6','x4y7','x5y4','x5y5','x5y6','x5y7'],5:['x0y8','x0y9','x0y10','x0y11','x0y12','x0y13','x0y14','x1y8','x1y9','x1y10','x1y11','x1y12','x1y13','x1y14','x2y8','x2y9','x2y10','x2y11','x2y12','x2y13','x2y14','x3y8','x3y9','x3y10','x3y11','x3y12','x3y13','x3y14','x4y8','x4y9','x4y10','x4y11','x4y12','x4y13','x4y14','x5y8','x5y9','x5y10','x5y11','x5y12','x5y13','x5y14','x6y8','x6y9','x6y10','x6y11','x6y12','x6y13','x6y14','x7y8','x7y9','x7y10','x7y11','x7y12','x7y13','x7y14','x8y8','x8y9','x8y10','x8y11','x8y12','x8y13','x8y14','x9y8','x9y9','x9y10','x9y11','x9y12','x9y13','x9y14','x10y8','x10y9','x10y10','x10y11','x10y12','x10y13','x10y14'],6:['x0y16','x0y17','x0y18','x0y19','x0y20','x0y21','x0y22','x0y23','x0y24','x0y25','x0y26','x0y27','x0y28','x1y16','x1y17','x1y18','x1y19','x1y20','x1y21','x1y22','x1y23','x1y24','x1y25','x1y26','x1y27','x1y28','x2y16','x2y17','x2y18','x2y19','x2y20','x2y21','x2y22','x2y23','x2y24','x2y25','x2y26','x2y27','x2y28','x3y16','x3y17','x3y18','x3y19','x3y20','x3y21','x3y22','x3y23','x3y24','x3y25','x3y26','x3y27','x3y28','x4y16','x4y17','x4y18','x4y19','x4y20','x4y21','x4y22','x4y23','x4y24','x4y25','x4y26','x4y27','x4y28','x5y16','x5y17','x5y18','x5y19','x5y20','x5y21','x5y22','x5y23','x5y24','x5y25','x5y26','x5y27','x5y28','x6y16','x6y17','x6y18','x6y19','x6y20','x6y21','x6y22','x6y23','x6y24','x6y25','x6y26','x6y27','x6y28','x7y16','x7y17','x7y18','x7y19','x7y20','x7y21','x7y22','x7y23','x7y24','x7y25','x7y26','x7y27','x7y28','x8y16','x8y17','x8y18','x8y19','x8y20','x8y21','x8y22','x8y23','x8y24','x8y25','x8y26','x8y27','x8y28','x9y16','x9y17','x9y18','x9y19','x9y20','x9y21','x9y22','x9y23','x9y24','x9y25','x9y26','x9y27','x9y28','x10y16','x10y17','x10y18','x10y19','x10y20','x10y21','x10y22','x10y23','x10y24','x10y25','x10y26','x10y27','x10y28','x11y16','x11y17','x11y18','x11y19','x11y20','x11y21','x11y22','x11y23','x11y24','x11y25','x11y26','x11y27','x11y28','x12y16','x12y17','x12y18','x12y19','x12y20','x12y21','x12y22','x12y23','x12y24','x12y25','x12y26','x12y27','x12y28','x13y16','x13y17','x13y18','x13y19','x13y20','x13y21','x13y22','x13y23','x13y24','x13y25','x13y26','x13y27','x13y28','x14y16','x14y17','x14y18','x14y19','x14y20','x14y21','x14y22','x14y23','x14y24','x14y25','x14y26','x14y27','x14y28','x15y16','x15y17','x15y18','x15y19','x15y20','x15y21','x15y22','x15y23','x15y24','x15y25','x15y26','x15y27','x15y28','x16y16','x16y17','x16y18','x16y19','x16y20','x16y21','x16y22','x16y23','x16y24','x16y25','x16y26','x16y27','x16y28','x17y16','x17y17','x17y18','x17y19','x17y20','x17y21','x17y22','x17y23','x17y24','x17y25','x17y26','x17y27','x17y28','x18y16','x18y17','x18y18','x18y19','x18y20','x18y21','x18y22','x18y23','x18y24','x18y25','x18y26','x18y27','x18y28','x19y16','x19y17','x19y18','x19y19','x19y20','x19y21','x19y22','x19y23','x19y24','x19y25','x19y26','x19y27','x19y28','x20y16','x20y17','x20y18','x20y19','x20y20','x20y21','x20y22','x20y23','x20y24','x20y25','x20y26','x20y27','x20y28',]};function createRadarTiles(aa){var ba=aa+'/radar';var ca=new GTileLayer(new GCopyrightCollection(''),2,6);ca.getTileUrl=function(da,ea){if(weather_tiles_dict[ea]&&checkArray(weather_tiles_dict[ea],'x'+da.x+'y'+da.y)){return ba+'/z'+ea+'/radar_tile_z'+ea+'x'+da.x+'y'+da.y+'.png';}
else{return'//dem5xqcn61lj8.cloudfront.net/GoogleMapTiles/radar_blank_tile.png';}};ca.isPng=function(){return true;}
ca.getOpacity=function(){return 0.45;}
return ca;}
function checkArray(fa,ga){for(i=0;i<fa.length;i++){if(fa[i]==ga){return true;}}
return false;}
function setTileOverlays(ha,ia){overlay_array['radar']=new Array();overlay_array['radar']['status']=0;overlay_array['radar']['ov']=new GTileLayerOverlay(createRadarTiles(ha));if(ia){overlay_array['traffic']=new Array();overlay_array['traffic']['status']=0;overlay_array['traffic']['ov']=new GTrafficOverlay();}}
function toggleOV(ja){if(ja=='radar'){if(!overlay_array['radar']['status']){map.addOverlay(overlay_array['radar']['ov']);overlay_array['radar']['status']=1;}
else{map.removeOverlay(overlay_array['radar']['ov']);overlay_array['radar']['status']=0;}}
else if(ja=='traffic'){if(!overlay_array['traffic']['status']){map.addOverlay(overlay_array['traffic']['ov']);overlay_array['traffic']['status']=1;}
else{map.removeOverlay(overlay_array['traffic']['ov']);overlay_array['traffic']['status']=0;}}}
function refreshOV(ka){if(ka=='radar'){if(overlay_array['radar']['status']){toggleOV('radar');toggleOV('radar');}}}
