ServicePanel.prototype.serviceRow=1;ServicePanel.prototype.disabledServiceGroup=2;ServicePanel.prototype.spacingDiv=3;function ServicePanel(C,D,A,B){this.servicePanelId=C;this.panelDataName=A;this.direction=D;this.numberOfTemplates=2;this.normalRowTemplate=0;this.unavailableRowTemplate=1;this.serviceSelected=false;this.selectedFareGroup=null;this.numberOfServices=0;this.spacingDivHeight=0;this.showingTimetables=B}ServicePanel.prototype.AddEventListener=function(B,A){if(this.changedEvent==undefined){this.changedEvent=new YAHOO.util.CustomEvent("ServiceSelected"+this.direction)}this.changedEvent.subscribe(A,B,true)};ServicePanel.prototype.FireEvent=function(A){if(this.changedEvent!=undefined){this.changedEvent.fire(this.direction,A)}};ServicePanel.prototype.ShowServices=function(C,B){this.serviceData=C;this.bAllServicesReceived=B;if(this.tableContents==undefined){this.servicePanel=document.getElementById(this.servicePanelId);this.availableTrainsTitle=YAHOO.util.Dom.getElementsByClassName("AvailableTrainsTitle",undefined,this.servicePanel)[0];this.tableContents=YAHOO.util.Dom.getElementsByClassName("TableContents",undefined,this.servicePanel)[0];this.tableHeader=YAHOO.util.Dom.getElementsByClassName("TableHeader",undefined,this.servicePanel)[0];this.gettingServiceData=YAHOO.util.Dom.getElementsByClassName("GettingServiceData",undefined,this.servicePanel)[0];this.availableTrainsCount=YAHOO.util.Dom.getElementsByClassName("AvailableTrainsCount",undefined,this.servicePanel)[0];YAHOO.util.Event.addListener(this.tableContents,"scroll",this.OnScroll,this,true);this.tableContents.servicePanel=this}this.Clear();this.AddAllServices();var A=this.GetTableRows();if(A.length==this.numberOfTemplates){if(mixingDeck.journeyPlanningData.data.directServicesOnly){this.availableTrainsTitle.innerHTML=mixingDeck.resourceStrings.noDirectServicesFound;ShowElement(this.availableTrainsCount,false)}else{this.availableTrainsTitle.innerHTML=mixingDeck.resourceStrings.noServicesFound;ShowElement(this.availableTrainsCount,false)}}else{if(this.bAllServicesReceived){this.SetHeaderToSortable();this.SetAvailableTrainsCount()}else{this.CreateSpacingDiv()}}};ServicePanel.prototype.Clear=function(){var A=this.GetTableRows();for(var B=A.length-1;B>=this.numberOfTemplates;B--){this.RemoveRow(A[B])}this.UpdateTableRows()};ServicePanel.prototype.AddAllServices=function(){for(var A in this.serviceData){this.AddServiceData(this.serviceData[A],null)}this.UpdateTableRows()};ServicePanel.prototype.AddServices=function(H,B,K){this.ShowGettingServiceData(false);var A=this.tableContents.scrollHeight-this.spacingDivHeight;var C=null;var F=this.GetTableRows();var J;for(var E in H){J=false;for(var I in F){if(F[I].service){if((F[I].service.dTime!=H[E].dTime&&F[I].service.dTime>H[E].dTime)||(F[I].service.dTime==H[E].dTime&&F[I].service.aTime>H[E].aTime)){this.AddServiceData(H[E],F[I]);J=true;break}}}if(!J){this.AddServiceData(H[E],null)}}this.RemoveSpacingDiv();this.UpdateTableRows();if(!this.bAllServicesReceived&&K){this.bAllServicesReceived=K;this.SetHeaderToSortable();this.SetAvailableTrainsCount()}this.HideUnavailableServices();this.UpdateTableRows();if(!this.bAllServicesReceived){this.CreateSpacingDiv()}if(B){this.disableScroll=true;var D=this.tableContents.scrollHeight-A;var G=this.tableContents.scrollTop+D;this.tableContents.scrollTop=G;if(this.tableContents.scrollTop!=G){this.tableContents.scrollTop-=1}this.disableScroll=false}};ServicePanel.prototype.SetScrollPosition=function(){if(this.tableContents.scrollTop==0){this.tableContents.scrollTop=1}};ServicePanel.prototype.AddServiceData=function(B,D){this.numberOfServices++;var A=this.GetTableRows()[this.normalRowTemplate];var E=A.cloneNode(true);this.tableContents.insertBefore(E,D);E.rowType=this.serviceRow;E.service=B;var F=GetFirstDiv(GetFirstDiv(E));F=GetNextDiv(F);F.innerHTML=FormatTime(B.dTime);F=GetNextDiv(F);F.innerHTML=FormatTime(B.aTime);F=GetNextDiv(F);F.innerHTML=B.nChgs;F=GetNextDiv(F);F.innerHTML=FormatDuration(B.dur*1)+"hrs";F=GetNextDiv(F);E.webDiscount=GetFirstDiv(F);E.fareDiv=GetNextDiv(E.webDiscount);F=GetNextDiv(F);ShowElement(E,true);if(this.rowHeight==undefined){this.rowHeight=E.scrollHeight;this.rowsVisible=Math.ceil(this.tableContents.clientHeight/E.scrollHeight)}var C=new Object();C.servicePanel=this;C.tableRow=E;YAHOO.util.Event.addListener(E,"mouseover",this.MouseOver,C);YAHOO.util.Event.addListener(E,"mouseout",this.MouseOut,C);YAHOO.util.Event.addListener(E,"click",this.MouseClick,C);this.SetServiceAvailability(this.selectedFareGroup,E);this.SetInformationImage(E);this.SetTOCInformationImage(E,B)};ServicePanel.prototype.SetTOCInformationImage=function(C,B){var D=GetChildWithStyle(C,"TOCInformation",true);if(D){var A=0;if(C.service.warning){A=3}else{if(!this.IsAvailable(C)){A=2}else{if(C.hover){A=1}else{A=0}}}A=(A*-12)+"px 0px";if(D.style.backgroundImage!=A){D.style.backgroundPosition=A}if(B.serviceLegs!=undefined){for(var E=0;E<B.serviceLegs.length;E++){if(B.serviceLegs[E].tocImage!=null&&B.serviceLegs[E].tocImage!=""&&B.serviceLegs[E].tocImage!=undefined&&B.serviceLegs[E].tocImage!=""){D.style.backgroundImage="url("+ImagePath+B.serviceLegs[E].tocImage+")";break}}}}};ServicePanel.prototype.RemoveRow=function(A){YAHOO.util.Event.removeListener(A,"mouseover",this.MouseOver);YAHOO.util.Event.removeListener(A,"mouseout",this.MouseOut);YAHOO.util.Event.removeListener(A,"click",this.MouseClick);this.tableContents.removeChild(A)};ServicePanel.prototype.MouseOver=function(D,B){var C=B.servicePanel;var A=B.tableRow;if(!A.hover){A.hover=true;if(A.service!=undefined&&!C.serviceSelected&&C.IsAvailable(A)){C.FireEvent(A.service)}}C.SetAppearance(A)};ServicePanel.prototype.MouseOut=function(G,C){var I=C.servicePanel;var D=C.tableRow;if(StillInsideElementOnMouseOut(D,G)){return }D.hover=false;if(D.service!=undefined&&!I.serviceSelected&&I.IsAvailable(D)){var E=G.relatedTarget||G.toElement;var H=(E==null||E==undefined);if(!H){var B=E;var F;var A;while(B!=undefined){if(HasClass(B,"TableRow")){F=B}if(B.id==I.servicePanelId){A=true;break}B=B.parentNode}H=(F==undefined||F.service==undefined||!I.IsAvailable(F)||!A)}if(H){I.FireEvent(null)}}I.SetAppearance(D)};ServicePanel.prototype.SelectService=function(B){var A=this.ScrollToShowService(B);A.service.selected=false;var C=new Object();C.servicePanel=this;C.tableRow=A;this.MouseClick(undefined,C)};ServicePanel.prototype.ScrollToShowTime=function(A,D){var B=this.GetTableRows();for(var C in B){if(D){if(B[C].service&&B[C].service.dTime>A){this.ScrollToShowService(B[C].service,true);return }}else{if(B[C].service&&B[C].service.aTime>A){if(C>this.numberOfTemplates){C=C-1}this.ScrollToShowService(B[C].service,false);return }}}};ServicePanel.prototype.ScrollToShowService=function(A,D){var F=this.GetTableRows();for(var G in F){if(F[G].service==A){break}}this.disableScroll=true;var E=YAHOO.util.Dom.getRegion(F[G]);var B=YAHOO.util.Dom.getRegion(F[G].parentNode);if(D){var C=F[G].parentNode.scrollTop+E.top-B.top;F[G].parentNode.scrollTop=C;if(F[G].parentNode.scrollTop!=C){F[G].parentNode.scrollTop-=1}}else{if(E.bottom>B.bottom){F[G].parentNode.scrollTop+=E.bottom-B.bottom}else{if(E.top<B.top){F[G].parentNode.scrollTop+=E.top-B.top}}}this.disableScroll=false;return F[G]};ServicePanel.prototype.MouseClick=function(D,B){var C=B.servicePanel;var A=B.tableRow;if(!C.IsAvailable(A)){return }if(A.rowType!=C.serviceRow){return }if(A.service.selected){A.service.selected=false;C.FireEvent(A.service)}else{C.ClearSelection();A.service.selected=true;C.FireEvent(A.service)}C.SetAppearance(A);C.serviceSelected=A.service.selected};ServicePanel.prototype.OnScroll=function(C,A){if(this.disableScroll){return }mixingDeck.stoppingPointPanel.HidePanel();var B=this.GetCurrentScrollPosition();if(B<0){if(mixingDeck.StartFTAEnquiryExtension((this.direction==outward)?"O":"R","E")){this.ShowGettingServiceData(true)}}else{if(B>0){if(mixingDeck.StartFTAEnquiryExtension((this.direction==outward)?"O":"R","L")){this.ShowGettingServiceData(true)}}}};ServicePanel.prototype.GetCurrentScrollPosition=function(){var E=this.GetTableRows();var A=E.length-1;while(A>=0&&E[A].style.display=="none"){A--}var B=YAHOO.util.Dom.getRegion(this.tableContents);var C=YAHOO.util.Dom.getRegion(E[this.numberOfTemplates]);var D=YAHOO.util.Dom.getRegion(E[A]);if(C.top>=B.top){return -1}if(D.bottom<=B.bottom){return 1}return 0};ServicePanel.prototype.ClearSelection=function(){if(!this.serviceSelected){return }var A=this.GetTableRows();for(var B=this.numberOfTemplates;B<A.length;B++){if(A[B].service&&A[B].service.selected){A[B].service.selected=false;this.SetAppearance(A[B]);break}}this.serviceSelected=false};ServicePanel.prototype.SetAvailableServices=function(C){this.selectedFareGroup=C;this.RemoveSpacingDiv();this.RemoveAllDisabledServiceGroupRows();this.EnableAllRows();var A=this.GetTableRows();for(var B=this.numberOfTemplates;B<A.length;B++){this.SetServiceAvailability(C,A[B])}this.HideUnavailableServices();if(!this.bAllServicesReceived){this.CreateSpacingDiv()}else{this.SortByColumn(this.sortColumn)}this.SetScrollPosition()};ServicePanel.prototype.SetServiceAvailability=function(C,B){if(C==null){this.SetServicePrice(B)}else{var A=B.service;if(A._available){if(this.direction==inward&&C.isReturn){this.SetServicePrice(B)}else{this.SetServicePrice(B,A._serviceFare,A.isDiscounted)}}else{this.SetServicePrice(B);if(B.service.selected&&C.selected){B.service.selected=false;this.FireEvent(null)}}}this.SetAppearance(B)};ServicePanel.prototype.SetAppearance=function(A){var G="";var D="none";var F="";var C="";var B="";var H="";if(A.rowType!=this.serviceRow){if(A.hover){G="url("+ImagePath+"ServiceRollOver.gif)";D="none";F="";C="";B="#b4c1cb";YAHOO.util.Dom.addClass(A,"Hover")}else{YAHOO.util.Dom.removeClass(A,"Hover")}}else{if(!this.IsAvailable(A)){B="#b4c1cb";H=mixingDeck.resourceStrings.serviceNotAvailable;this.SetInformationImage(A);C="#ffffff"}else{if(A.hover){B="#002e4f";if(A.service.selected){G="url("+ImagePath+"ServiceSelectedRollOver.gif)";D="solid 1px #ef3e33";F="0";C="#e6d152"}else{G="url("+ImagePath+"ServiceRollOver.gif)";D="none";F="";C=""}}else{if(A.service.selected){G="url("+ImagePath+"ServiceSelected.gif)";D="solid 1px #ef604f";F="0";C="#e4dca3";B="#002e4f"}}this.SetInformationImage(A)}}if(mixingDeck.disablesleeperservices==1){if(this.IsSleeperService(A)){B="#b4c1cb";H=mixingDeck.resourceStrings.serviceCannotBeSelected;this.SetInformationImage(A);C="#ffffff"}}var E=GetFirstDiv(A);if(E.title!=H){E.title=H}if(E.style.color!=B){E.style.color=B}if(E.style.backgroundImage!=G){E.style.backgroundImage=G}if(E.style.border!=D){E.style.border=D}if(E.style.padding!=F){E.style.padding=F}if(E.style.backgroundColor!=C){E.style.backgroundColor=C}};ServicePanel.prototype.SetInformationImage=function(B){var C=GetChildWithStyle(B,"ServiceInformation",true);if(C){var A=0;if(B.service.warning){A=3}else{if(!this.IsAvailable(B)){A=2}else{if(B.hover){A=1}else{A=0}}}A=(A*-12)+"px 0px";if(C.style.backgroundImage!=A){C.style.backgroundPosition=A}}};ServicePanel.prototype.GetTableRows=function(A){if(this.tableRows==undefined||A){this.UpdateTableRows()}return this.tableRows};ServicePanel.prototype.UpdateTableRows=function(A){if(this.tableRows==undefined){this.tableRows=YAHOO.util.Dom.getElementsByClassName("TableRow",undefined,this.tableContents)}else{this.tableRows[0]=GetFirstDiv(this.tableContents);var B=1;var C=GetNextDiv(this.tableRows[0]);while(C!=undefined){this.tableRows[B]=C;C=GetNextDiv(C);B++}this.tableRows.length=B}};ServicePanel.prototype.SetServicePrice=function(A,C,B){if(B){SetVisibility(A.webDiscount,true);YAHOO.util.Dom.addClass(A.fareDiv,"DiscountedFarePrice")}else{SetVisibility(A.webDiscount,false);YAHOO.util.Dom.removeClass(A.fareDiv,"DiscountedFarePrice")}if(C==undefined){if(this.showingTimetables){ShowElement(A.webDiscount,false);var D;if(this.direction==outward){D=(A.service.oNlc!=mixingDeck.journeyPlanningData.data.requestedOriginNlc||A.service.dNlc!=mixingDeck.journeyPlanningData.data.requestedDestinationNlc)}else{D=(A.service.dNlc!=mixingDeck.journeyPlanningData.data.requestedOriginNlc||A.service.oNlc!=mixingDeck.journeyPlanningData.data.requestedDestinationNlc)}if(D){A.fareDiv.innerHTML=mixingDeck.journeyPlanningData.data.locations[A.service.oNlc].crs+"&rarr;"+mixingDeck.journeyPlanningData.data.locations[A.service.dNlc].crs}A.title=mixingDeck.journeyPlanningData.data.locations[A.service.oNlc].desc+" to "+mixingDeck.journeyPlanningData.data.locations[A.service.dNlc].desc;for(var E in A.service.tocs){A.title+=" \nOperator "+mixingDeck.journeyPlanningData.data.tocs[A.service.tocs[E]].name}}else{A.fareDiv.innerHTML=""}A.price=undefined}else{A.fareDiv.innerHTML=FormatPrice(C);A.price=C}};ServicePanel.prototype.IsShowingWaitPanel=function(A){return this.gettingServiceData.style.display=="block"};ServicePanel.prototype.ShowGettingServiceData=function(A){ShowElement(this.gettingServiceData,A)};ServicePanel.prototype.HideUnavailableServices=function(){var C=this.GetTableRows();var E=0;var A=0;var D=true;for(var F=C.length-1;F>=this.numberOfTemplates-1;F--){if(C[F].rowType==this.serviceRow&&!this.IsAvailable(C[F])){E++}else{if(C[F].rowType==this.disabledServiceGroup){A=C[F].serviceCount;D=C[F].isClosed}else{if(E>1){if(A!=E){var B=F+1;while(C[B]!=undefined){if(C[B].rowType==this.serviceRow){if(this.IsAvailable(C[B])){break}else{ShowElement(C[B],!D)}}else{if(C[B].rowType==this.disabledServiceGroup){this.RemoveDisabledServiceGroupRow(C[B])}}B++}this.AddServiceUnavailableRow(E,GetNextDiv(C[F]),D)}}E=0;A=0}}}this.UpdateTableRows()};ServicePanel.prototype.RemoveAllDisabledServiceGroupRows=function(){var A=this.GetTableRows();for(var B=this.numberOfTemplates;B<A.length;B++){if(A[B].rowType==this.disabledServiceGroup){this.RemoveDisabledServiceGroupRow(A[B])}}this.UpdateTableRows()};ServicePanel.prototype.RemoveDisabledServiceGroupRow=function(A){if(A.rowType==this.disabledServiceGroup){YAHOO.util.Event.removeListener(A,"mouseover",this.MouseOver);YAHOO.util.Event.removeListener(A,"mouseout",this.MouseOut);this.tableContents.removeChild(A);this.UpdateTableRows()}};ServicePanel.prototype.EnableAllRows=function(){var A=this.GetTableRows();for(var B=this.numberOfTemplates;B<A.length;B++){ShowElement(A[B],true)}};ServicePanel.prototype.AddServiceUnavailableRow=function(F,C,H){var A=this.GetTableRows()[this.unavailableRowTemplate];var E=A.cloneNode(true);this.tableContents.insertBefore(E,C);E.rowType=this.disabledServiceGroup;E.serviceCount=F;E.isClosed=H;if(!H){var D=YAHOO.util.Dom.getElementsByClassName("nisservices","A",E)[0];SetWTButtonText(D,mixingDeck.resourceStrings.hide)}var G=GetFirstDiv(GetFirstDiv(E));G.innerHTML=F+" "+G.innerHTML;ShowElement(E,true);var B=new Object();B.servicePanel=this;B.tableRow=E;YAHOO.util.Event.addListener(E,"mouseover",this.MouseOver,B);YAHOO.util.Event.addListener(E,"mouseout",this.MouseOut,B)};ServicePanel.prototype.OnShowServiceClick=function(C){var A=GetParentWithStyle(C,"TableRow");var B=GetParentWithStyle(C,"TableContents").servicePanel;B.RemoveSpacingDiv();if(A.isClosed){A.isClosed=false;A=GetNextDiv(A);while(A!=undefined&&A.style.display=="none"){A.style.display="block";A=GetNextDiv(A)}SetWTButtonText(C,mixingDeck.resourceStrings.hide)}else{A.isClosed=true;A=GetNextDiv(A);while(A!=undefined&&!this.IsAvailable(A)){A.style.display="none";A=GetNextDiv(A)}SetWTButtonText(C,mixingDeck.resourceStrings.show)}B.CreateSpacingDiv();B.SetScrollPosition()};ServicePanel.prototype.RemoveSpacingDiv=function(){if(this.spacingDivHeight>0){this.spacingDivHeight=0;var A=this.GetTableRows();for(var B=this.numberOfTemplates;B<A.length;B++){if(A[B].rowType==this.spacingDiv){this.tableContents.removeChild(A[B]);this.GetTableRows(true);break}}}};ServicePanel.prototype.CreateSpacingDiv=function(){if(this.bAllServicesReceived){return }var A=YAHOO.util.Dom.getRegion(this.tableContents);var D=this.GetTableRows();for(var E=D.length-1;E>=0;E--){if(D[E].style.display!="none"){break}}var B=YAHOO.util.Dom.getRegion(D[E]);this.spacingDivHeight=A.bottom+2-B.bottom-this.tableContents.scrollTop;if(this.spacingDivHeight>0){var C=document.createElement("div");C.rowType=this.spacingDiv;C.style.height=(this.spacingDivHeight)+"px";this.tableContents.appendChild(C);this.tableRows[this.tableRows.length]=C}else{this.spacingDivHeight=0}};ServicePanel.prototype.OnInformationClick=function(E,C){var A=GetParentWithStyle(C,"TableRow");var B=GetParentWithStyle(C,"TableContents").servicePanel;var D=YAHOO.util.Dom.getRegion(C);if(B.showingTimetables){mixingDeck.ShowServiceInformation(A.service,D.right+380,(D.top+D.bottom)/2+205)}else{mixingDeck.ShowServiceInformation(A.service,(D.left+D.right)/2+58,D.top-12)}E.cancelBubble=true};ServicePanel.prototype.SetHeaderToSortable=function(){};ServicePanel.prototype.SortByDeparture=function(){this.SetSortColumn(0);this.SortByColumn(0)};ServicePanel.prototype.SortByArrive=function(){this.SetSortColumn(1);this.SortByColumn(1)};ServicePanel.prototype.SortByChanges=function(){this.SetSortColumn(2);this.SortByColumn(2)};ServicePanel.prototype.SortByDuration=function(){this.SetSortColumn(3);this.SortByColumn(3)};ServicePanel.prototype.SortByPrice=function(){this.SetSortColumn(4);this.SortByColumn(4)};ServicePanel.prototype.SortByColumn=function(A){switch(A){case 0:this.Sort(this.CompareByDepartureTime);break;case 1:this.Sort(this.CompareByArrivalTime);break;case 2:this.Sort(this.CompareByChanges);break;case 3:this.Sort(this.CompareByDuration);break;case 4:this.Sort(this.CompareByPrice);break}};ServicePanel.prototype.SetSortColumn=function(B){var A;if(this.sortColumn!=undefined){var C=GetFirstDiv(this.tableHeader);for(A=0;A<this.sortColumn;A++){C=GetNextDiv(C)}YAHOO.util.Dom.removeClass(C,"Sorted");YAHOO.util.Dom.removeClass(GetNextDiv(C),"SortedBorder")}this.sortColumn=B;C=GetFirstDiv(this.tableHeader);for(A=0;A<this.sortColumn;A++){C=GetNextDiv(C)}YAHOO.util.Dom.addClass(C,"Sorted");YAHOO.util.Dom.addClass(GetNextDiv(C),"SortedBorder")};ServicePanel.prototype.Sort=function(E){var B=this.GetTableRows();var C=B[this.numberOfTemplates];for(var D=B.length-1;D>=0;D--){if(B[D].rowType!=this.serviceRow){B.splice(D,1)}}B.sort(E);while(C!=undefined){var A=C.nextSibling;this.tableContents.removeChild(C);C=A}for(D=0;D<B.length;D++){this.tableContents.appendChild(B[D])}this.GetTableRows(true);this.HideUnavailableServices()};ServicePanel.prototype.CompareByArrivalTime=function(B,A){if(B.service.aTime>A.service.aTime){return 1}else{if(B.service.aTime<A.service.aTime){return -1}else{if(B.service.dTime>A.service.dTime){return 1}else{if(B.service.dTime<A.service.dTime){return -1}else{return 0}}}}};ServicePanel.prototype.CompareByDepartureTime=function(B,A){if(B.service.dTime>A.service.dTime){return 1}else{if(B.service.dTime<A.service.dTime){return -1}else{if(B.service.aTime>A.service.aTime){return 1}else{if(B.service.aTime<A.service.aTime){return -1}else{return 0}}}}};ServicePanel.prototype.CompareByChanges=function(B,A){if(B.service.nChgs>A.service.nChgs){return 1}else{if(B.service.nChgs<A.service.nChgs){return -1}else{return 0}}};ServicePanel.prototype.CompareByDuration=function(B,A){var D=B.service.aTime-B.service.dTime;var C=A.service.aTime-A.service.dTime;if(D>C){return 1}else{if(D<C){return -1}else{return 0}}};ServicePanel.prototype.CompareByPrice=function(B,A){if(B.price>A.price){return 1}else{if(B.price<A.price){return -1}else{return 0}}};ServicePanel.prototype.SetAvailableTrainsCount=function(){if(this.originalTrainCountText==undefined){this.originalTrainCountText=this.availableTrainsCount.innerHTML}var A=this.originalTrainCountText;A=A.replace("[showing]",Math.min(this.rowsVisible,this.numberOfServices));A=A.replace("[total]",this.numberOfServices);this.availableTrainsCount.innerHTML=A;SetVisibility(this.availableTrainsCount,true)};var useNewService=true;ServicePanel.prototype.IsAvailable=function(A){if(useNewService){return A.service._available}else{return A.available}};ServicePanel.prototype.IsSleeperService=function(A){if(A.service!=undefined){if(A.service.serviceLegs!=undefined){for(var B in A.service.serviceLegs){switch(A.service.serviceLegs[B].bClass){case"S":case"B":case"F":return true;break;default:return false}}}else{return false}}else{return false}}