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 pngs_to_correct=['map_pan_control','map_zoom_in','map_zoom_out'];var weather_tiles_url=null;var geo_country_default=null;var default_airport_info_type=null;var indexMarkersZ5=null;function createFSTiles(){var aa='http://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='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/airport_popup_left_pointing_2.png';if(xIE4Up){Ha.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+Ia+")";Ha.src="http://dem5xqcn61lj8.cloudfront.net/spacer.gif";}
else{Ha.src=Ia;}}
else{var Ja='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/airport_popup_right_pointing_2.png';if(xIE4Up){Ha.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+Ja+")";Ha.src="http://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("chatter")[0];var rb=lb.documentElement.getElementsByTagName("ratings")[0];var sb=mb.getAttribute("code");var tb=mb.getAttribute("airportQueryDate");var ub=document.createElement('div');ub.style.position='relative';ub.style.border='0px solid';ub.style.width='259px';ub.style.height='207px';var vb=document.createElement('div');vb.style.position='relative';vb.style.paddingBottom='3px';vb.style.borderBottom='1px solid #F9981B';var wb=document.createElement('div');wb.style.position='absolute';wb.style.width='90px';wb.style.left='0px';wb.style.font='10px arial, verdana, sans-serif';wb.innerHTML='<b>Airport:</b>';var xb=document.createElement('div');xb.style.position='relative';xb.style.width='169px';xb.style.left='90px';xb.style.font='10px arial, verdana, sans-serif';var yb="";if(application==null){yb="<a href='/go/Airport/airportDetails.do?airportCode="+sb+"'>"+sb+"</a>";}
yb='('+yb+') '+mb.getAttribute("name");if(mb.getAttribute("currentLocalTime24")){yb=yb+"<br/>Local Time: "+mb.getAttribute("currentLocalTime24")+"&nbsp;&nbsp;"+mb.getAttribute("currentDate");}
var zb="";if(application==null){zb="<a href='/go/FlightStatus/flightStatusByAirport.do?airportCode="+sb+"&airportQueryDate="+tb+"&airportQueryType=0'>"+sb+" Departures</a><br/>"+"<a href='/go/FlightStatus/flightStatusByAirport.do?airportCode="+sb+"&airportQueryDate="+tb+"&airportQueryType=1'>"+sb+" Arrivals</a>";}
xb.innerHTML=yb+"<br/>"+zb;vb.appendChild(wb);vb.appendChild(xb);var Ab=document.createElement('div');Ab.style.position='relative';Ab.style.paddingTop='3px';Ab.style.paddingBottom='3px';var Bb=document.createElement('div');Bb.style.position='absolute';Bb.style.width='90px';Bb.style.left='0px';Bb.style.font='10px arial, verdana, sans-serif';if(default_airport_info_type=='faa_delays'){Bb.innerHTML='<b>Airport Status:</b>';}
else{Bb.innerHTML='<b>Delay Index:</b><br/><a href="/go/Airport/airportDelayIndexFaq.do?">What\'s This?</a>';}
var Cb=document.createElement('div');Cb.style.position='relative';Cb.style.width='169px';Cb.style.left='90px';Cb.style.font='10px arial, verdana, sans-serif';if(default_airport_info_type=='faa_delays'){var Db="";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 Eb=ob.getElementsByTagName("closure")[0];Db=Db+"<img src='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+Eb.getAttribute("graphic")+"'> "+Eb.getAttribute("description")+"<br/>";}
if(ob.getElementsByTagName("deicing")[0]){var Fb=ob.getElementsByTagName("deicing")[0];Db=Db+"<img src='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+Fb.getAttribute("graphic")+"'> "+Fb.getAttribute("description")+"<br/>";}
if(ob.getElementsByTagName("groundStop")[0]){var Gb=ob.getElementsByTagName("groundStop")[0];Db=Db+"<img src='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+Gb.getAttribute("graphic")+"'> "+Gb.getAttribute("description")+"<br/>";}
if(ob.getElementsByTagName("groundDelayProgram")[0]){var Hb=ob.getElementsByTagName("groundDelayProgram")[0];Db=Db+"<img src='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+Hb.getAttribute("graphic")+"'> "+Hb.getAttribute("description")+"<br/>";}
if(ob.getElementsByTagName("delays")[0]){var Ib=ob.getElementsByTagName("delays")[0];Db=Db+"<img src='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+Ib.getAttribute("graphic")+"'> "+Ib.getAttribute("description")+"<br/>";}}
else{if(ob.getAttribute("graphic")&&ob.getAttribute("description")){Db=Db+"<img src='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+ob.getAttribute("graphic")+"'> "+ob.getAttribute("description")+"<br/>";}}
if(application==null){Db=Db+"<a href='/go/Airport/delays.do?airportCode="+sb+"&airportQueryDate="+tb+"'>Delay Details</a>";}
Cb.innerHTML=Db;}
else if(pb.getAttribute("scoreAvailable")){var Jb='';if(pb.getAttribute("scoreAvailable")=='true'){Jb=pb.getAttribute("score")+' - ';}
Jb=Jb+pb.getAttribute("description");var Kb=document.createElement('div');Kb.style.position='relative';Kb.style.width='107px';Kb.style.left='0px';var Lb=document.createElement('div');Lb.style.position='relative';Lb.style.width='107px';Lb.style.left='0px';Lb.style.font='10px arial, verdana, sans-serif';Lb.align='center';Lb.innerHTML='<b>'+Jb+'</b>';var Mb=document.createElement('div');Mb.style.position='relative';Mb.style.width='107px';Mb.style.height='8px';Mb.style.left='0px';var Nb='';if(pb.getAttribute("scoreAvailable")=='true'){var Ob=parseFloat(pb.getAttribute("scorePercentage"));var Pb=parseFloat(pb.getAttribute("scorePercentageRemainder"));var Qb=parseFloat(pb.getAttribute("changeRatePercentage"));var Rb=Ob;var Sb=Pb;if(Qb!=0){if(Ob<=50){Sb-=30;}
else if(Ob>50){Rb-=30;}}
Nb='<img src="http://dem5xqcn61lj8.cloudfront.net/spacer.gif" style="width: '+Rb+'px; height: 1px;">';if(Ob<=50){Nb=Nb+'<img src="http://dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/orange_indicator.gif"/>';}
if(Qb<0&&Qb!=0){Nb=Nb+'<img src="http://dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/trend_down_2.gif"/>';}
if(Qb>0&&Qb!=0){Nb=Nb+'<img src="http://dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/trend_up_2.gif"/>';}
if(Ob>50){Nb=Nb+'<img src="http://dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/orange_indicator.gif"/>';}
Nb=Nb+'<img src="http://dem5xqcn61lj8.cloudfront.net/spacer.gif" style="width: '+Sb+'px; height: 1px;">';}
else{Nb='<img src="http://dem5xqcn61lj8.cloudfront.net/spacer.gif" style="width: 107px; height: 1px;">';}
Mb.innerHTML=Nb;var Tb=document.createElement('div');Tb.style.position='relative';Tb.style.width='107px';Tb.style.height='18px';Tb.style.left='0px';if(pb.getAttribute("scoreAvailable")=='true'){var Ub=parseFloat(pb.getAttribute("score"));if(Ub<=1){Tb.innerHTML='<img src="http://dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/therm_bkgd_10.gif"/>';}
else if(Ub<=2){Tb.innerHTML='<img src="http://dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/therm_bkgd_20.gif"/>';}
else if(Ub<=3){Tb.innerHTML='<img src="http://dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/therm_bkgd_30.gif"/>';}
else if(Ub<=4){Tb.innerHTML='<img src="http://dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/therm_bkgd_40.gif"/>';}
else{Tb.innerHTML='<img src="http://dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/therm_bkgd_50.gif"/>';}}
else{Tb.innerHTML='<img src="http://dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/therm_bkgd_00.gif"/>';}
var Vb=document.createElement('div');Vb.style.position='relative';Vb.style.width='107px';Vb.style.height='9px';Vb.style.left='0px';Vb.innerHTML='<img src="http://dem5xqcn61lj8.cloudfront.net/AirportDelayIndex/low_high_text.gif"/>';var Wb=document.createElement('div');Wb.style.position='absolute';Wb.style.width='58px';Wb.style.left='111px';Wb.style.top='23px';var Xb="";if(application==null){Xb=Xb+"<a href='/go/Airport/delays.do?airportCode="+sb+"&airportQueryDate="+tb+"'>Details</a>";}
Wb.innerHTML=Xb;Kb.appendChild(Lb);Kb.appendChild(Mb);Kb.appendChild(Tb);Kb.appendChild(Vb);Cb.appendChild(Kb);Cb.appendChild(Wb);}
if(default_airport_info_type=='faa_delays'){Ab.style.paddingBottom='3px';}
else{Ab.style.paddingBottom='5px';}
Ab.appendChild(Bb);Ab.appendChild(Cb);var Yb=document.createElement('div');Yb.style.position='relative';Yb.style.paddingTop='3px';if(!nb.getAttribute("graphic")){Yb.style.paddingBottom='3px';}
else{Yb.style.paddingBottom='7px';}
Yb.style.borderTop='1px solid #F9981B';var Zb=document.createElement('div');Zb.style.position='absolute';Zb.style.width='90px';Zb.style.left='0px';Zb.style.font='10px arial, verdana, sans-serif';Zb.innerHTML='<b>Weather:</b>';var $b=document.createElement('div');$b.style.position='relative';$b.style.width='169px';$b.style.left='90px';if(!nb.getAttribute("graphic")&&!nb.getAttribute("condition")&&!nb.getAttribute("tempC")&&!nb.getAttribute("tempF")){$b.style.font='10px arial, verdana, sans-serif';$b.innerHTML="Unavailable";}
else{if(nb.getAttribute("graphic")){var ac=document.createElement('div');ac.style.position='absolute';ac.style.width="40px";ac.style.left="0px";ac.style.paddingTop="3px";ac.innerHTML="<img src='http://dem5xqcn61lj8.cloudfront.net/Weather/"+nb.getAttribute("graphic")+"' style='width: 33px; height: 35px;'/>";$b.appendChild(ac);}
var bc=document.createElement('div');bc.style.position='relative';bc.style.border="0px solid";if(nb.getAttribute("graphic")){bc.style.width="129px";bc.style.left="40px";}
else{bc.style.left="0px";}
bc.style.font='10px arial, verdana, sans-serif';var cc="";if(nb.getAttribute("condition")){cc=cc+nb.getAttribute("condition")+"<br/>";}
if(nb.getAttribute("tempC")){cc=cc+nb.getAttribute("tempC")+"&deg;C";}
if(nb.getAttribute("tempF")){var dc="";var ec="";if(nb.getAttribute("tempC")){dc=dc+" (";ec=ec+")";}
cc=cc+dc+nb.getAttribute("tempF")+"&deg;F"+ec;}
if(application==null){cc=cc+"<br/><a href='/go/Airport/weather.do?airport="+sb+"'>Details</a>";}
bc.innerHTML=cc;$b.appendChild(bc);}
Yb.appendChild(Zb);Yb.appendChild($b);var fc=document.createElement('div');fc.style.position='relative';fc.style.paddingTop='3px';fc.style.borderTop='1px solid #F9981B';var gc=document.createElement('div');gc.style.position='absolute';gc.style.width='90px';gc.style.left='0px';gc.style.font='10px arial, verdana, sans-serif';gc.innerHTML='<b>At the Airport:</b>';var hc=document.createElement('div');hc.style.position='relative';hc.style.width='169px';hc.style.left='90px';hc.style.font='10px arial, verdana, sans-serif';var ic="";var jc="";var kc="0";if(qb.getAttribute("numOfItemsToday")){kc=qb.getAttribute("numOfItemsToday");}
ic="Chatter: <a "+jc+"href='/go/Airport/airportChatter.do?airport="+sb+"&category=0&tag=0&dateRange=Today'>"+kc+" Posts Today</a>";var lc="<a "+jc+"href='/go/Airport/modifyAirportUserRating.do?airportCode="+sb+"'>No Rating Available</a>";if(rb.getAttribute("overallAverage")){var mc=parseFloat(rb.getAttribute("overallAverage"));var nc="../images/"+rb.getAttribute("graphic");lc="<img src='"+nc+"' style='height: 10px;'/> <a "+jc+"href='/go/Airport/airportUserRatingsByAirport.do?airport="+sb+"'>"+mc+" of 5</a>";}
ic=ic+"<br/>User Rating: "+lc;hc.innerHTML=ic;fc.appendChild(gc);fc.appendChild(hc);ub.appendChild(vb);ub.appendChild(Ab);ub.appendChild(Yb);ub.appendChild(fc);return ub;}
function createAirportMarker(oc,pc,qc,rc){var sc=new GMarker(oc,pc);GEvent.addListener(sc,"click",function(){var tc=GXmlHttp.create();trackEvent('AirportMarker','Click','Show Detail');tc.open('GET','/go/Suggest/airportDetailsSuggestProcess.do?airportCode='+qc,true);tc.onreadystatechange=function(){if(tc.readyState==4){if(null==tc.responseXML)return;var uc=tc.responseXML;map.savePosition();var vc=createMarkerContent(uc);sc.closeToolTip();sc.openLittleInfoWindow(rc,vc);currentMarker=sc;}}
tc.send(null);});GEvent.addListener(sc,"mouseover",function(){if(currentMarker==null||sc!=currentMarker){sc.openToolTip(rc+' (click for details)');}});GEvent.addListener(sc,"mouseout",function(){sc.closeToolTip();});return sc;}
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(wc,xc,yc){var zc=null;var Ac=0;if(yc!=null&&yc!=""){var Bc=yc.split(",");zc=Bc[0];Ac=parseInt(Bc[4]);if(-1!=zc.lastIndexOf("us_region")){zc="US";}}
var Cc=GXmlHttp.create();if(Ac==0){Cc.open('GET','/go/Suggest/airportInfoTypeSuggestProcess.do?includeGlobal=true&airportInfoType='+wc,true);}
else{Cc.open('GET','/go/Suggest/airportInfoTypeSuggestProcess.do?includeGlobal=true&airportInfoType='+wc+'&country='+zc+'&classification=4&desiredResultsPoolSize=500',true);}
Cc.onreadystatechange=function(){if(Cc.readyState==4){if(null==Cc.responseXML)return;xc.clearMarkers();var Dc=Cc.responseXML;var Ec=Dc.documentElement.getElementsByTagName("airport");var Fc=[];var Gc=[];var Hc=[];var Ic=[];indexMarkersZ5=[];for(i=0;i<Ec.length;i++){var Jc=Ec[i];var Kc=Jc.getAttribute("code");var Lc=Jc.getAttribute("longitude");var Mc=Jc.getAttribute("latitude");var Nc=Kc+" - "+Jc.getAttribute("city")+", ";if(Jc.getAttribute("stateCode")){Nc=Nc+Jc.getAttribute("stateCode")+", ";}
Nc=Nc+Jc.getAttribute("countryCode");var Oc;var Pc;if(wc=='delay_indexes'){Pc=Jc.getAttribute("scoreGraphic");}
else if(wc=='faa_delays'){Pc=Jc.getAttribute("FAADelayGraphic");}
else if(wc=='highest_rated'||wc=='most_rated'){Pc=Jc.getAttribute("ratingGraphic");}
Oc=createIcon("http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+Pc,9,4,10);var Qc=createAirportMarker(new GPoint(Lc,Mc),Oc,Kc,Nc);if(wc!='delay_indexes'){Fc.push(Qc);}
else{var Rc=parseInt(Jc.getAttribute("classification"));if(1==Rc){Gc.push(Qc);}
else if(2==Rc){Hc.push(Qc);}
else if(3==Rc){Ic.push(Qc);}
else if(4==Rc){indexMarkersZ5.push(Qc);}}}
if(wc!='delay_indexes'){xc.addMarkers(Fc,2);}
else{xc.addMarkers(Gc,2);xc.addMarkers(Hc,4);xc.addMarkers(Ic,5);xc.addMarkers(indexMarkersZ5,5);}
xc.refresh();}}
Cc.send(null);}
function addMoreMarkers(Sc,Tc,Uc,Vc){var Wc=GXmlHttp.create();Wc.open('GET','/go/Suggest/airportInfoTypeSuggestProcess.do?airportInfoType=delay_indexes&country='+Tc+'&classification='+Uc+'&desiredResultsPoolSize='+Vc,true);Wc.onreadystatechange=function(){if(Wc.readyState==4){if(null==Wc.responseXML)return;var Xc=Wc.responseXML;var Yc=Xc.documentElement.getElementsByTagName("airport");indexMarkersZ5=[];for(i=0;i<Yc.length;i++){var Zc=Yc[i];var $c=Zc.getAttribute("code");var ad=Zc.getAttribute("longitude");var bd=Zc.getAttribute("latitude");var cd=$c+" - "+Zc.getAttribute("city")+", ";if(Zc.getAttribute("stateCode")){cd=cd+Zc.getAttribute("stateCode")+", ";}
cd=cd+Zc.getAttribute("countryCode");var dd=Zc.getAttribute("scoreGraphic");var ed=createIcon("http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/"+dd,9,4,10);var fd=createAirportMarker(new GPoint(ad,bd),ed,$c,cd);indexMarkersZ5.push(fd);}
Sc.addMarkers(indexMarkersZ5,5);Sc.refresh();}}
Wc.send(null);}
function addMapListeners(gd){var A=function addMoveS(){GEvent.addListener(map,'movestart',function(){map.savePosition();});}
setTimeout(A,0);var C=function zoomPics(){GEvent.addListener(map,'zoomend',function(hd,id){checkPanZoomPics(id);});}
setTimeout(C,0);}
function checkPanZoomPics(jd){var kd=17;var ld=0;if(map.getCurrentMapType().getName()=='FlightStats'){kd=5;ld=2;}
if(jd>=kd){document.images['map_zoom_in'].src='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_in_inactive.png';document.images['map_zoom_out'].src='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_out_off.png';document.getElementById('zoom_in').style.cursor='auto';document.getElementById('zoom_out').style.cursor='pointer';}
else if(jd<=ld){document.images['map_zoom_in'].src='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_in_off.png';document.images['map_zoom_out'].src='http://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='http://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='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_out_off.png';}
document.getElementById('zoom_in').style.cursor='pointer';document.getElementById('zoom_out').style.cursor='pointer';}
if(xIE4Up){correctPNG('map_zoom_in');correctPNG('map_zoom_out');}}
function zoom(md){if(md==1){map.zoomIn();}
else map.zoomOut();}
function pan(x,y){map.panDirection(x,y);}
function mapType(nd){if(nd=='custom'){map.setMapType(fs_map_type);if(map.getZoom()==2){markerManager.updateMarkers_();}}
else if(nd=='streets'){map.setMapType(G_NORMAL_MAP);}
else if(nd=='sat'){map.setMapType(G_SATELLITE_MAP);}
else if(nd=='hybrid'){map.setMapType(G_HYBRID_MAP);}
else if(nd=='physical'){map.setMapType(G_PHYSICAL_MAP);}
else map.setMapType(fs_map_type);checkPanZoomPics(map.getZoom());}
function mapLoading(od){document.getElementById('map_loading').style.display='block';var pd=function(){document.getElementById('map_loading').style.display='none';}
setTimeout(pd,2500);}
function airportInfoType(qd){if(currentMarker!=null){currentMarker.closeLittleInfoWindow(true);}
if(qd=='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(qd=='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(qd,markerManager,geo_country_default);}
function correctPNG(rd){var sd=document.images[rd];sd.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+sd.src+")";sd.src="http://dem5xqcn61lj8.cloudfront.net/spacer.gif";}
function exchangeImg(td,ud,vd,wd){document.images[td].src=ud;if(vd){var xd=17;var yd=0;if(map.getCurrentMapType().getName()=='FlightStats'){xd=5;yd=2;}
if(td=='map_zoom_in'&&map.getZoom()>=xd){document.images['map_zoom_in'].src='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_in_inactive.png';document.getElementById('zoom_in').style.cursor='auto';}
else if(td=='map_zoom_out'&&map.getZoom()<=yd){document.images['map_zoom_out'].src='http://dem5xqcn61lj8.cloudfront.net/GoogleMapTools/zoom_out_inactive.png';document.getElementById('zoom_out').style.cursor='auto';}}
if(xIE4Up){correctPNG(td);}}
function parsePanZoom(zd){if(zd!=null&&zd!=""){if(currentMarker!=null){currentMarker.closeLittleInfoWindow(false);}
if(debug_parsepanzoom){console.log('----->');console.log('----->');console.log('-----> selected country/region : '+zd);}
var Ad=zd.split(",");var Bd=Ad[0];var Cd=Ad[1];var Dd=Ad[2];var Ed=parseInt(Ad[3]);if(Ed>5){Ed=5;}
if(debug_parsepanzoom){console.log('-----> region : '+Bd);console.log('-----> lat : '+Cd);console.log('-----> lng : '+Dd);console.log('-----> zoom (corrected) : '+Ed);console.log('----->');console.log('----->');}
map.setCenter(new GLatLng(Cd,Dd),Ed);geo_country_default=zd;}}
function addMoreRegionMarkers(Fd,Gd){if(Fd!=null&&Fd!=""&&default_airport_info_type=="delay_indexes"){if(null!=indexMarkersZ5){for(i=0;i<indexMarkersZ5.length;i++){var Hd=indexMarkersZ5[i];markerManager.removeMarker(Hd);}}
var Id=Fd.split(",");var Jd=Id[0];var Kd=Id[1];var Ld=Id[2];var Md=parseInt(Id[3]);var Nd=parseInt(Id[4]);var Od=500;if(-1!=Jd.lastIndexOf("us_region")){Jd="US";}
if(1==Nd){if(null==Gd){addMoreMarkers(markerManager,Jd,4,Od);}
else{addMoreMarkers(Gd,Jd,4,Od);}}
geo_country_default=Fd;}}
function showLegend(Pd){if(Pd){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(xIE4Up){for(i=0;i<pngs_to_correct.length;i++){correctPNG(pngs_to_correct[i]);}}
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);}}}