function O(){H();var url=gk+"?key="+Math.random();var request=GXmlHttp.create();request.open("GET",url,true);request.onreadystatechange=function(){if(request.readyState==4){bI(request);}};request.send(null);};function bI(jQ){try{if(jQ.readyState==4){if(jQ.status==200){bU(jQ.responseXML);}else{cn();}}}catch(e){cn();A("Bus information is not currently available.  Please try again later. (SCABI-E) "+e);}jQ=null;t();};function bU(xml){if(jl!=null)I();var dx=xml.getElementsByTagName("buses");if(D(dx,"",false))return;if(gK==null){H();}var ed=dx[0].getElementsByTagName("bus");aD();for(var gs=0;gs<ed.length;gs++){var cB=new J();cB.hC=ed[gs].getElementsByTagName("rt")[0].firstChild.data;if(cB.hC=="OR"){cB.actualRouteTag=ed[gs].getElementsByTagName("ar")[0].firstChild.data;}cB.color=ed[gs].getElementsByTagName("c")[0].firstChild.data;cB.cC=ed[gs].getElementsByTagName("pid")[0].firstChild.data;cB.cO=ed[gs].getElementsByTagName("pd")[0].firstChild.data;cB.du=ed[gs].getElementsByTagName("id")[0].firstChild.data;cB.direction=ed[gs].getElementsByTagName("d")[0].firstChild.data;cB.directionDisplay=ed[gs].getElementsByTagName("dd")[0].firstChild.data;cB.heading=ed[gs].getElementsByTagName("dn")[0].firstChild.data;cB.cL=ed[gs].getElementsByTagName("run")[0].firstChild.data;cB.cS=ed[gs].getElementsByTagName("fs")[0].firstChild.data;cB.cN=ed[gs].getElementsByTagName("op")[0].firstChild.data;cB.fF=new GLatLng(ed[gs].getElementsByTagName("lat")[0].firstChild.data,ed[gs].getElementsByTagName("lon")[0].firstChild.data);if(map.getBounds().containsLatLng(cB.fF)){cB.ft();}else{cB.visible=false;}cU.push(cB);if(fX&&fl.type=="bus"&&fl.marker.du==cB.du&&cB.visible){fl.marker=cB.marker;hs();}if(je&&cB.visible&&tooltip.marker.du==cB.du){tooltip.marker=cB.marker;bp(tooltip.marker);}}da=window.setTimeout("O()",eb*1000);var eQ=new Date();var fV=eQ.getHours();var fi=fV;if(fV>12)fi=fV-12;if(fV==0)fi=12;var gR=eQ.getMinutes();if(gR<10)gR="0"+gR;fh=fi+":"+gR+" ";if(fV>11){fh+="PM";}else{fh+="AM";}t();};function cn(){da=window.setTimeout("O()",eb*1000*2);};function aD(){if(cU!=null){for(var i=0;i<cU.length;i++){cU[i].remove();}}cU=new Array();}