function TLIST(){this.rtType="DR";this.userLoggedIn=false;this.alreadySubmited=false;this.init=TLIST_init;this.pageOnLoad=TLIST_pageOnLoad;this.check=TLIST_check;this.checkSearch=TLIST_checkSearch;this.preCheck=TLIST_preCheck;this.prefill=TLIST_prefill;this.boolAllowRtByFf=TLIST_boolAllowRtByFf;this.boolAllowPnrServ=TLIST_boolAllowPnrServ;this.boolAllowEtktRetrieve=TLIST_boolAllowEtktRetrieve;this.boolAllowEtktCheckName=TLIST_boolAllowEtktCheckName;this.rtResShow=TLIST_rtResShow;this.rtFFShow=TLIST_rtFFShow;this.rtETShow=TLIST_rtETShow;this.rtResOptShow=TLIST_rtResOptShow;this.rtHideAll=TLIST_rtHideAll;this.rtResaCheck=TLIST_rtResaCheck;this.rtFFCheck=TLIST_rtFFCheck;this.rtETCheck=TLIST_rtETCheck;this.setAction=TLIST_setAction;this.prefillDRForm=TLIST_prefillDRForm;this.prefillFFForm=TLIST_prefillFFForm;this.prefillETForm=TLIST_prefillETForm;this.updateDRTravellerName=TLIST_updateDRTravellerName;this.updateFFTravellerName=TLIST_updateFFTravellerName;this.localErrorInitNotBE=TLIST_localErrorInitNotBE;this.allowNumericRecLocRetrieve=TLIST_allowNumericRecLocRetrieve;}var TLIST=new TLIST();function TLIST_pageOnLoad(){LocalErrorInit();this.localErrorInitNotBE();this.init();this.prefill();}function TLIST_check(){if(TLIST.alreadySubmited){}else{WDSError.init();this.preCheck();if(WDSError.hasError()){WDSError.show();TLIST.alreadySubmited=false;}else{document.TLISTForm.submit();WDSWaitingImage.pleaseWait("wait");}}}function TLIST_checkSearch(){if(TLIST.alreadySubmited){}else{WDSError.init();this.rtResaCheck();this.setAction("DR");this.rtType="DR";}if(WDSError.hasError()){WDSError.show();TLIST.alreadySubmited=false;}else{document.TLISTForm.submit();WDSWaitingImage.pleaseWait("wait");}}function TLIST_preCheck(){WDSTrace.dump("TLIST_preCheck");var optRadio=eval("document.TLISTForm.rtOpt");var srRadio=eval("document.TLISTForm.selectedRecord");if(optRadio&&WDSCommon.getTagValue(optRadio)=="ET"){this.rtETCheck();this.setAction("ET");this.rtType="ET";}else{if(srRadio){var value=WDSCommon.getTagValue(srRadio);if(value==""){WDSError.add(WDSMessage.getMessage(1150));}else{if(value!="DR"&&value!="FF"&&value!="ET"){WDSCommon.updateTag(document.TLISTForm,"REC_LOC",value);var directRetrieve=eval("document.TLISTForm.DIRECT_RETRIEVE");if(this.userLoggedIn&&directRetrieve){WDSCommon.updateTag(document.TLISTForm,"DIRECT_RETRIEVE","FALSE");}var obj=eval("document.TLISTForm.recLoc_"+value);if(obj){var paxLastName=obj.getAttribute("_pax");if(paxLastName!=""){WDSCommon.updateTag(document.TLISTForm,"DIRECT_RETRIEVE_LASTNAME",paxLastName);}}}else{if(value=="DR"){this.rtResaCheck();this.setAction(value);this.rtType="DR";}else{if(value=="FF"){this.rtFFCheck();this.setAction(value);this.rtType="FF";}else{if(value=="ET"){this.rtETCheck();this.setAction(value);this.rtType="ET";}}}}}}}}function TLIST_updateFFTravellerName(){var obj=eval("document.TLISTForm.DIRECT_RETRIEVE_LASTNAME");if(obj){WDSCommon.updateTag(document.TLISTForm,"FF_LAST_NAME",WDSCommon.getTagValue(obj));}}function TLIST_updateDRTravellerName(){var obj=eval("document.TLISTForm.FF_LAST_NAME");if(obj){WDSCommon.updateTag(document.TLISTForm,"DIRECT_RETRIEVE_LASTNAME",WDSCommon.getTagValue(obj));}}function TLIST_rtResaCheck(){var obj=eval("document.TLISTForm.reservationNumber");if(obj){WDSCommon.updateTag(document.TLISTForm,"REC_LOC",WDSCommon.getTagValue(obj));}WDSCheck.checkMandatory(document.TLISTForm.REC_LOC,WDSMessage.getMessage(1150));if(TLIST.allowNumericRecLocRetrieve()==true){var recLocValue=WDSCommon.getTagValue(document.TLISTForm.REC_LOC);if(!((recLocValue.length==6&&recLocValue.match(WDSCheck.REGEXP_ALPHANUMERIC))||(recLocValue.length==12&&recLocValue.match(WDSCheck.REGEXP_NUMERIC)))){WDSError.add(WDSMessage.getMessage(1153),document.TLISTForm.REC_LOC);}}if(document.getElementById("DIRECT_RETRIEVE_LASTNAME")!=null){WDSCheck.checkMandatory(document.TLISTForm.DIRECT_RETRIEVE_LASTNAME,WDSMessage.getMessage(1022));}}function TLIST_rtFFCheck(){WDSCheck.checkMandatory(document.TLISTForm.AIRLINE_CODE_0,WDSMessage.getMessage(1301));WDSCheck.checkMandatory(document.TLISTForm.ACCOUNT_NUMBER_0,WDSMessage.getMessage(1305));WDSCheck.checkMandatory(document.TLISTForm.FF_LAST_NAME,WDSMessage.getMessage(1022));WDSCommon.updateTag(document.TLISTForm,"LAST_NAME",WDSCommon.getTagValue(eval("document.TLISTForm.FF_LAST_NAME")));}function TLIST_rtETCheck(){var objEtkt1=eval("document.TLISTForm.AIRLINE_CODE");var objEtkt2=eval("document.TLISTForm.TICKET_CODE");WDSCommon.updateTag(document.TLISTForm,"TICKET_NUMBER",WDSCommon.getTagValue(objEtkt1)+WDSCommon.getTagValue(objEtkt2));if(WDSCheck.checkMandatory(document.TLISTForm.TICKET_NUMBER,WDSMessage.getMessage(100))){if(WDSCheck.checkSize(document.TLISTForm.TICKET_NUMBER,WDSMessage.getMessage(101),13,13)){WDSCheck.checkForMatch(document.TLISTForm.TICKET_NUMBER,WDSMessage.getMessage(101),WDSCheck.REGEXP_NUMERIC);}}if(this.boolAllowEtktCheckName()){WDSCheck.checkMandatory(document.TLISTForm.ET_LAST_NAME,WDSMessage.getMessage(1022));WDSCommon.updateTag(document.TLISTForm,"LAST_NAME",WDSCommon.getTagValue(eval("document.TLISTForm.ET_LAST_NAME")));}}function TLIST_rtResShow(){showLevel("tlist_showhide1");hideLevel("tlist_showhide2");}function TLIST_rtFFShow(){showLevel("tlist_showhide2");hideLevel("tlist_showhide1");}function TLIST_rtETShow(){showLevel("tlist_showhideEtkt");hideLevel("tlist_showhideRes");}function TLIST_rtResOptShow(){showLevel("tlist_showhideRes");hideLevel("tlist_showhideEtkt");}function TLIST_rtHideAll(){if(this.boolAllowRtByFf()&&this.boolAllowPnrServ()){hideLevel("tlist_showhide1");hideLevel("tlist_showhide2");if(this.boolAllowEtktRetrieve()){hideLevel("tlist_showhideRes");hideLevel("tlist_showhideEtkt");}}else{if((this.boolAllowRtByFf()||this.boolAllowPnrServ())&&this.boolAllowEtktRetrieve()){hideLevel("tlist_showhideRes");hideLevel("tlist_showhideEtkt");}}}
