function ADVS(){
 this.num_field=null;
 this.totalNumOfType=0;
 this.totalNumOfPax=0;
 this.totalNumOfInf=0;
 this.totalNumOfChd=0;
 this.timeListArray=0;
 this.timeListArrayText=0;
 this.timeListArrayMP=0;
 this.timeListArrayTextMP=0;
 this.fareTypeListArray=0;
 this.fareTypeListArrayText=0;
 this.fareTypeListArrayMP=0;
 this.fareTypeListArrayTextMP=0;
 this.tripType="R";
 this.searchFlow="SD";
 this.previousSearchFlow="";
 this.OneWayDateListNotInitialized=true;
 this.RoundTripDateListNotInitialized=true;
 this.ComplexDateListNotInitialized=true;
 this.LocationORNotInitialized=true;
 this.LocationMNotInitialized=true;
 this.FlexibleByONotInitialized=true;
 this.FlexibleByRNotInitialized=true;
 this.CommercialFFRNotInitialized=true;
 this.check=ADVS_check;
 this.preCheck=ADVS_preCheck;
 this.showTripTypeForm=ADVS_showTripTypeForm;
 this.showOneWayTripForm=ADVS_showOneWayTripForm;
 this.showRoundTripForm=ADVS_showRoundTripForm;
 this.showComplexTripForm=ADVS_showComplexTripForm;
 this.showTimeSelection=ADVS_showTimeSelection;
 this.applyTimeListChange=ADVS_applyTimeListChange;
 this.applyFareTypeListChange=ADVS_applyFareTypeListChange;
 this.checkPax=ADVS_checkPax;
 this.GetNumOfPaxType=ADVS_GetNumOfPaxType;
 this.GiveNumOfPaxType=ADVS_GiveNumOfPaxType;
 this.GivePrimaryPaxType=ADVS_GivePrimaryPaxType;
 this.replaceStarBy=ADVS_replaceStarBy;
 this.callCityLookupPopup=ADVS_callCityLookupPopup;
 this.setSearchFlow=ADVS_setSearchFlow;
 this.getSearchFlow=ADVS_getSearchFlow;
 this.pageOnLoad=ADVS_pageOnLoad;
 this.SAVDatesCities=ADVS_SAVDatesCities;
 this.alreadySubmited=false;
 this.isMasterPricerSearch=false;
 this.isWebfaresSearch=false;
 this.isWebSearchButton=false;
}
 var ADVS=new ADVS();
 function ADVS_check(){
 if(ADVS.alreadySubmited){
}else{
 ADVS.alreadySubmited=true;
 WDSError.init();
 this.preCheck();
 if(WDSError.hasError()){
 WDSError.show();
 ADVS.alreadySubmited=false;
}else{
 this.SAVDatesCities();
 if(document.getElementById("PRODUCT_TYPE_1")){
 if(ADVS.searchFlow=="SD"){
 document.getElementById("PRODUCT_TYPE_1").value="STANDARD_AIR";
 document.getElementById("PRODUCT_TYPE_2").value="";
}else{
 if(ADVS.isMasterPricerSearch&&(ADVS.isWebfaresSearch||ADVS.isWebSearchButton)
&&ADVS.tripType!="M"){
 document.getElementById("PRODUCT_TYPE_1").value="STANDARD_AIR";
 document.getElementById("PRODUCT_TYPE_2").value="WEBFARES";
}else{
 if(ADVS.isMasterPricerSearch){
 document.getElementById("PRODUCT_TYPE_1").value="STANDARD_AIR";
 document.getElementById("PRODUCT_TYPE_2").value="";
}else{
 document.getElementById("PRODUCT_TYPE_1").value="WEBFARES";
 document.getElementById("PRODUCT_TYPE_2").value="";
}
}
}
}
 document.ADVSForm.submit();
 WDSWaitingImage.pleaseWait("wait");
}
}
}
 function ADVS_preCheck(){
 initializeHiddenField("divYouthPaxListLBL","FIELD_YTH_NUMBER");
 initializeHiddenField("divSeniorPaxList","FIELD_YCD_NUMBER");
 initializeHiddenField("divStudentPaxList","FIELD_STU_NUMBER");
 initializeHiddenField("divMilitaryPaxList","FIELD_MIL_NUMBER");
 initializeHiddenField("divGovernmentPaxList","FIELD_GVT_NUMBER");
 initializeHiddenField("divSpousePaxList","FIELD_SPS_NUMBER"); if(this.tripType!='M'){
 checkNoComplexLocationDate();
}else{
 checkComplexLocationDate();
}
 this.checkPax();
 checkPreferredAirlines();
 var directNonStopChkCmp=document.getElementById("DIRECT_NON_STOPChk");
 if(directNonStopChkCmp)
 document.getElementById("DIRECT_NON_STOP").value=directNonStopChkCmp.checked;
 var numOfStop=document.getElementById("divMaxNumberOfStop");
 if(numOfStop){
 if(numOfStop.style.visibility=="hidden"){
 document.getElementById("AIR_MAX_CONNECTIONS").value=2;
}
}
 var o=document.ADVSForm.FLEXIBLE_CHK_1;
 if(o){
 document.ADVSForm.FLEXIBLE_TEXT_1.value=o.checked;
 if(!o.checked)
 document.ADVSForm.DATE_RANGE_VALUE_1.value="0";
 else
 document.ADVSForm.DATE_RANGE_VALUE_1.value=document.ADVSForm.DFLT_DATE_RANGE_INIT_VALUE.value;
}
 o=document.ADVSForm.FLEXIBLE_CHK_2;
 if(o){
 document.ADVSForm.FLEXIBLE_TEXT_2.value=o.checked;
 if(!o.checked)
 document.ADVSForm.DATE_RANGE_VALUE_2.value="0";
 else
 document.ADVSForm.DATE_RANGE_VALUE_2.value=document.ADVSForm.DFLT_DATE_RANGE_INIT_VALUE.value;
}
}
 function initializeHiddenField(divId,fieldName){
 var cmp=document.getElementById(divId);
 if(cmp&&cmp.style.visibility=="hidden"){
 document.getElementById(fieldName).value="0";
}
}
 function checkNoComplexLocationDate(){
 var b_obj=WDSCommon.getTagValue(document.ADVSForm.B_LOCATION_1);
 var e_obj=WDSCommon.getTagValue(document.ADVSForm.E_LOCATION_1);
 if(b_obj=="")
 WDSError.add(WDSMessage.getMessage(10004),document.ADVSForm.B_LOCATION_1);
 if(e_obj=="")
 WDSError.add(WDSMessage.getMessage(10005),document.ADVSForm.E_LOCATION_1);
 else if(b_obj==e_obj){
 WDSError.add(WDSMessage.getMessage(10001),document.ADVSForm.B_LOCATION_1);
 WDSError.add(" ",document.ADVSForm.E_LOCATION_1,"E",false);
}
 if(ADVS.tripType=='R'){
 var beginDate=DateList1.getDateTimeComposed(DateList1.grpStart);
 var endDate=DateList1.getDateTimeComposed(DateList1.grpEnd);
 if(beginDate.getTime()>endDate.getTime()){
 WDSError.add(WDSMessage.getMessage(10000),document.ADVSForm.B_DATE1);
 WDSError.add(" ",document.ADVSForm.E_DATE1,"E",false);
}
}
}
 function checkComplexLocationDate(){
 var oneFilled=false;
 var testNumberOfStep=document.ADVSForm.B_LOCATION_6_Cpx;
 var numOfStep=6;
 if(testNumberOfStep){
 if(testNumberOfStep.style.visibility=="hidden"){
 numOfStep=3;
}
}
 for(var i=1;i<numOfStep+1;i++){
 var obj=eval("document.ADVSForm.B_LOCATION_"+i+"_Cpx");
 var e_obj=eval("document.ADVSForm.E_LOCATION_"+i+"_Cpx");
 var bLoc=WDSCommon.getTagValue(obj);
 var eLoc=WDSCommon.getTagValue(e_obj);
 if(bLoc!=""&&eLoc=="")
 WDSError.add(WDSMessage.getMessage(10005),e_obj);
 if(eLoc!=""&&bLoc=="")
 WDSError.add(WDSMessage.getMessage(10004),obj);
 if(eLoc!=""&&bLoc==eLoc){
 WDSError.add(WDSMessage.getMessage(10000),obj);
 WDSError.add(" ",e_obj,"E",false);
}
 if(eLoc!=""||bLoc!="")
 oneFilled=true;
}
 if(!oneFilled){
 WDSError.add(WDSMessage.getMessage(10005),document.ADVSForm.E_LOCATION_1_Cpx);
 WDSError.add(WDSMessage.getMessage(10004),document.ADVSForm.B_LOCATION_1_Cpx);
}
 var posSegment=0;
 do{
 posSegment++;
 var obj=eval("document.ADVSForm.B_LOCATION_"+posSegment+"_Cpx");
 var e_obj=eval("document.ADVSForm.E_LOCATION_"+posSegment+"_Cpx");
 bLoc=WDSCommon.getTagValue(obj);
 eLoc=WDSCommon.getTagValue(e_obj);
}while(eLoc==""&&bLoc==""&&posSegment<6);
 if(posSegment!=numOfStep){
 eval("var tmpDateList=DateList"+posSegment+"Cpx;");
 var currentTime=tmpDateList.getDateTimeComposed(tmpDateList.grpStart).getTime();
 var prevDatePos=posSegment;
 for(var i=posSegment+1;i<numOfStep+1;i++){
 var obj=eval("document.ADVSForm.B_LOCATION_"+i+"_Cpx");
 var e_obj=eval("document.ADVSForm.E_LOCATION_"+i+"_Cpx");
 bLoc=WDSCommon.getTagValue(obj);
 eLoc=WDSCommon.getTagValue(e_obj);
 if(eLoc!=""||bLoc!=""){
 eval("var tmpDateList=DateList"+i+"Cpx;");
 var nextTime=tmpDateList.getDateTimeComposed(tmpDateList.grpStart).getTime();
 if(nextTime<currentTime){
 eval("WDSError.add(WDSMessage.getMessage(10000),document.ADVSForm.B_DATE"+i+"Cpx);");
 eval("WDSError.add(' ',document.ADVSForm.B_DATE"+prevDatePos+"Cpx,'E',false);");
}
 prevDatePos=i;
 currentTime=nextTime;
}
}
}
}
 function ADVS_checkPax(){
 this.totalNumOfType=0;
 this.totalNumOfPax=0;
 this.GetNumOfPaxType(document.ADVSForm.FIELD_ADT_NUMBER);
 this.GetNumOfPaxType(document.ADVSForm.FIELD_CHD_NUMBER);
 this.GetNumOfPaxType(document.ADVSForm.FIELD_CMP_NUMBER);
 this.GetNumOfPaxType(document.ADVSForm.FIELD_YTH_NUMBER);
 this.GetNumOfPaxType(document.ADVSForm.FIELD_YCD_NUMBER);
 this.GetNumOfPaxType(document.ADVSForm.FIELD_STU_NUMBER);
 this.GetNumOfPaxType(document.ADVSForm.FIELD_GVT_NUMBER);
 this.GetNumOfPaxType(document.ADVSForm.FIELD_MIL_NUMBER);
 this.GetNumOfPaxType(document.ADVSForm.FIELD_SPS_NUMBER);
 this.GetNumOfPaxType(document.ADVSForm.FIELD_QHH_NUMBER);
 this.GetNumOfPaxType(document.ADVSForm.FIELD_INFANTS_NUMBER);
 this.GetNumOfPaxType(document.ADVSForm.FIELD_NO_PAX_LABEL_NUMBER);
 var maxPax=WDSCommon.getTagValue(document.ADVSForm,"MAX_PAX_VALUE");
 var obj=document.ADVSForm.FIELD_ADT_NUMBER;
 if(!obj){
 obj=document.ADVSForm.FIELD_NO_PAX_LABEL_NUMBER;
}
 if(this.totalNumOfType>6){
 WDSError.add(WDSMessage.getMessage(5125),obj);
}
 if(this.totalNumOfPax>maxPax){
 WDSError.add(this.replaceStarBy(WDSMessage.getMessage(5118),maxPax),obj);
}
 var adtNum=eval(this.totalNumOfPax-this.totalNumOfChd);
 if(this.totalNumOfChd>0&&adtNum==0){
 obj=eval(document.ADVSForm.FIELD_CHD_NUMBER);
 WDSError.add(WDSMessage.getMessage(5122),obj);
}
 if(this.totalNumOfInf>0&&(adtNum<=0)){
 obj=eval(document.ADVSForm.FIELD_INFANTS_NUMBER);
 WDSError.add(WDSMessage.getMessage(5124),obj);
}
 if((adtNum>0)&&(adtNum<this.totalNumOfInf)){
 WDSError.add(WDSMessage.getMessage(5121),obj);
}
 if(this.totalNumOfPax+this.totalNumOfInf==0){
 WDSError.add(WDSMessage.getMessage(5123),obj);
}
 if(this.totalNumOfPax>0&&document.ADVSForm.FIELD_ADT_NUMBER){
 var nbADT=this.GiveNumOfPaxType(document.ADVSForm.FIELD_ADT_NUMBER);
 var svgNbADT=nbADT;
 var allowPrimADT=this.GivePrimaryPaxType(document.ADVSForm.ALLOW_PRIMARY_ADT);
 if(!allowPrimADT)nbADT=0;
 var nbCHD=this.GiveNumOfPaxType(document.ADVSForm.FIELD_CHD_NUMBER);
 var svgNbCHD=nbCHD;
 var allowPrimCHD=this.GivePrimaryPaxType(document.ADVSForm.ALLOW_PRIMARY_CHD);
 if(!allowPrimCHD)nbCHD=0;
 var nbCMP=this.GiveNumOfPaxType(document.ADVSForm.FIELD_CMP_NUMBER);
 var svgNbCMP=nbCMP;
 var allowPrimCMP=this.GivePrimaryPaxType(document.ADVSForm.ALLOW_PRIMARY_CMP);
 if(!allowPrimCMP)nbCMP=0;
 var nbYTH=this.GiveNumOfPaxType(document.ADVSForm.FIELD_YTH_NUMBER);
 var svgNbYTH=nbYTH;
 var allowPrimYTH=this.GivePrimaryPaxType(document.ADVSForm.ALLOW_PRIMARY_YTH);
 if(!allowPrimYTH)nbYTH=0;
 var nbYCD=this.GiveNumOfPaxType(document.ADVSForm.FIELD_YCD_NUMBER);
 var svgNbYCD=nbYCD;
 var allowPrimYCD=this.GivePrimaryPaxType(document.ADVSForm.ALLOW_PRIMARY_YCD);
 if(!allowPrimYCD)nbYCD=0;
 var nbSTU=this.GiveNumOfPaxType(document.ADVSForm.FIELD_STU_NUMBER);
 var svgNbSTU=nbSTU;
 var allowPrimSTU=this.GivePrimaryPaxType(document.ADVSForm.ALLOW_PRIMARY_STU);
 if(!allowPrimSTU)nbSTU=0;
 var nbGVT=this.GiveNumOfPaxType(document.ADVSForm.FIELD_GVT_NUMBER);
 var svgNbGVT=nbGVT;
 var allowPrimGVT=this.GivePrimaryPaxType(document.ADVSForm.ALLOW_PRIMARY_GVT);
 if(!allowPrimGVT)nbGVT=0;
 var nbMIL=this.GiveNumOfPaxType(document.ADVSForm.FIELD_MIL_NUMBER);
 var svgNbMIL=nbMIL;
 var allowPrimMIL=this.GivePrimaryPaxType(document.ADVSForm.ALLOW_PRIMARY_MIL);
 if(!allowPrimMIL)nbMIL=0;
 var nbSPS=this.GiveNumOfPaxType(document.ADVSForm.FIELD_SPS_NUMBER);
 var svgNbSPS=nbSPS;
 var allowPrimSPS=this.GivePrimaryPaxType(document.ADVSForm.ALLOW_PRIMARY_SPS);
 if(!allowPrimSPS)nbSPS=0;
 var nbQHH=this.GiveNumOfPaxType(document.ADVSForm.FIELD_QHH_NUMBER);
 var svgNbQHH=nbQHH;
 var allowPrimQHH=this.GivePrimaryPaxType(document.ADVSForm.ALLOW_PRIMARY_QHH);
 if(!allowPrimQHH)nbQHH=0;
 if(nbADT+nbCHD+nbCMP+nbYTH+nbYCD+nbSTU+nbGVT+nbMIL+nbSPS+nbQHH==0){
 WDSError.add(WDSMessage.getMessage(5126));
 if(svgNbADT>0)WDSError.add(' ',document.ADVSForm.FIELD_ADT_NUMBER,'E',false);
 if(svgNbCHD>0)WDSError.add(' ',document.ADVSForm.FIELD_CHD_NUMBER,'E',false);
 if(svgNbCMP>0)WDSError.add(' ',document.ADVSForm.FIELD_CMP_NUMBER,'E',false);
 if(svgNbYTH>0)WDSError.add(' ',document.ADVSForm.FIELD_YTH_NUMBER,'E',false);
 if(svgNbYCD>0)WDSError.add(' ',document.ADVSForm.FIELD_YCD_NUMBER,'E',false);
 if(svgNbSTU>0)WDSError.add(' ',document.ADVSForm.FIELD_STU_NUMBER,'E',false);
 if(svgNbGVT>0)WDSError.add(' ',document.ADVSForm.FIELD_GVT_NUMBER,'E',false);
 if(svgNbMIL>0)WDSError.add(' ',document.ADVSForm.FIELD_MIL_NUMBER,'E',false);
 if(svgNbSPS>0)WDSError.add(' ',document.ADVSForm.FIELD_SPS_NUMBER,'E',false);
 if(svgNbQHH>0)WDSError.add(' ',document.ADVSForm.FIELD_QHH_NUMBER,'E',false);
}
}
}
 function ADVS_GivePrimaryPaxType(type){
 var obj=eval(type);
 var val='N';
 if(obj){
 val=WDSCommon.getTagValue(obj);
}
 return(val=='Y');
}
 function ADVS_GiveNumOfPaxType(type){
 var obj=eval(type);
 if(obj){
 return eval(WDSCommon.getTagValue(obj));
}else{
 return 0;
}
}
 function ADVS_GetNumOfPaxType(type){
 var num=0;
 var obj=eval(type);
 if(obj){
 num=eval(WDSCommon.getTagValue(obj));
 if(num>0){
 this.totalNumOfType+=1;
}
 if(obj.id!="FIELD_INFANTS_NUMBER"){
 this.totalNumOfPax+=num;
}
 if(obj.id=="FIELD_INFANTS_NUMBER"){
 this.totalNumOfInf=num;
}
 if(obj.id=="FIELD_CHD_NUMBER"){
 this.totalNumOfChd=num;
}
}
}
 function ADVS_replaceStarBy(strIn,starContent){
 var strOut="";
 for(var i=0;i<strIn.length;i++){
 if(i<strIn.length-2&&strIn.substr(i,3)=="{0}"){
 strOut=strOut+starContent;
 i+=2;
}else{
 strOut=strOut+strIn.substr(i,1);
}
}
 return strOut;
}
 function ADVS_SAVDatesCities(){
 document.getElementById("backTRIP_TYPE").value=document.ADVSForm.TRIP_TYPE.value;
 if(this.tripType!='M'){
 document.getElementById("backB_LOCATION_1").value=document.getElementById("B_LOCATION_1").value;
 document.getElementById("backE_LOCATION_1").value=document.getElementById("E_LOCATION_1").value;
 var beginDate=DateList1.getDateTimeComposedString(DateList1.grpStart);
 document.getElementById("backB1Date").value=beginDate;
 if(!this.RoundTripDateListNotInitialized){
 var endDate=DateList1.getDateTimeComposedString(DateList1.grpEnd);
 document.getElementById("backE1Date").value=endDate;
}
}
 if(!this.ComplexDateListNotInitialized){
 var testNumberOfStep=document.ADVSForm.B_LOCATION_6_Cpx;
 var numOfStep=7;
 if(!testNumberOfStep){
 numOfStep=4;
}
 for(var i=1;i<numOfStep;i++){
 eval("document.getElementById('backB_LOCATION_"+i+"_Cpx').value=document.getElementById('B_LOCATION_"+i+"_Cpx').value;");
 eval("document.getElementById('backE_LOCATION_"+i+"_Cpx').value=document.getElementById('E_LOCATION_"+i+"_Cpx').value;");
 eval("var tmpDateList=DateList"+i+"Cpx;");
 var dateCpx=tmpDateList.getDateTimeComposedString(tmpDateList.grpStart);
 eval("document.getElementById('backB"+i+"CpxDate').value=dateCpx;");
}
}
}
 function checkPreferredAirlines(){
 if(document.getElementById("tableTheseAirlinesOnly")){
 for(i=1;i<4;i++){
 eval("var val=WDSCommon.getTagValue(document.ADVSForm.AIRLINE_"+i+");");
 if(val.length>0&&val.length!=2){
 eval("WDSError.add(WDSMessage.getMessage(10015),document.ADVSForm.AIRLINE_"+i+");");
}
}
}
}
 function ADVS_showTripTypeForm(type,searchFlow){
 if(this.previousSearchFlow!=""){
 searchFlow=this.previousSearchFlow;
 this.previousSearchFlow="";
}
 this.setSearchFlow(searchFlow);
 this.tripType=type;
 document.ADVSForm.TRIP_TYPE.value=type;
 
 if(document.getElementById("btnSearchADVSVP")||document.getElementById("btnSearchADVSNFS")||document.getElementById("btnSearchADVSMP")){
 if(type=="O")
 this.showOneWayTripForm(searchFlow);
 else if(type=="R")
 this.showRoundTripForm(searchFlow);
 else
 this.showComplexTripForm(searchFlow);
}
}
 function ADVS_showRoundTripForm(searchFlow){
 applyClassName("oneWayTab","t2");
 applyClassName("complexTab","t2");
 applyClassName("roundTripTab","t1");
 applyStyle("complexDataId","hidden","none");
 applyStyle("complexDataId","hidden","none");
 applyFareCabinFlexibilityAirlines(searchFlow);
 applyRangeCheckbox(searchFlow);
 this.applyTimeListChange(searchFlow);
 this.applyFareTypeListChange(searchFlow);
 applyStyle("nonComplexPanelTr","visible","block");
 applyStyle("tableReturnDateDiv","visible","block");
 applyStyle("radioFlowTypeFPVP","visible","block");
}
 function ADVS_showOneWayTripForm(searchFlow){
 applyClassName("roundTripTab","t2");
 applyClassName("complexTab","t2");
 applyClassName("oneWayTab","t1");
 applyStyle("complexDataId","hidden","none");
 applyFareCabinFlexibilityAirlines(searchFlow);
 applyRangeCheckbox(searchFlow);
 this.applyTimeListChange(searchFlow);
 this.applyFareTypeListChange(searchFlow);
 applyStyle("nonComplexPanelTr","visible","block");
 applyStyle("tableReturnDateDiv","hidden","none");
 applyStyle("radioFlowTypeFPVP","visible","block");
}
 function ADVS_showComplexTripForm(searchFlow){
 if(searchFlow=="FP"){
 this.previousSearchFlow="FP";
 this.setSearchFlow("SD");
 searchFlow="SD";
}
 applyClassName("roundTripTab","t2");
 applyClassName("oneWayTab","t2");
 applyClassName("complexTab","t1");
 applyMasterPricerNumberOfStep(searchFlow);
 cleanAndUpdateLocations();
 applyStyle("complexDataId","visible","block");
 applyFareCabinFlexibilityAirlines(searchFlow);
 applyRangeCheckbox(searchFlow);
 this.applyTimeListChange(searchFlow);
 this.applyFareTypeListChange(searchFlow);
 applyStyle("nonComplexPanelTr","hidden","none");
 applyStyle("tableReturnDateDiv","hidden","none");
 applyStyle("radioFlowTypeFPVP","hidden","none");
}
 function applyClassName(cmpName,newClassName){
 var cmp=document.getElementById(cmpName);
 if(cmp)cmp.className=newClassName;
}
 function applyStyle(cmpName,visibilityType,displayType){
 var cmp=document.getElementById(cmpName);
 if(cmp!=null){
 cmp.style.visibility=visibilityType;
 if(navigator.userAgent.toLowerCase().indexOf('opera')!=-1){
 cmp.style.display="";
 if(visibilityType=="visible")
 cmp.style.height="";
 else
 cmp.style.height="0px";
}else{
 cmp.style.height="";
 cmp.style.display=displayType;
}
}
}
 function applyFareCabinFlexibilityAirlines(searchFlow){
 if(searchFlow!="FP"){
 applyStyle("FPFareFamilyDiv","hidden","none");
 applyStyle("FPFlexibleByTitleB","hidden","none");
 applyStyle("FPFlexibleByCmpB","hidden","none");
 applyStyle("FPFlexibleByBottomB","hidden","none");
 applyStyle("FPFlexibleByTitleE","hidden","none");
 applyStyle("FPFlexibleByCmpE","hidden","none");
 applyStyle("FPFlexibleByBottomE","hidden","none");
 applyStyle("SDComplexCabinDiv","visible","block");
 applyStyle("SDComplexAirlinesDiv","visible","block");
 applyStyle("departureHourCellDiv","visible","block");
 applyStyle("departureHourCell2","hidden","none");
 applyStyle("returnHourCellDiv","visible","block");
 applyStyle("returnHourCell2","hidden","none");
}else{
 applyStyle("SDComplexCabinDiv","hidden","none");
 applyStyle("SDComplexAirlinesDiv","hidden","none");
 applyStyle("FPFareFamilyDiv","visible","block");
 applyStyle("FPFlexibleByTitleB","visible","block");
 applyStyle("FPFlexibleByCmpB","visible","block");
 applyStyle("FPFlexibleByBottomB","visible","block");
 applyStyle("FPFlexibleByTitleE","visible","block");
 applyStyle("FPFlexibleByCmpE","visible","block");
 applyStyle("FPFlexibleByBottomE","visible","block");
 ADVS.showTimeSelection(document.ADVSForm.FLEXIBLE_CHK_1,1);
 ADVS.showTimeSelection(document.ADVSForm.FLEXIBLE_CHK_2,2);
 ADVS.showTimeSelection(document.ADVSForm.DATE_RANGE_VALUE_1,1);
 ADVS.showTimeSelection(document.ADVSForm.DATE_RANGE_VALUE_2,2);
}
}
 function cleanAndUpdateLocations(){
 var loc1=WDSCommon.getTagValue(document.ADVSForm,"B_LOCATION_1");
 var loc2=WDSCommon.getTagValue(document.ADVSForm,"E_LOCATION_1");
 if(loc1!=""){
 WDSCommon.updateTag(document.ADVSForm,"B_LOCATION_1_Cpx",loc1);
 if(loc2!="")
 WDSCommon.updateTag(document.ADVSForm,"E_LOCATION_1_Cpx",loc2);
 if(WDSCommon.getTagValue(document.ADVSForm,"B_LOCATION_2_Cpx")=="")
 WDSCommon.updateTag(document.ADVSForm,"B_LOCATION_2_Cpx",loc2);
}
}
 function ADVS_showTimeSelection(o,num){
 if(!o||o.type=="hidden")return;
 if(num==1){
 if((o.tagName.toLowerCase()=="select"&&o.value!="0")||o.checked){
 applyStyle("departureHourCellDiv","hidden","none");
 applyStyle("departureHourCell2","visible","block");
}else{
 applyStyle("departureHourCellDiv","visible","block");
 applyStyle("departureHourCell2","hidden","none");
}
}else{
 if((o.tagName.toLowerCase()=="select"&&o.value!="0")||o.checked){
 applyStyle("returnHourCellDiv","hidden","none");
 applyStyle("returnHourCell2","visible","block");
}else{
 applyStyle("returnHourCellDiv","visible","block");
 applyStyle("returnHourCell2","hidden","none");
}
}
}
 function ADVS_callCityLookupPopup(location,label){
 WDSCommon.updateTag(document.ADVSCityLkpForm,"PLTG_TARGETED_OPENER_TAG",document.getElementById(location).name);
 WDSCommon.updateTag(document.ADVSCityLkpForm,"MATCH",document.getElementById(location).value);
 WDSCommon.updateTag(document.ADVSCityLkpForm,"PLTG_TARGETED_OPENER_TAG_LABEL",label);
 submitFormToNewPopUp(document.ADVSCityLkpForm,"ADVSCityLkpWindow",660,470);
}
 function ADVS_setSearchFlow(searchFlow){
 this.searchFlow=searchFlow;
 WDSCommon.updateTag(document.ADVSForm,"SEARCH_PAGE",searchFlow);
}
 function ADVS_getSearchFlow(){
 return this.searchFlow;
}