function SeasonFilterPanel(A,B){this.filterPanelId=A;this.timetablesOnly=B}SeasonFilterPanel.prototype.Initialise=function(){if(this.filterPanel==undefined){this.filterPanel=document.getElementById(this.filterPanelId);this.chkShowStandard=document.getElementById(mixingDeck.chkShowStandardId);this.chkShowFirstClass=document.getElementById(mixingDeck.chkShowFirstClassId);this.chkShowWeeklySeason=document.getElementById(mixingDeck.chkShowWeeklySeasonId);this.chkShowMonthlySeason=document.getElementById(mixingDeck.chkShowMonthlySeasonId);this.chkShowAnnualSeason=document.getElementById(mixingDeck.chkShowAnnualSeasonId);this.chkShowCustomSeason=document.getElementById(mixingDeck.chkShowCustomSeasonId);this.rdoPromotionalFaresOnly=document.getElementById(mixingDeck.rdoPromotionalFaresOnly);this.rdoNoFlexibility=document.getElementById(mixingDeck.rdoNoFlexibility);this.rdoMoreFlexibility=document.getElementById(mixingDeck.rdoMoreFlexibility);this.rdoShowAllFares=document.getElementById(mixingDeck.rdoShowAllFares);this.chkShowItsoSmartCard=document.getElementById(mixingDeck.chkShowItsoSmartCardId)}};SeasonFilterPanel.prototype.SetClassAndFlexibility=function(C,B){this.Initialise();if(C=="S"){if(this.chkShowStandard!=null){this.chkShowStandard.checked=true}}else{if(C=="1"){if(this.chkShowFirstClass!=null){this.chkShowFirstClass.checked=true}}else{if(this.chkShowStandard!=null){this.chkShowStandard.checked=true}if(this.chkShowFirstClass!=null){this.chkShowFirstClass.checked=true}}}var A;if(this.rdoNoFlexibility.checked){A=1}else{if(this.rdoMoreFlexibility.checked){A=2}else{A=3}}if(B=="N"){A=Math.max(A,1)}else{if(B=="P"){A=Math.max(A,2)}else{A=Math.max(A,3)}}if(this.rdoPromotionalFaresOnly){this.rdoPromotionalFaresOnly.checked=false}this.rdoNoFlexibility.checked=(A==1);this.rdoMoreFlexibility.checked=(A==2);this.rdoShowAllFares.checked=(A==3);mixingDeck.SetFlexibility(A);if(this.chkShowFirstClass!=null){mixingDeck.ShowFirst(this.chkShowFirstClass.checked)}if(this.chkShowStandard!=null){mixingDeck.ShowStandard(this.chkShowStandard.checked)}if(this.chkShowWeeklySeason!=null){mixingDeck.ShowWeekly(this.chkShowWeeklySeason.checked)}if(this.chkShowMonthlySeason!=null){mixingDeck.ShowMonthly(this.chkShowMonthlySeason.checked)}if(this.chkShowAnnualSeason!=null){mixingDeck.ShowAnnual(this.chkShowAnnualSeason.checked)}if(this.chkShowCustomSeason!=null){mixingDeck.ShowCustom(this.chkShowCustomSeason.checked)}if(this.chkShowItsoSmartCard!=null){mixingDeck.ShowOnlySmartCardFares(this.chkShowItsoSmartCard.checked)}mixingDeck.UpdateFilter()};SeasonFilterPanel.prototype.SetVisibilityOfFlexibilityButtons=function(A,B){var C=false;var E=false;if(A){for(var F in A){C=C||(A[F].flex=="N");E=E||(A[F].flex=="P")}}if(B){for(var D in B){C=C||(B[D].flex=="N");E=E||(B[D].flex=="P")}}};SeasonFilterPanel.prototype.Show=function(A,B){this.Initialise();ShowElement(this.filterPanel,A);if(A){if(B){YAHOO.util.Dom.setY(this.filterPanel,B)}this.EnsureDocumentIsLargeEnough()}};SeasonFilterPanel.prototype.EnsureDocumentIsLargeEnough=function(){if(mixingDeck.journeyPlanningData==undefined||!mixingDeck.journeyPlanningData.data.isReturn){var A=YAHOO.util.Dom.getRegion(this.filterPanel);document.body.style.height="";document.body.style.height=Math.max(document.body.clientHeight,A.bottom+100)+"px"}};SeasonFilterPanel.prototype.SetIsPromotion=function(A){ShowElement(document.getElementById("promotionFilter"),(A==true))};SeasonFilterPanel.prototype.SetRoutes=function(B){if(B!=undefined){this.routes=B}this.ClearRoutes();var A=false;var D=0;for(var C in this.routes){D++;this.AddRoute(C,this.routes[C]);A=A||this.routes[C].isQueried}};SeasonFilterPanel.prototype.ClearRoutes=function(){var A=document.getElementById("serviceRoutes");var B=GetFirstDiv(A);while(B.nextSibling!=undefined){A.removeChild(B.nextSibling)}};SeasonFilterPanel.prototype.AddRoute=function(D,B){var H=document.getElementById("showFastest");var C=H.cloneNode(true);C.id="";var A=document.getElementById("serviceRoutes");A.appendChild(C);var E=GetFirstElement(C,"SPAN");var F=GetFirstElement(E,"INPUT");var G=GetFirstElement(E,"LABEL");F.id="Route"+D;F.name=F.id;F.checked=B.isQueried;G.htmlFor=F.id;G.innerHTML=B.routeDesc;F.route=D};SeasonFilterPanel.prototype.OnRouteClicked=function(B){if(mixingDeck.forceSlowerRoutePlan==1){return }if(!B.checked){return }var D=document.getElementById("showFastest");var E=this.GetRouteCheckbox(D);if(E!=B){E.checked=false}else{var A=document.getElementById("serviceRoutes");A=GetFirstDiv(A);for(var C=GetNextDiv(A);C!=undefined;C=GetNextDiv(C)){E=this.GetRouteCheckbox(C);if(E!=B){E.checked=false}}}};SeasonFilterPanel.prototype.GetRouteCheckbox=function(B){var A=GetFirstElement(B,"SPAN");return GetFirstElement(A,"INPUT")};SeasonFilterPanel.prototype.OnUpdate=function(){var B=document.getElementById(mixingDeck.hdnRouteCodes);B.value="";var D=document.getElementById("showFastest");var E=this.GetRouteCheckbox(D);if(mixingDeck.forceSlowerRoutePlan==1&&E.checked){B.value=" ,"}var A=document.getElementById("serviceRoutes");A=GetFirstDiv(A);for(var C=GetNextDiv(A);C!=undefined;C=GetNextDiv(C)){E=this.GetRouteCheckbox(C);if(E.checked){B.value+=E.route+","}}};SeasonFilterPanel.prototype.UpdateTicketClass=function(A){if(this.chkShowStandard!=null&&this.chkShowStandard==A){mixingDeck.ShowStandard(this.chkShowStandard.checked);if(this.chkShowFirstClass!=null&&!this.chkShowStandard.checked&&!this.chkShowFirstClass.checked){this.chkShowFirstClass.checked=true;mixingDeck.ShowFirst(this.chkShowFirstClass.checked)}}else{if(this.chkShowFirstClass!=null){mixingDeck.ShowFirst(this.chkShowFirstClass.checked);if(this.chkShowStandard!=null&&!this.chkShowStandard.checked&&!this.chkShowFirstClass.checked){this.chkShowStandard.checked=true;mixingDeck.ShowStandard(this.chkShowStandard.checked)}}}mixingDeck.UpdateFilter()};SeasonFilterPanel.prototype.UpdateSeasonType=function(A){if(this.chkShowWeeklySeason!=null&&this.chkShowWeeklySeason==A){mixingDeck.ShowWeekly(this.chkShowWeeklySeason.checked);if(this.chkShowWeeklySeason!=null&&this.chkShowMonthlySeason!=null&&this.chkShowAnnualSeason!=null&&this.chkShowCustomSeason!=null&&!this.chkShowWeeklySeason.checked&&!this.chkShowMonthlySeason.checked&&!this.chkShowAnnualSeason.checked&&!this.chkShowCustomSeason.checked){this.chkShowMonthlySeason.checked=true;mixingDeck.ShowMonthly(this.chkShowMonthlySeason.checked)}}else{if(this.chkShowMonthlySeason!=null&&this.chkShowMonthlySeason==A){mixingDeck.ShowMonthly(this.chkShowMonthlySeason.checked);if(this.chkShowWeeklySeason!=null&&this.chkShowMonthlySeason!=null&&this.chkShowAnnualSeason!=null&&this.chkShowCustomSeason!=null&&!this.chkShowWeeklySeason.checked&&!this.chkShowMonthlySeason.checked&&!this.chkShowAnnualSeason.checked&&!this.chkShowCustomSeason.checked){this.chkShowAnnualSeason.checked=true;mixingDeck.ShowAnnual(this.chkShowAnnualSeason.checked)}}else{if(this.chkShowAnnualSeason!=null&&this.chkShowAnnualSeason==A){mixingDeck.ShowAnnual(this.chkShowAnnualSeason.checked);if(this.chkShowWeeklySeason!=null&&this.chkShowMonthlySeason!=null&&this.chkShowAnnualSeason!=null&&this.chkShowCustomSeason!=null&&!this.chkShowWeeklySeason.checked&&!this.chkShowMonthlySeason.checked&&!this.chkShowAnnualSeason.checked&&!this.chkShowCustomSeason.checked&&!this.chkShowCustomSeason.disabled){this.chkShowCustomSeason.checked=true;mixingDeck.ShowCustom(this.chkShowCustomSeason.checked)}else{if(this.chkShowWeeklySeason!=null){mixingDeck.ShowWeekly(this.chkShowWeeklySeason.checked);if(this.chkShowWeeklySeason!=null&&this.chkShowMonthlySeason!=null&&this.chkShowAnnualSeason!=null&&this.chkShowCustomSeason!=null&&!this.chkShowWeeklySeason.checked&&!this.chkShowMonthlySeason.checked&&!this.chkShowAnnualSeason.checked&&!this.chkShowCustomSeason.checked){this.chkShowWeeklySeason.checked=true;mixingDeck.ShowWeekly(this.chkShowWeeklySeason.checked)}}}}else{if(this.chkShowCustomSeason!=null){mixingDeck.ShowCustom(this.chkShowCustomSeason.checked);if(this.chkShowWeeklySeason!=null&&this.chkShowMonthlySeason!=null&&this.chkShowAnnualSeason!=null&&this.chkShowCustomSeason!=null&&!this.chkShowWeeklySeason.checked&&!this.chkShowMonthlySeason.checked&&!this.chkShowAnnualSeason.checked&&!this.chkShowCustomSeason.checked){this.chkShowWeeklySeason.checked=true;mixingDeck.ShowWeekly(this.chkShowWeeklySeason.checked)}}}}}mixingDeck.UpdateFilter()};SeasonFilterPanel.prototype.UpdateOnlySmartcardFares=function(A){if(this.chkShowItsoSmartCard==A){mixingDeck.ShowOnlySmartCardFares(this.chkShowItsoSmartCard.checked)}mixingDeck.UpdateFilter()}