function addCommonMapListeners(){var C=function zoomPics(){GEvent.addListener(map,'zoomend',function(aa,ba){checkPanZoomPics(ba);});}
setTimeout(C,0);}
function checkPanZoomPics(ca){if(ca>=map.getCurrentMapType().getMaximumResolution()){document.images['map_zoom_in'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_in_inactive.png';document.images['map_zoom_out'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_out_off.png';document.getElementById('zoom_in').style.cursor='auto';document.getElementById('zoom_out').style.cursor='pointer';}
else if(ca<=map.getCurrentMapType().getMinimumResolution()){document.images['map_zoom_in'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_in_off.png';document.images['map_zoom_out'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_out_inactive.png';document.getElementById('zoom_in').style.cursor='pointer';document.getElementById('zoom_out').style.cursor='auto';}
else{if(document.images['map_zoom_in'].src.indexOf("zoom_in_over")==-1){document.images['map_zoom_in'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_in_off.png';}
if(document.images['map_zoom_out'].src.indexOf("zoom_out_over")==-1){document.images['map_zoom_out'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_out_off.png';}
document.getElementById('zoom_in').style.cursor='pointer';document.getElementById('zoom_out').style.cursor='pointer';}}
function mapZoom(da){if(da==1){map.zoomIn();}
else map.zoomOut();}
function pan(x,y){map.panDirection(x,y);}
function mapType(ea){if(ea=='custom'){map.setMapType(fs_map_type);}
else if(ea=='streets'){map.setMapType(G_NORMAL_MAP);}
else if(ea=='sat'){map.setMapType(G_SATELLITE_MAP);}
else if(ea=='hybrid'){map.setMapType(G_HYBRID_MAP);}
else if(ea=='physical'){map.setMapType(G_PHYSICAL_MAP);}
else map.setMapType(fs_map_type);}
function exchangeImg(fa,ga,ha,ia){document.images[fa].src=ga;if(ha){if(fa=='map_zoom_in'&&map.getZoom()>=map.getCurrentMapType().getMaximumResolution()){document.images['map_zoom_in'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_in_inactive.png';document.getElementById('zoom_in').style.cursor='auto';}
else if(fa=='map_zoom_out'&&map.getZoom()<=map.getCurrentMapType().getMinimumResolution()){document.images['map_zoom_out'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_out_inactive.png';document.getElementById('zoom_out').style.cursor='auto';}}}
function showLegend(ja){if(ja){document.getElementById('show_map_legend_button').style.display='none';document.getElementById('no_show_map_legend_button').style.display='block';document.getElementById('map_legend').style.display='block';}
else{document.getElementById('no_show_map_legend_button').style.display='none';document.getElementById('show_map_legend_button').style.display='block';document.getElementById('map_legend').style.display='none';}}
function MarkerManager(aa,ba){var me=this;me.map_=aa;me.mapZoom_=aa.getZoom();me.projection_=aa.getCurrentMapType().getProjection();ba=ba||{};me.tileSize_=MarkerManager.DEFAULT_TILE_SIZE_;var ca=MarkerManager.DEFAULT_MAX_ZOOM_;if(ba.maxZoom!=undefined){ca=ba.maxZoom;}
me.maxZoom_=ca;me.trackMarkers_=ba.trackMarkers;var da;if(typeof ba.borderPadding=="number"){da=ba.borderPadding;}
else{da=MarkerManager.DEFAULT_BORDER_PADDING_;}
me.swPadding_=new GSize(-da,da);me.nePadding_=new GSize(da,-da);me.borderPadding_=da;me.gridWidth_=[];me.grid_=[];me.grid_[ca]=[];me.numMarkers_=[];me.numMarkers_[ca]=0;GEvent.bind(aa,"moveend",me,me.onMapMoveEnd_);me.removeOverlay_=function(ea){aa.removeOverlay(ea);me.shownMarkers_--;};me.addOverlay_=function(fa){aa.addOverlay(fa);me.shownMarkers_++;};me.resetManager_();me.shownMarkers_=0;me.shownBounds_=me.getMapGridBounds_();};MarkerManager.DEFAULT_TILE_SIZE_=1024;MarkerManager.DEFAULT_MAX_ZOOM_=17;MarkerManager.DEFAULT_BORDER_PADDING_=100;MarkerManager.MERCATOR_ZOOM_LEVEL_ZERO_RANGE=256;MarkerManager.prototype.resetManager_=function(){var me=this;var ga=MarkerManager.MERCATOR_ZOOM_LEVEL_ZERO_RANGE;for(var ha=0;ha<=me.maxZoom_;++ha){me.grid_[ha]=[];me.numMarkers_[ha]=0;me.gridWidth_[ha]=Math.ceil(ga/me.tileSize_);ga<<=1;}};MarkerManager.prototype.clearMarkers=function(){var me=this;me.processAll_(me.shownBounds_,me.removeOverlay_);me.resetManager_();};MarkerManager.prototype.getTilePoint_=function(ia,ja,ka){var la=this.projection_.fromLatLngToPixel(ia,ja);return new GPoint(Math.floor((la.x+ka.width)/this.tileSize_),Math.floor((la.y+ka.height)/this.tileSize_));};MarkerManager.prototype.addMarkerBatch_=function(ma,na,oa){var pa=ma.getPoint();if(this.trackMarkers_){GEvent.bind(ma,"changed",this,this.onMarkerMoved_);}
var qa=this.getTilePoint_(pa,oa,GSize.ZERO);for(var ra=oa;ra>=na;ra--){var sa=this.getGridCellCreate_(qa.x,qa.y,ra);sa.push(ma);qa.x=qa.x>>1;qa.y=qa.y>>1;}};MarkerManager.prototype.isGridPointVisible_=function(ta){var me=this;var ua=me.shownBounds_.minY<=ta.y&&ta.y<=me.shownBounds_.maxY;var va=me.shownBounds_.minX;var wa=va<=ta.x&&ta.x<=me.shownBounds_.maxX;if(!wa&&va<0){var xa=me.gridWidth_[me.shownBounds_.z];wa=va+xa<=ta.x&&ta.x<=xa-1;}
return ua&&wa;}
MarkerManager.prototype.onMarkerMoved_=function(ya,za,Aa){var me=this;var Ba=me.maxZoom_;var Ca=false;var Da=me.getTilePoint_(za,Ba,GSize.ZERO);var Ea=me.getTilePoint_(Aa,Ba,GSize.ZERO);while(Ba>=0&&(Da.x!=Ea.x||Da.y!=Ea.y)){var Fa=me.getGridCellNoCreate_(Da.x,Da.y,Ba);if(Fa){if(me.removeFromArray(Fa,ya)){me.getGridCellCreate_(Ea.x,Ea.y,Ba).push(ya);}}
if(Ba==me.mapZoom_){if(me.isGridPointVisible_(Da)){if(!me.isGridPointVisible_(Ea)){me.removeOverlay_(ya);Ca=true;}}
else{if(me.isGridPointVisible_(Ea)){me.addOverlay_(ya);Ca=true;}}}
Da.x=Da.x>>1;Da.y=Da.y>>1;Ea.x=Ea.x>>1;Ea.y=Ea.y>>1;--Ba;}
if(Ca){me.notifyListeners_();}};MarkerManager.prototype.removeMarker=function(Ga){var me=this;var Ha=me.maxZoom_;var Ia=false;var Ja=Ga.getPoint();var Ka=me.getTilePoint_(Ja,Ha,GSize.ZERO);while(Ha>=0){var La=me.getGridCellNoCreate_(Ka.x,Ka.y,Ha);if(La){me.removeFromArray(La,Ga);}
if(Ha==me.mapZoom_){if(me.isGridPointVisible_(Ka)){me.removeOverlay_(Ga);Ia=true;}}
Ka.x=Ka.x>>1;Ka.y=Ka.y>>1;--Ha;}
if(Ia){me.notifyListeners_();}};MarkerManager.prototype.addMarkers=function(Ma,Na,Oa){var Pa=this.getOptMaxZoom_(Oa);for(var i=Ma.length-1;i>=0;i--){this.addMarkerBatch_(Ma[i],Na,Pa);}
this.numMarkers_[Na]+=Ma.length;};MarkerManager.prototype.getOptMaxZoom_=function(Qa){return Qa!=undefined?Qa:this.maxZoom_;}
MarkerManager.prototype.getMarkerCount=function(Ra){var Sa=0;for(var z=0;z<=Ra;z++){Sa+=this.numMarkers_[z];}
return Sa;};MarkerManager.prototype.addMarker=function(Ta,Ua,Va){var me=this;var Wa=this.getOptMaxZoom_(Va);me.addMarkerBatch_(Ta,Ua,Wa);var Xa=me.getTilePoint_(Ta.getPoint(),me.mapZoom_,GSize.ZERO);if(me.isGridPointVisible_(Xa)&&Ua<=me.shownBounds_.z&&me.shownBounds_.z<=Wa){me.addOverlay_(Ta);me.notifyListeners_();}
this.numMarkers_[Ua]++;};GBounds.prototype.containsPoint=function(Ya){var Za=this;return(Za.minX<=Ya.x&&Za.maxX>=Ya.x&&Za.minY<=Ya.y&&Za.maxY>=Ya.y);}
MarkerManager.prototype.getGridCellCreate_=function(x,y,z){var $a=this.grid_[z];if(x<0){x+=this.gridWidth_[z];}
var ab=$a[x];if(!ab){ab=$a[x]=[];return ab[y]=[];}
var bb=ab[y];if(!bb){return ab[y]=[];}
return bb;};MarkerManager.prototype.getGridCellNoCreate_=function(x,y,z){var cb=this.grid_[z];if(x<0){x+=this.gridWidth_[z];}
var db=cb[x];return db?db[y]:undefined;};MarkerManager.prototype.getGridBounds_=function(eb,fb,gb,hb){fb=Math.min(fb,this.maxZoom_);var bl=eb.getSouthWest();var tr=eb.getNorthEast();var sw=this.getTilePoint_(bl,fb,gb);var ne=this.getTilePoint_(tr,fb,hb);var gw=this.gridWidth_[fb];if(tr.lng()<bl.lng()||ne.x<sw.x){sw.x-=gw;}
if(ne.x-sw.x+1>=gw){sw.x=0;ne.x=gw-1;}
var ib=new GBounds([sw,ne]);ib.z=fb;return ib;};MarkerManager.prototype.getMapGridBounds_=function(){var me=this;return me.getGridBounds_(me.map_.getBounds(),me.mapZoom_,me.swPadding_,me.nePadding_);};MarkerManager.prototype.onMapMoveEnd_=function(){var me=this;me.objectSetTimeout_(this,this.updateMarkers_,0);};MarkerManager.prototype.objectSetTimeout_=function(jb,kb,lb){return window.setTimeout(function(){kb.call(jb);},lb);};MarkerManager.prototype.refresh=function(){var me=this;if(me.shownMarkers_>0){me.processAll_(me.shownBounds_,me.removeOverlay_);}
me.processAll_(me.shownBounds_,me.addOverlay_);me.notifyListeners_();};MarkerManager.prototype.updateMarkers_=function(){var me=this;me.mapZoom_=this.map_.getZoom();var mb=me.getMapGridBounds_();if(mb.equals(me.shownBounds_)&&mb.z==me.shownBounds_.z){return;}
if(mb.z!=me.shownBounds_.z){me.processAll_(me.shownBounds_,me.removeOverlay_);me.processAll_(mb,me.addOverlay_);}
else{me.rectangleDiff_(me.shownBounds_,mb,me.removeCellMarkers_);me.rectangleDiff_(mb,me.shownBounds_,me.addCellMarkers_);}
me.shownBounds_=mb;me.notifyListeners_();};MarkerManager.prototype.notifyListeners_=function(){GEvent.trigger(this,"changed",this.shownBounds_,this.shownMarkers_);};MarkerManager.prototype.processAll_=function(nb,ob){for(var x=nb.minX;x<=nb.maxX;x++){for(var y=nb.minY;y<=nb.maxY;y++){this.processCellMarkers_(x,y,nb.z,ob);}}};MarkerManager.prototype.processCellMarkers_=function(x,y,z,pb){var qb=this.getGridCellNoCreate_(x,y,z);if(qb){for(var i=qb.length-1;i>=0;i--){pb(qb[i]);}}};MarkerManager.prototype.removeCellMarkers_=function(x,y,z){this.processCellMarkers_(x,y,z,this.removeOverlay_);};MarkerManager.prototype.addCellMarkers_=function(x,y,z){this.processCellMarkers_(x,y,z,this.addOverlay_);};MarkerManager.prototype.rectangleDiff_=function(rb,sb,tb){var me=this;me.rectangleDiffCoords(rb,sb,function(x,y){tb.apply(me,[x,y,rb.z]);});};MarkerManager.prototype.rectangleDiffCoords=function(ub,vb,wb){var xb=ub.minX;var yb=ub.minY;var zb=ub.maxX;var Ab=ub.maxY;var Bb=vb.minX;var Cb=vb.minY;var Db=vb.maxX;var Eb=vb.maxY;for(var x=xb;x<=zb;x++){for(var y=yb;y<=Ab&&y<Cb;y++){wb(x,y);}
for(var y=Math.max(Eb+1,yb);y<=Ab;y++){wb(x,y);}}
for(var y=Math.max(yb,Cb);y<=Math.min(Ab,Eb);y++){for(var x=Math.min(zb+1,Bb)-1;x>=xb;x--){wb(x,y);}
for(var x=Math.max(xb,Db+1);x<=zb;x++){wb(x,y);}}};MarkerManager.prototype.removeFromArray=function(Fb,Gb,Hb){var Ib=0;for(var i=0;i<Fb.length;++i){if(Fb[i]===Gb||(Hb&&Fb[i]==Gb)){Fb.splice(i--,1);Ib++;}}
return Ib;};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');}}}
var debug_coords=false;var debug_window=false;var debug_tooltip=false;var debug_parsepanzoom=false;var map;var fs_map_type;var fs_h_map_type;var markerManager=null;var currentMarker=null;var application=null;var weather_tiles_url=null;var geo_country_default=null;var default_airport_info_type=null;var indexMarkersZ5=null;function createFSTiles(){var aa='//dem5xqcn61lj8.cloudfront.net/GoogleMapTiles/World';var ba=new GTileLayer(new GCopyrightCollection(''),2,5);ba.getTileUrl=function(ca,da){if(debug_coords){var xy=ca.x+ca.y*Math.pow(2,da);if(da==3&&(xy==17||xy==18||xy==25||xy==26)){console.log("------------------------------");console.log("------------------------------");console.log("coords info for tile : x = "+ca.x+", y = "+ca.y+", zoom = "+da);console.log("img url = "+aa+'/z'+da+'/world_tile.'+da+'.'+(ca.x+ca.y*Math.pow(2,da))+'.png');var nw=new GPoint(ca.x*256,ca.y*256);var sw=new GPoint(ca.x*256,(ca.y+1)*256);var ne=new GPoint((ca.x+1)*256,ca.y*256);var se=new GPoint((ca.x+1)*256,(ca.y+1)*256);var ea=G_NORMAL_MAP.getProjection().fromPixelToLatLng(nw,da);var fa=G_NORMAL_MAP.getProjection().fromPixelToLatLng(sw,da);var ga=G_NORMAL_MAP.getProjection().fromPixelToLatLng(ne,da);var ha=G_NORMAL_MAP.getProjection().fromPixelToLatLng(se,da);console.log("nw coords : lat = "+ea.lat()+", long = "+ea.lng());console.log("sw coords : lat = "+fa.lat()+", long = "+fa.lng());console.log("ne coords : lat = "+ga.lat()+", long = "+ga.lng());console.log("se coords : lat = "+ha.lat()+", long = "+ha.lng());if(xy==17){var ia=new GPoint(277,655);var ja=new GPoint(677,655);var ka=new GPoint(277,905);var la=new GPoint(677,905);var ma=G_NORMAL_MAP.getProjection().fromPixelToLatLng(ia,da);var na=G_NORMAL_MAP.getProjection().fromPixelToLatLng(ja,da);var oa=G_NORMAL_MAP.getProjection().fromPixelToLatLng(ka,da);var pa=G_NORMAL_MAP.getProjection().fromPixelToLatLng(la,da);console.log("c_n1 coords : lat = "+ma.lat()+", long = "+ma.lng());console.log("c_n2 coords : lat = "+na.lat()+", long = "+na.lng());console.log("c_n3 coords : lat = "+oa.lat()+", long = "+oa.lng());console.log("c_n4 coords : lat = "+pa.lat()+", long = "+pa.lng());console.log}
console.log("------------------------------");console.log("------------------------------");}}
return aa+'/z'+da+'/world_tile.'+da+'.'+(ca.x+ca.y*Math.pow(2,da))+'.png';};ba.isPng=function(){return true;}
ba.getOpacity=function(){return 1.0;}
return ba;}
function createFlightStatsMapType(qa){var ra=new GMapType([qa],G_NORMAL_MAP.getProjection(),'FlightStats',{shortName:'FS',tileSize:256,maxResolution:5,minResolution:2,errorMessage:"Out of Bounds"});return ra;}
function createHybridFlightStatsMapType(sa){var ta=new GMapType([sa,G_HYBRID_MAP.getTileLayers()[1]],G_HYBRID_MAP.getProjection(),'Flight Stats Hybrid',{shortName:'FSH',tileSize:256,maxResolution:5,minResolution:2,errorMessage:"Out of Bounds"});return ta;}
function createIcon(ua,va,wa,xa){var ya=new GIcon();ya.image=ua;if(va>0){ya.iconSize=new GSize(va,va);}
ya.iconAnchor=new GPoint(wa,wa);ya.infoWindowAnchor=new GPoint(xa,xa);return ya;}
function LittleInfoWindow(za,Aa,Ba,Ca){this.airportCodeCityCombo_=Aa;this.mainContent_=Ba;this.windowLocation_=Ca;this.width_px_=319;this.height_px_=247;this.width_='319px';this.height_='247px';this.marker_=za;}
LittleInfoWindow.prototype=new GOverlay();LittleInfoWindow.prototype.windowLocation=null;LittleInfoWindow.prototype.initialize=function(Da){this.map_=Da;var Ea=document.createElement('div');Ea.style.display='none';Da.getPane(G_MAP_FLOAT_PANE).appendChild(Ea);this.container_=Ea;}
LittleInfoWindow.prototype.remove=function(){this.container_.parentNode.removeChild(this.container_);}
LittleInfoWindow.prototype.copy=function(){return new ToolTip(this.marker_,this.html_,this.width_);}
LittleInfoWindow.prototype.redraw=function(Fa){if(!Fa)return;var Ga=document.createElement('div');Ga.style.margin='0';Ga.style.padding='0';Ga.style.border='0px solid';Ga.style.display='block';Ga.style.width=this.width_;Ga.style.height=this.height_;Ga.style.visibility='hidden';this.map_.getContainer().appendChild(Ga);Ga.parentNode.removeChild(Ga);Ga.style.visibility='visible';Ga.style.position='absolute';var Ha=document.createElement('img');if(this.windowLocation_=='left'){var Ia='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/airport_popup_left_pointing_2.png';if(xIE4Up){Ha.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+Ia+")";Ha.src="//dem5xqcn61lj8.cloudfront.net/spacer.gif";}
else{Ha.src=Ia;}}
else{var Ja='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/airport_popup_right_pointing_2.png';if(xIE4Up){Ha.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+Ja+")";Ha.src="//dem5xqcn61lj8.cloudfront.net/spacer.gif";}
else{Ha.src=Ja;}}
Ga.appendChild(Ha);var Ka=document.createElement('div');Ka.style.position='absolute';Ka.style.width='225px';Ka.style.height='13px';if(this.windowLocation_=='left'){Ka.style.left='43px';}
else{Ka.style.left='10px';}
Ka.style.top='5px';Ka.style.border='0px solid #ffffff';Ka.style.font='10px arial, verdana, sans-serif';Ka.innerHTML="<font color='white'><b>"+this.airportCodeCityCombo_+"</b></font>";Ga.appendChild(Ka);var La=document.createElement('div');La.style.position='absolute';La.style.width='12px';La.style.height='12px';if(this.windowLocation_=='left'){La.style.left='295px';}
else{La.style.left='263px';}
La.style.top='4px';La.style.border='0px solid #ffffff';La.style.cursor='pointer';var Ma=this.marker_;GEvent.addDomListener(La,'click',function(){Ma.closeLittleInfoWindow(true);});Ga.appendChild(La);var Na=document.createElement('div');Na.style.position='absolute';Na.style.width='259px';Na.style.height='207px';if(this.windowLocation_=='left'){Na.style.left='33px';}
else{Na.style.left='0px';}
Na.style.top='20px';Na.style.border='0px solid';Na.style.paddingLeft='10px';Na.style.paddingRight='10px';Na.style.paddingTop='3px';Na.style.paddingBottom='10px';if(this.mainContent_==null){Na.innerHTML='No content available.';}
else{Na.appendChild(this.mainContent_);}
Ga.appendChild(Na);this.container_.style.position='absolute';var Oa=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());if(this.windowLocation_=='left'){this.container_.style.left=(Oa.x+6)+'px';this.container_.style.top=(Oa.y-120)+'px';}
else{this.container_.style.left=(Oa.x-319)+'px';this.container_.style.top=(Oa.y-120)+'px';}
this.container_.style.border='0';this.container_.style.margin='0';this.container_.style.padding='0';this.container_.style.display='block';this.container_.appendChild(Ga);var Pa=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getNorthEast());var Qa=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());if(debug_window){console.log("----- panning calcs -----");console.log("mapNE X : "+Pa.x+", mapNE Y : "+Pa.y);console.log("mapSW X : "+Qa.x+", mapSW Y : "+Qa.y);console.log("offsetTop : "+this.container_.offsetTop);console.log("offsetLeft : "+this.container_.offsetLeft);console.log("offsetBottom : "+(this.container_.offsetTop-this.container_.offsetHeight));console.log("offsetRight : "+(this.container_.offsetLeft+this.container_.offsetWidth));}
var Ra=0;var Sa=0;var Ta=0;var Ua=0;if(this.container_.offsetTop-40<Pa.y){Sa=Pa.y-this.container_.offsetTop+40;}
if(this.container_.offsetLeft+this.width_px_+50>Pa.x){Ra=(this.container_.offsetLeft+this.width_px_+50)-Pa.x;}
offsetBottom=this.container_.offsetTop+this.height_px_;if(offsetBottom+40>Qa.y){Ua=offsetBottom-Qa.y+40;}
if(this.container_.offsetLeft-50<Qa.x){Ta=Qa.x-this.container_.offsetLeft+50;}
if(Ra!=0||Sa!=0){if(Ta!=0){Ra-=Ta;}
else if(Ua!=0){Sa-=Ua;}
this.map_.panBy(new GSize(-Ra,Sa));}
else if(Ta!=0||Ua!=0){this.map_.panBy(new GSize(Ta,-Ua));}
if(debug_window){console.log("new pan neX : "+Ra);console.log("new pan neY : "+Sa);console.log("new pan swX : "+Ta);console.log("new pan swY : "+Ua);}
if(debug_window){console.log("----- end panning calcs -----");}}
GMarker.prototype.LittleInfoWindowInstance=null;GMarker.prototype.windowLocation=null;GMarker.prototype.openLittleInfoWindow=function(Va,Wa){if(this.LittleInfoWindowInstance==null){var Xa=map.getCenter();var Ya=map.fromLatLngToDivPixel(Xa);var Za=map.fromLatLngToDivPixel(this.getPoint());var $a='';if(Za.x>=Ya.x){$a="right";}
else{$a="left";}
this.LittleInfoWindowInstance=new LittleInfoWindow(this,Va,Wa,$a);if(currentMarker!=null){currentMarker.closeLittleInfoWindow(true);}
map.addOverlay(this.LittleInfoWindowInstance);}}
GMarker.prototype.closeLittleInfoWindow=function(ab){if(this.LittleInfoWindowInstance!=null){map.removeOverlay(this.LittleInfoWindowInstance);if(ab){map.returnToSavedPosition();}
this.LittleInfoWindowInstance=null;currentMarker=null;}}
function ToolTip(bb,cb,db){this.html_=cb;this.width_=(db?db+'px':'auto');this.marker_=bb;}
ToolTip.prototype=new GOverlay();ToolTip.prototype.initialize=function(eb){var fb=document.createElement('div');fb.style.display='none';eb.getPane(G_MAP_FLOAT_PANE).appendChild(fb);this.map_=eb;this.container_=fb;}
ToolTip.prototype.remove=function(){this.container_.parentNode.removeChild(this.container_);}
ToolTip.prototype.copy=function(){return new ToolTip(this.html_);}
ToolTip.prototype.redraw=function(gb){if(!gb)return;var hb=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());this.container_.innerHTML=this.html_;this.container_.style.position='absolute';var ib=map.getCenter();var jb=map.fromLatLngToDivPixel(ib);if(hb.x<=jb.x){this.container_.style.left=(hb.x+10)+'px';}
else{this.container_.style.left=(hb.x-(this.html_.length*5))+'px';}
if(hb.y<=jb.y){this.container_.style.top=(hb.y+7)+'px';}
else{this.container_.style.top=(hb.y+-27)+'px';}
this.container_.style.width=this.width_;this.container_.style.font='10px arial, verdana, sans-serif';this.container_.style.border='1px solid black';this.container_.style.background='white';this.container_.style.padding='2px';this.container_.style.whiteSpace='nowrap';if(this.width_!='auto')this.container_.style.overflow='hidden';this.container_.style.display='block';}
GMarker.prototype.ToolTipInstance=null;GMarker.prototype.openToolTip=function(kb){if(this.ToolTipInstance==null){this.ToolTipInstance=new ToolTip(this,kb);map.addOverlay(this.ToolTipInstance);}}
GMarker.prototype.closeToolTip=function(){if(this.ToolTipInstance!=null){map.removeOverlay(this.ToolTipInstance);this.ToolTipInstance=null;}}
function createMarkerContent(lb){var mb=lb.documentElement.getElementsByTagName("airport")[0];var nb=lb.documentElement.getElementsByTagName("weather")[0];var ob=lb.documentElement.getElementsByTagName("FAADelays")[0];var pb=lb.documentElement.getElementsByTagName("scorecard")[0];var qb=lb.documentElement.getElementsByTagName("ratings")[0];var rb=mb.getAttribute("code");var sb=mb.getAttribute("airportQueryDate");var tb=document.createElement('div');tb.style.position='relative';tb.style.border='0px solid';tb.style.width='259px';tb.style.height='207px';var ub=document.createElement('div');ub.style.position='relative';ub.style.paddingBottom='3px';ub.style.borderBottom='1px solid #F9981B';var vb=document.createElement('div');vb.style.position='absolute';vb.style.width='90px';vb.style.left='0px';vb.style.font='10px arial, verdana, sans-serif';vb.innerHTML='<b>Airport:</b>';var wb=document.createElement('div');wb.style.position='relative';wb.style.width='169px';wb.style.left='90px';wb.style.font='10px arial, verdana, sans-serif';var xb="";if(application==null){xb="<a href='"+contextPath+"/Airport/airportDetails.do?airportCode="+rb+"'>"+rb+"</a>";}
xb='('+xb+') '+mb.getAttribute("name");if(mb.getAttribute("currentLocalTime24")){xb=xb+"<br/>Local Time: "+mb.getAttribute("currentLocalTime24")+"&nbsp;&nbsp;"+mb.getAttribute("currentDate");}
var yb="";if(application==null){yb="<a href='"+contextPath+"/FlightStatus/flightStatusByAirport.do?airportCode="+rb+"&airportQueryDate="+sb+"&airportQueryType=0'>"+rb+" Departures</a><br/>"+"<a href='"+contextPath+"/FlightStatus/flightStatusByAirport.do?airportCode="+rb+"&airportQueryDate="+sb+"&airportQueryType=1'>"+rb+" Arrivals</a>";}
wb.innerHTML=xb+"<br/>"+yb;ub.appendChild(vb);ub.appendChild(wb);var zb=document.createElement('div');zb.style.position='relative';zb.style.paddingTop='3px';zb.style.paddingBottom='3px';var Ab=document.createElement('div');Ab.style.position='absolute';Ab.style.width='90px';Ab.style.left='0px';Ab.style.font='10px arial, verdana, sans-serif';if(default_airport_info_type=='faa_delays'){Ab.innerHTML='<b>Airport Status:</b>';}
else{Ab.innerHTML='<b>Delay Index:</b><br/><a href="'+contextPath+'/Airport/airportDelayIndexFAQ.do?">What\'s This?</a>';}
var Bb=document.createElement('div');Bb.style.position='relative';Bb.style.width='169px';Bb.style.left='90px';Bb.style.font='10px arial, verdana, sans-serif';if(default_airport_info_type=='faa_delays'){var Cb="";if(ob.getElementsByTagName("closure")[0]||ob.getElementsByTagName("deicing")[0]||ob.getElementsByTagName("groundStop")[0]||ob.getElementsByTagName("groundDelayProgram")[0]||ob.getElementsByTagName("delays")[0]){if(ob.getElementsByTagName("closure")[0]){var Db=ob.getElementsByTagName("closure")[0];Cb=Cb+"<img src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+Db.getAttribute("graphic")+"'> "+Db.getAttribute("description")+"<br/>";}
if(ob.getElementsByTagName("deicing")[0]){var Eb=ob.getElementsByTagName("deicing")[0];Cb=Cb+"<img src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+Eb.getAttribute("graphic")+"'> "+Eb.getAttribute("description")+"<br/>";}
if(ob.getElementsByTagName("groundStop")[0]){var Fb=ob.getElementsByTagName("groundStop")[0];Cb=Cb+"<img src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+Fb.getAttribute("graphic")+"'> "+Fb.getAttribute("description")+"<br/>";}
if(ob.getElementsByTagName("groundDelayProgram")[0]){var Gb=ob.getElementsByTagName("groundDelayProgram")[0];Cb=Cb+"<img src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+Gb.getAttribute("graphic")+"'> "+Gb.getAttribute("description")+"<br/>";}
if(ob.getElementsByTagName("delays")[0]){var Hb=ob.getElementsByTagName("delays")[0];Cb=Cb+"<img src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+Hb.getAttribute("graphic")+"'> "+Hb.getAttribute("description")+"<br/>";}}
else{if(ob.getAttribute("graphic")&&ob.getAttribute("description")){Cb=Cb+"<img src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+ob.getAttribute("graphic")+"'> "+ob.getAttribute("description")+"<br/>";}}
if(application==null){Cb=Cb+"<a href='"+contextPath+"/Airport/delays.do?airportCode="+rb+"&airportQueryDate="+sb+"'>Delay Details</a>";}
Bb.innerHTML=Cb;}
else if(pb.getAttribute("scoreAvailable")){var Ib='';if(pb.getAttribute("scoreAvailable")=='true'){Ib=pb.getAttribute("score")+' - ';}
Ib=Ib+pb.getAttribute("description");var Jb=document.createElement('div');Jb.style.position='relative';Jb.style.width='107px';Jb.style.left='0px';var Kb=document.createElement('div');Kb.style.position='relative';Kb.style.width='107px';Kb.style.left='0px';Kb.style.font='10px arial, verdana, sans-serif';Kb.align='center';Kb.innerHTML='<b>'+Ib+'</b>';var Lb=document.createElement('div');Lb.style.position='relative';Lb.style.width='107px';Lb.style.height='8px';Lb.style.left='0px';var Mb='';if(pb.getAttribute("scoreAvailable")=='true'){var Nb=parseFloat(pb.getAttribute("scorePercentage"));var Ob=parseFloat(pb.getAttribute("scorePercentageRemainder"));var Pb=parseFloat(pb.getAttribute("changeRatePercentage"));var Qb=Nb;var Rb=Ob;if(Pb!=0){if(Nb<=50){Rb-=30;}
else if(Nb>50){Qb-=30;}}
Mb='<img src="//dem5xqcn61lj8.cloudfront.net/spacer.gif" style="width: '+Qb+'px; height: 1px;">';if(Nb<=50){Mb=Mb+'<img src="//dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/orange_indicator.gif" width="7" height="8"/>';}
if(Pb<0&&Pb!=0){Mb=Mb+'<img src="//dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/trend_down_2.gif" width="30" height="8"/>';}
if(Pb>0&&Pb!=0){Mb=Mb+'<img src="//dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/trend_up_2.gif" width="30" height="8"/>';}
if(Nb>50){Mb=Mb+'<img src="//dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/orange_indicator.gif" width="7" height="8"/>';}
Mb=Mb+'<img src="//dem5xqcn61lj8.cloudfront.net/spacer.gif" style="width: '+Rb+'px; height: 1px;">';}
else{Mb='<img src="//dem5xqcn61lj8.cloudfront.net/spacer.gif" style="width: 107px; height: 1px;">';}
Lb.innerHTML=Mb;var Sb=document.createElement('div');Sb.style.position='relative';Sb.style.width='107px';Sb.style.height='18px';Sb.style.left='0px';if(pb.getAttribute("scoreAvailable")=='true'){var Tb=parseFloat(pb.getAttribute("score"));if(Tb<=1){Sb.innerHTML='<img src="//dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/therm_bkgd_10.gif" width="107" height="18"/>';}
else if(Tb<=2){Sb.innerHTML='<img src="//dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/therm_bkgd_20.gif" width="107" height="18"/>';}
else if(Tb<=3){Sb.innerHTML='<img src="//dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/therm_bkgd_30.gif" width="107" height="18"/>';}
else if(Tb<=4){Sb.innerHTML='<img src="//dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/therm_bkgd_40.gif" width="107" height="18"/>';}
else{Sb.innerHTML='<img src="//dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/therm_bkgd_50.gif"/>';}}
else{Sb.innerHTML='<img src="//dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/therm_bkgd_00.gif" width="107" height="18"/>';}
var Ub=document.createElement('div');Ub.style.position='relative';Ub.style.width='107px';Ub.style.height='9px';Ub.style.left='0px';Ub.innerHTML='<img src="//dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/low_high_text.gif" width="107" height="9"/>';var Vb=document.createElement('div');Vb.style.position='absolute';Vb.style.width='58px';Vb.style.left='111px';Vb.style.top='23px';var Wb="";if(application==null){Wb=Wb+"<a href='"+contextPath+"/Airport/delays.do?airportCode="+rb+"&airportQueryDate="+sb+"'>Details</a>";}
Vb.innerHTML=Wb;Jb.appendChild(Kb);Jb.appendChild(Lb);Jb.appendChild(Sb);Jb.appendChild(Ub);Bb.appendChild(Jb);Bb.appendChild(Vb);}
if(default_airport_info_type=='faa_delays'){zb.style.paddingBottom='3px';}
else{zb.style.paddingBottom='5px';}
zb.appendChild(Ab);zb.appendChild(Bb);var Xb=document.createElement('div');Xb.style.position='relative';Xb.style.paddingTop='3px';if(!nb.getAttribute("graphic")){Xb.style.paddingBottom='3px';}
else{Xb.style.paddingBottom='7px';}
Xb.style.borderTop='1px solid #F9981B';var Yb=document.createElement('div');Yb.style.position='absolute';Yb.style.width='90px';Yb.style.left='0px';Yb.style.font='10px arial, verdana, sans-serif';Yb.innerHTML='<b>Weather:</b>';var Zb=document.createElement('div');Zb.style.position='relative';Zb.style.width='169px';Zb.style.left='90px';if(!nb.getAttribute("graphic")&&!nb.getAttribute("condition")&&!nb.getAttribute("tempC")&&!nb.getAttribute("tempF")){Zb.style.font='10px arial, verdana, sans-serif';Zb.innerHTML="Unavailable";}
else{if(nb.getAttribute("graphic")){var $b=document.createElement('div');$b.style.position='absolute';$b.style.width="40px";$b.style.left="0px";$b.style.paddingTop="3px";$b.innerHTML="<img src='//dem5xqcn61lj8.cloudfront.net/Weather/"+nb.getAttribute("graphic")+"' style='width: 33px; height: 35px;'/>";Zb.appendChild($b);}
var ac=document.createElement('div');ac.style.position='relative';ac.style.border="0px solid";if(nb.getAttribute("graphic")){ac.style.width="129px";ac.style.left="40px";}
else{ac.style.left="0px";}
ac.style.font='10px arial, verdana, sans-serif';var bc="";if(nb.getAttribute("condition")){bc=bc+nb.getAttribute("condition")+"<br/>";}
if(nb.getAttribute("tempC")){bc=bc+nb.getAttribute("tempC")+"&deg;C";}
if(nb.getAttribute("tempF")){var cc="";var dc="";if(nb.getAttribute("tempC")){cc=cc+" (";dc=dc+")";}
bc=bc+cc+nb.getAttribute("tempF")+"&deg;F"+dc;}
if(application==null){bc=bc+"<br/><a href='"+contextPath+"/Airport/weather.do?airport="+rb+"'>Details</a>";}
ac.innerHTML=bc;Zb.appendChild(ac);}
Xb.appendChild(Yb);Xb.appendChild(Zb);var ec=document.createElement('div');ec.style.position='relative';ec.style.paddingTop='3px';ec.style.borderTop='1px solid #F9981B';var fc=document.createElement('div');fc.style.position='absolute';fc.style.width='90px';fc.style.left='0px';fc.style.font='10px arial, verdana, sans-serif';fc.innerHTML='<b>At the Airport:</b>';var gc=document.createElement('div');gc.style.position='relative';gc.style.width='169px';gc.style.left='90px';gc.style.font='10px arial, verdana, sans-serif';var hc="";var ic="";var jc="<a "+ic+"href='"+contextPath+"/Airport/airportUserRatingsModifyRating.do?airportCode="+rb+"'>No Rating Available</a>";if(qb.getAttribute("overallAverage")){var kc=parseFloat(qb.getAttribute("overallAverage"));var lc="//dem5xqcn61lj8.cloudfront.net/RatingStars/16Point/WhiteBkgd/"+qb.getAttribute("graphic");jc="<img src='"+lc+"' style='height: 10px;'/> <a "+ic+"href='"+contextPath+"/Airport/airportUserRatingsByAirport.do?airport="+rb+"'>"+kc+" of 5</a>";}
hc=hc+"User Rating: "+jc;gc.innerHTML=hc;ec.appendChild(fc);ec.appendChild(gc);tb.appendChild(ub);tb.appendChild(zb);tb.appendChild(Xb);tb.appendChild(ec);return tb;}
function createAirportMarker(mc,nc,oc,pc){var qc=new GMarker(mc,nc);GEvent.addListener(qc,"click",function(){var rc=GXmlHttp.create();trackEvent('AirportMarker','Click','Show Detail');rc.open('GET',contextPath+'/Suggest/airportDetailsSuggest.do?airportCode='+oc,true);rc.onreadystatechange=function(){if(rc.readyState==4){if(null==rc.responseXML)return;var sc=rc.responseXML;map.savePosition();var tc=createMarkerContent(sc);qc.closeToolTip();qc.openLittleInfoWindow(pc,tc);currentMarker=qc;}}
rc.send(null);});GEvent.addListener(qc,"mouseover",function(){if(currentMarker==null||qc!=currentMarker){qc.openToolTip(pc+' (click for details)');}});GEvent.addListener(qc,"mouseout",function(){qc.closeToolTip();});return qc;}
function setMapTypes(){fs_tiles=createFSTiles();fs_map_type=createFlightStatsMapType(fs_tiles);fs_h_map_type=createHybridFlightStatsMapType(fs_tiles);map.addMapType(fs_map_type);map.addMapType(fs_h_map_type);map.setMapType(fs_map_type);}
function addMarkers(uc,vc,wc){var xc=null;var yc=0;if(wc!=null&&wc!=""){var zc=wc.split(",");xc=zc[0];yc=parseInt(zc[4]);if(-1!=xc.lastIndexOf("us_region")){xc="US";}}
var Ac=GXmlHttp.create();if(yc==0){Ac.open('GET',contextPath+'/Suggest/airportInfoTypeSuggest.do?includeGlobal=true&airportInfoType='+uc,true);}
else{Ac.open('GET',contextPath+'/Suggest/airportInfoTypeSuggest.do?includeGlobal=true&airportInfoType='+uc+'&country='+xc+'&classification=4&desiredResultsPoolSize=500',true);}
Ac.onreadystatechange=function(){if(Ac.readyState==4){if(null==Ac.responseXML)return;vc.clearMarkers();var Bc=Ac.responseXML;var Cc=Bc.documentElement.getElementsByTagName("airport");var Dc=[];var Ec=[];var Fc=[];var Gc=[];indexMarkersZ5=[];for(i=0;i<Cc.length;i++){var Hc=Cc[i];var Ic=Hc.getAttribute("code");var Jc=Hc.getAttribute("longitude");var Kc=Hc.getAttribute("latitude");var Lc=Ic+" - "+Hc.getAttribute("city")+", ";if(Hc.getAttribute("stateCode")){Lc=Lc+Hc.getAttribute("stateCode")+", ";}
Lc=Lc+Hc.getAttribute("countryCode");var Mc;var Nc;if(uc=='delay_indexes'){Nc=Hc.getAttribute("scoreGraphic");}
else if(uc=='faa_delays'){Nc=Hc.getAttribute("FAADelayGraphic");}
else if(uc=='highest_rated'||uc=='most_rated'){Nc=Hc.getAttribute("ratingGraphic");}
Mc=createIcon("//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+Nc,9,4,10);var Oc=createAirportMarker(new GPoint(Jc,Kc),Mc,Ic,Lc);if(uc!='delay_indexes'){Dc.push(Oc);}
else{var Pc=parseInt(Hc.getAttribute("classification"));if(1==Pc){Ec.push(Oc);}
else if(2==Pc){Fc.push(Oc);}
else if(3==Pc){Gc.push(Oc);}
else if(4==Pc){indexMarkersZ5.push(Oc);}}}
if(uc!='delay_indexes'){vc.addMarkers(Dc,2);}
else{vc.addMarkers(Ec,2);vc.addMarkers(Fc,4);vc.addMarkers(Gc,5);vc.addMarkers(indexMarkersZ5,5);}
vc.refresh();}}
Ac.send(null);}
function addMoreMarkers(Qc,Rc,Sc,Tc){var Uc=GXmlHttp.create();Uc.open('GET',contextPath+'/Suggest/airportInfoTypeSuggest.do?airportInfoType=delay_indexes&country='+Rc+'&classification='+Sc+'&desiredResultsPoolSize='+Tc,true);Uc.onreadystatechange=function(){if(Uc.readyState==4){if(null==Uc.responseXML)return;var Vc=Uc.responseXML;var Wc=Vc.documentElement.getElementsByTagName("airport");indexMarkersZ5=[];for(i=0;i<Wc.length;i++){var Xc=Wc[i];var Yc=Xc.getAttribute("code");var Zc=Xc.getAttribute("longitude");var $c=Xc.getAttribute("latitude");var ad=Yc+" - "+Xc.getAttribute("city")+", ";if(Xc.getAttribute("stateCode")){ad=ad+Xc.getAttribute("stateCode")+", ";}
ad=ad+Xc.getAttribute("countryCode");var bd=Xc.getAttribute("scoreGraphic");var cd=createIcon("//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+bd,9,4,10);var dd=createAirportMarker(new GPoint(Zc,$c),cd,Yc,ad);indexMarkersZ5.push(dd);}
Qc.addMarkers(indexMarkersZ5,5);Qc.refresh();}}
Uc.send(null);}
function addMapListeners(ed){var A=function addMoveS(){GEvent.addListener(map,'movestart',function(){map.savePosition();});}
setTimeout(A,0);var C=function zoomPics(){GEvent.addListener(map,'zoomend',function(fd,gd){checkPanZoomPics(gd);});}
setTimeout(C,0);}
function checkPanZoomPics(hd){var id=17;var jd=0;if(map.getCurrentMapType().getName()=='FlightStats'){id=5;jd=2;}
if(hd>=id){document.images['map_zoom_in'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_in_inactive.png';document.images['map_zoom_out'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_out_off.png';document.getElementById('zoom_in').style.cursor='auto';document.getElementById('zoom_out').style.cursor='pointer';}
else if(hd<=jd){document.images['map_zoom_in'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_in_off.png';document.images['map_zoom_out'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_out_inactive.png';document.getElementById('zoom_in').style.cursor='pointer';document.getElementById('zoom_out').style.cursor='auto';}
else{if(document.images['map_zoom_in'].src.indexOf("zoom_in_over")==-1){document.images['map_zoom_in'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_in_off.png';}
if(document.images['map_zoom_out'].src.indexOf("zoom_out_over")==-1){document.images['map_zoom_out'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_out_off.png';}
document.getElementById('zoom_in').style.cursor='pointer';document.getElementById('zoom_out').style.cursor='pointer';}}
function zoom(kd){if(kd==1){map.zoomIn();}
else map.zoomOut();}
function pan(x,y){map.panDirection(x,y);}
function mapType(ld){if(ld=='custom'){map.setMapType(fs_map_type);if(map.getZoom()==2){markerManager.updateMarkers_();}}
else if(ld=='streets'){map.setMapType(G_NORMAL_MAP);}
else if(ld=='sat'){map.setMapType(G_SATELLITE_MAP);}
else if(ld=='hybrid'){map.setMapType(G_HYBRID_MAP);}
else if(ld=='physical'){map.setMapType(G_PHYSICAL_MAP);}
else map.setMapType(fs_map_type);checkPanZoomPics(map.getZoom());}
function mapLoading(md){document.getElementById('map_loading').style.display='block';var nd=function(){document.getElementById('map_loading').style.display='none';}
setTimeout(nd,2500);}
function airportInfoType(od){if(currentMarker!=null){currentMarker.closeLittleInfoWindow(true);}
if(od=='delay_indexes'){document.getElementById('map_legend_image').style.backgroundPosition="-0px -150px";if(document.getElementById('show_map_legend_button').style.display=='none'&&document.getElementById('no_show_map_legend_button').style.display=='none'){document.getElementById('show_map_legend_button').style.display='block';}
if(document.getElementById('map_legend').style.display=='block'){document.getElementById('map_legend_delay_index_link').style.display='block';}
default_airport_info_type='delay_indexes';}
else if(od=='faa_delays'){document.getElementById('map_legend_image').style.backgroundPosition="-300px -150px";if(document.getElementById('show_map_legend_button').style.display=='none'&&document.getElementById('no_show_map_legend_button').style.display=='none'){document.getElementById('show_map_legend_button').style.display='block';}
document.getElementById('map_legend_delay_index_link').style.display='none';default_airport_info_type='faa_delays';}
else{document.getElementById('map_legend').style.display='none';document.getElementById('show_map_legend_button').style.display='none';document.getElementById('no_show_map_legend_button').style.display='none';document.getElementById('map_legend_delay_index_link').style.display='none';default_airport_info_type='other';}
addMarkers(od,markerManager,geo_country_default);}
function exchangeImg(pd,qd,rd,sd){document.images[pd].src=qd;if(rd){var td=17;var ud=0;if(map.getCurrentMapType().getName()=='FlightStats'){td=5;ud=2;}
if(pd=='map_zoom_in'&&map.getZoom()>=td){document.images['map_zoom_in'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_in_inactive.png';document.getElementById('zoom_in').style.cursor='auto';}
else if(pd=='map_zoom_out'&&map.getZoom()<=ud){document.images['map_zoom_out'].src='//dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_out_inactive.png';document.getElementById('zoom_out').style.cursor='auto';}}}
function parsePanZoom(vd){if(vd!=null&&vd!=""){if(currentMarker!=null){currentMarker.closeLittleInfoWindow(false);}
if(debug_parsepanzoom){console.log('----->');console.log('----->');console.log('-----> selected country/region : '+vd);}
var wd=vd.split(",");var xd=wd[0];var yd=wd[1];var zd=wd[2];var Ad=parseInt(wd[3]);if(Ad>5){Ad=5;}
if(debug_parsepanzoom){console.log('-----> region : '+xd);console.log('-----> lat : '+yd);console.log('-----> lng : '+zd);console.log('-----> zoom (corrected) : '+Ad);console.log('----->');console.log('----->');}
map.setCenter(new GLatLng(yd,zd),Ad);geo_country_default=vd;}}
function addMoreRegionMarkers(Bd,Cd){if(Bd!=null&&Bd!=""&&default_airport_info_type=="delay_indexes"){if(null!=indexMarkersZ5){for(i=0;i<indexMarkersZ5.length;i++){var Dd=indexMarkersZ5[i];markerManager.removeMarker(Dd);}}
var Ed=Bd.split(",");var Fd=Ed[0];var Gd=Ed[1];var Hd=Ed[2];var Id=parseInt(Ed[3]);var Jd=parseInt(Ed[4]);var Kd=500;if(-1!=Fd.lastIndexOf("us_region")){Fd="US";}
if(1==Jd){if(null==Cd){addMoreMarkers(markerManager,Fd,4,Kd);}
else{addMoreMarkers(Cd,Fd,4,Kd);}}
geo_country_default=Bd;}}
function showLegend(Ld){if(Ld){document.getElementById('show_map_legend_button').style.display='none';document.getElementById('no_show_map_legend_button').style.display='block';document.getElementById('map_legend').style.display='block';if(default_airport_info_type=='delay_indexes'){document.getElementById('map_legend_delay_index_link').style.display='block';}}
else{document.getElementById('no_show_map_legend_button').style.display='none';document.getElementById('show_map_legend_button').style.display='block';document.getElementById('map_legend').style.display='none';if(default_airport_info_type=='delay_indexes'){document.getElementById('map_legend_delay_index_link').style.display='none';}}}
function setupGoogleMap(){if(GBrowserIsCompatible()){if(document.getElementById('map_loading')){document.getElementById('map_loading').style.display='block';}
map=new GMap2(document.getElementById("map"));map.removeMapType(G_DEFAULT_MAP_TYPES);setMapTypes();setTileOverlays(weather_tiles_url,false);parsePanZoom(geo_country_default);checkPanZoomPics(map.getZoom());markerManager=new MarkerManager(map);addMarkers(default_airport_info_type,markerManager,geo_country_default);addMapListeners();map.addMapType(G_DEFAULT_MAP_TYPES);map.addMapType(G_PHYSICAL_MAP);if(document.getElementById('map_nav_main')&&document.getElementById('map_nav_main').style.display=='none'){document.getElementById('map_nav_main').style.display='block';}
if(document.getElementById('map_loading')){setTimeout(function(){document.getElementById('map_loading').style.display='none';},3500);}}}
