var index=new function(){var n=this,t;this.Init=function(t){app.InitPage(t);n.RecaptchaSiteKey=t.RecaptchaSiteKey;n.IsRecaptchaEnabled=t.IsRecaptchaEnabled;n.txtPNR=$("#txt-pnr");n.txtLastName=$("#txt-last-name");n.txtFirstName=$("#txt-first-name");n.txtBookingNumber=$("#txt-booking-number");n.txtOriginAirportCode=$("#txt-origin-airport-code");n.txtDestinationAirportCode=$("#txt-destination-airport-code");n.txtCheckinGroup=$("#txt-checkin-group");$(".input-lg").keypress(function(t){var i=new RegExp("^[a-zA-Z0-9\\-\\x20]+$"),r=String.fromCharCode(t.charCode?t.charCode:t.which);if(!i.test(r)&&t.which!=13)return t.preventDefault(),!1;t.which===13&&n.Submit()});$(".cultures label").click(function(){var n=$(this).data("culture");window.location=app.Context.BaseUrl+n});$("#btn-continue").click(function(){n.Submit()})};this.Submit=function(){n.IsRecaptchaEnabled?grecaptcha.execute():n.Search(null)};this.Search=function(i){var r;if(!t){t=!0;var u=n.txtPNR.val(),f=n.txtLastName.val(),e=n.txtFirstName.val(),o=n.txtBookingNumber.val(),s=n.txtOriginAirportCode.val(),h=n.txtDestinationAirportCode.val(),c;if(f==""&&e==""&&u==""&&o==""&&s==""&&h==""){t=!1;$(window).scrollTop(0);app.ShowMessage(app.Messages.MISSING_REQUIRED_DATA);return}r=$(window);app.Context.ScreenWidth=r.width();app.Context.ScreenHeight=r.height();app.ShowLoader();$.ajax({url:"/process/index",cache:!1,async:!0,type:"POST",dataType:"json",headers:{Context:JSON.stringify(app.Context)},contentType:"application/x-www-form-urlencoded; charset=utf-8",data:{__RequestVerificationToken:app.Token,PNR:u,LastName:f,FirstName:e,BookingNumber:o,OriginAirportCode:s,DestinationAirportCode:h,Culture:app.Context.Culture,CheckinGroup:c,RecaptchaToken:i},success:function(n){t=!1;window.location=n.IsValid?"/process/"+n.Action:n.Culture!=null?"/"+n.Culture:"/"},error:function(){t=!1;app.HideLoader();app.ShowMessage(app.Messages.UNABLE_TO_CONTINUE)}})}};t=null;this.RecaptchaSiteKey=null;this.IsRecaptchaEnabled=null;this.txtPNR=null;this.txtLastName=null;this.txtFirstName=null;this.txtBookingNumber=null;this.txtOriginAirportCode=null;this.txtDestinationAirportCode=null;this.txtCheckinGroup=null}