function check_date(field){ var checkstr = "0123456789"; var DateField = field; var Datevalue = ""; var DateTemp = ""; var seperator = "."; var day; var month; var year; var leap = 0; var err = 0; var i; err = 0; DateValue = DateField.value; /* Delete all chars except 0..9 */ for (i = 0; i < DateValue.length; i++) { if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) { DateTemp = DateTemp + DateValue.substr(i,1); } } DateValue = DateTemp; /* Always change date to 8 digits - string*/ /* if year is entered as 2-digit / always assume 20xx */ if (DateValue.length == 6) { DateValue = DateValue.substr(0,4) + '20' + DateValue.substr(4,2); } if (DateValue.length != 8) { err = 19;} /* year is wrong if year = 0000 */ year = DateValue.substr(4,4); if (year == 0) { err = 20; } /* Validation of month*/ month = DateValue.substr(2,2); if ((month < 1) || (month > 12)) { err = 21; } /* Validation of day*/ day = DateValue.substr(0,2); if (day < 1) { err = 22; } /* Validation leap-year / february / day */ if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) { leap = 1; } if ((month == 2) && (leap == 1) && (day > 29)) { err = 23; } if ((month == 2) && (leap != 1) && (day > 28)) { err = 24; } /* Validation of other months */ if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) { err = 25; } if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) { err = 26; } /* if 00 ist entered, no error, deleting the entry */ if ((day == 0) && (month == 0) && (year == 00)) { err = 0; day = ""; month = ""; year = ""; seperator = ""; } /* if no error, write the completed date to Input-Field (e.g. 13.12.2001) */ if (err == 0) { ; } /* Error-message if err != 0 */ else { alert("Date is incorrect!"); DateField.select(); DateField.focus(); } } // detect browser type ; function init(){ this.ver=navigator.appVersion this.dom=document.getElementById?1:0 this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; this.ie4=(document.all && !this.dom)?1:0; this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; this.ns4=(document.layers && !this.dom)?1:0; return this; }; bw=new init() // hide and Show funtions.. function showArea(div){ obj=bw.dom? document.getElementById(div).style:bw.ie4?document.all[div].style: bw.ns4?document.layers[div]:0; if(obj) obj.visibility='visible' } function hideArea(div){ obj=bw.dom? document.getElementById(div).style:bw.ie4?document.all[div].style: bw.ns4?document.layers[div]:0; if(obj) obj.visibility='hidden' } function onlynumber(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if ((charCode < 48 || charCode > 57)) return false; return true; } function numbercheck(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if ((charCode < 48 || charCode > 57)&&(charCode < 45 || charCode > 45)&&(charCode < 46 || charCode > 46 )&&(charCode < 40 || charCode > 40)&&(charCode < 41 || charCode > 41)&&(charCode < 32 || charCode > 32)) return false; return true; } function alphnumber1(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode==32) alert("Please replece space by ."); if ( (charCode < 46 || charCode > 46 ) && (charCode < 65 || charCode > 90 ) && (charCode < 97 || charCode > 122)) return false; return true; } function ValidateFormFromSpaces() { var el = document.getElementsByTagName('INPUT'); // Find all inputs for(no=0;no return false alert('Passenger Name Missing: Please Enter First Name and Last Name For All Passengers'); el[no].focus(); return false; } if(value.value=="") { alert("null"); return false; } } } return true; } //Update Dep arr calendar Fields function Updatef(data) //string = ""; { string = ""; SSTRING = ""; string = document.BookForm.SQLDEPDATE.value SSTRING = string.split( "/" ) N = SSTRING[0]; N = N - 1; document.BookForm.Depmonth.options[N].selected="true" N = SSTRING[1]; N = N - 1; document.BookForm.depday.options[N].selected="true" //{alert (string);return false} document.BookForm.SQLDEPDATE.value= string } // update shipping function Change(State) {switch (State){ case 1: document.getElementById('Choose').style.display='none'; document.getElementById('Chosen').style.display='inline'; break; case 2: document.getElementById('Choose').style.display='inline'; document.getElementById('Chosen').style.display='none'; break; case 3: document.getElementById('Choose2').style.display='none'; document.getElementById('Chosen2').style.display='inline'; break; case 4: document.getElementById('Choose2').style.display='inline'; document.getElementById('Chosen2').style.display='none'; break; } } //exchange characters function replaceChars(entry) { out = "["; // replace this add = "@"; // with this temp = "" + entry; // temporary holder while (temp.indexOf(out)>-1) { pos= temp.indexOf(out); temp = "" + (temp.substring(0, pos) + add + temp.substring((pos + out.length), temp.length)); } document.form1.Command.value = temp; } //Salesform function ShowSalesDate(f) { if(f.Period.options[4].selected){document.getElementById('SalesDate').style.display='inline';document.getElementById('SalesPeriod').style.display='none';return True;} else {if(f.Period.options[5].selected){document.getElementById('SalesPeriod').style.display='inline';document.getElementById('SalesDate').style.display='none';return True;} else {document.getElementById('SalesDate').style.display='none';document.getElementById('SalesPeriod').style.display='none';return True;} }} function checkLogonInput(f) {if (f.UserName.value==""){alert ("Please Enter User Email Address"); return false} else { if (f.Password.value==""){alert ("Please Enter Password");return false} }} function checkPassword(f) {if (f.UserName.value==""){alert ("Please Enter User Email Address"); return false} } function CheckPayment(f) {if (f.Ccno.value=="" || f.Ccno.value.length<15){alert ("Credit Card Number is Invalid!"); return false} else { if (f.Exp.value.length<4){alert ("Expiration Date is missing!");return false} else { if (f.Exp.value.length<4){alert ("Card ID is missing!");return false} else {if (f.Amount.value.length<1){alert ("Total Amount is Missing!");return false} else { if (f.Cname.value==""){alert ("Card Holder Name is Required!");return false} else { if (f.Phone.value==""){alert ("Phone Number is Required!");return false} else { if (f.Address.value==""){alert ("Address Field is Required for verification!");return false} else { if (f.City.value==""){alert ("City Field is Required - if the card has a foriegn address add city/country ");return false} else { if (f.State.value==""){alert ("State Field is Required - if the card has a foriegn address choose -- ");return false} else { if (f.Zip.value==""){alert ("Zip Code Field is Required - if the card has a foriegn address that does not have a zip code use 00000 instead and check the foriegn address box to avoid address verification");return false} else { if (f.Code.checked&&f.Approval.value.length<6){alert ("Approval Code cannot be less than 6 characters long");return false} else {return True;} }}}}}}}}}} } //Obtain Approval Code function ObtainApprovalCode(f){ ACode = ""; while (ACode == ""){ACode=prompt ("Please enter Enter your approval code/n the credit card will not be charged again.", "");} if (ACode.length>6 || ACode.length<6){alert ("The Approval Code Must Be Six Characters long !"); return false} if (ACode != null) {f.Approval.value=ACode;}; } //Invoice Input function checkInvoice(f) {if (f.Locator.value.length<6){alert ("Your Record Locator is missing Characters!");return false} else {if (f.Locator.value==""){alert ("Your Record Locator is missing!"); return false} else {if (f.Agent.options[0].selected){alert ("Agent name is not selected!");return false} else {if (f.Amount.value<1){alert ("Your Total Amount is missing!");return false} else {if (f.Pax.options[0].selected){alert ("The Number of Passengers cannot be Zero !"); return false} else {if (f.CRS[1].checked&&f.DepCity.value==""){alert ("Dep City is missing!"); return false} else {if (f.CRS[1].checked&&f.ArrCity.value==""){alert ("Arr City Code is missing!");return false} else {if (f.CRS[1].checked&&f.DepDate.value==""){alert ("Departure Date is missing!"); return false} else {if (f.CRS[1].checked&&f.First.value==""){alert ("Customer First name is missing!"); return false} else {if (f.CRS[1].checked&&f.Last.value==""){alert ("Customer Last Name is missing!"); return false} else {return True;} }}}}}}}}} } function MM_openBrWindow(theURL,winName,features) { window.open(theURL,winName,features);} function showhide(show) //LockOn~B~ V1.0 { switch (show) { case 0: document.getElementById('rowd').style.display='inline'; break; case 1: document.getElementById('rowd').style.display='none'; break; // case 3: // document.getElementById('Ship').style.display='inline'; // break; // // case 4: // document.getElementById('Ship').style.display='none'; // break; case 5: document.getElementById('TravelAgents').style.display='inline'; break; case 6: document.getElementById('TravelAgents').style.display='none'; break; case 7: document.getElementById('SabreInfo').style.display='inline'; break; case 8: document.getElementById('SabreInfo').style.display='none'; break; case 9: if(document.getElementById('Code').checked){document.getElementById('Approval').style.display='inline';return True;} else {document.getElementById('Approval').style.display='none';document.getElementById('Approval2').value='';return True;} break; } } function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {document.MM_pgW=innerWidth;document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } function show(object) {if (document.getElementById) {document.getElementById(object).style.visibility = 'visible';} else if (document.layers && document.layers[object]) {document.layers[object].visibility = 'visible';} else if (document.all) {document.all[object].style.visibility = 'visible';} } function hide(object) {if (document.getElementById) {document.getElementById(object).style.visibility = 'hidden';} else if (document.layers && document.layers[object]) {document.layers[object].visibility = 'hidden';} else if (document.all) {document.all[object].style.visibility = 'hidden';} } function checkInput(f) { var adutl=document.BookForm.ADT.value; var child=document.BookForm.CHD.value; adutl=parseInt(adutl,10); child=parseInt(child,10); var total=adutl + child; if (total>6) { alert ( "Total number of Child and Adult can not be more than 6" ); return (false); } var adutl=document.BookForm.ADT.value; var infant=document.BookForm.INF.value; adutl=parseInt(adutl,10); infant=parseInt(infant,10); if (infant>adutl) { alert ( "Number of Infants can not be more than Number of Adults" ); return (false); } dp_date = document.BookForm.SQLDEPDATE.value; x= new Date(dp_date); dp_month = x.getMonth()+1 dp_date = x.getDate() dp_year = x.getYear() //alert (mnt); //alert (dt); //alert (yr); ar_date = document.BookForm.SQLRETDATE.value; y= new Date(ar_date); ar_month = y.getMonth()+1 ar_date = y.getDate() ar_year = y.getYear() //alert (ar_mnt); //alert (ar_dt); //alert (ar_yr); {if (f.DepCity.value==""){alert ("Please Enter Departure City or Airport Code") f.DepCity.focus(); return (false)} else {if (f.DepCity.value.length<3) {alert ("Please verify and enter correct Departure Airport Code") f.DepCity.focus(); return (false)} else {if (f.DepCity.value=="Enter Origination City or Airport Code"){alert ("Please Enter Departure City or Airport Code") f.DepCity.focus(); return (false)} else {if (f.ArrCity.value=="") {alert ("Please Enter Arrival City or Airport Code") f.ArrCity.focus(); return (false)} else {if (f.ArrCity.value.length<3) {alert ("Please verify and enter correct Arrival Airport Code") f.ArrCity.focus(); return (false)} else {if (f.ArrCity.value=="Enter Destination City or Airport Code"){alert ("Please Enter Arrival City or Airport Code") f.ArrCity.focus(); return (false)} else {if (f.ArrCity.value==f.DepCity.value) {alert ("Please verify Departure City and Arrival City can not be same") f.ArrCity.focus(); return (false)} var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,.() " var checkStr = BookForm.DepCity.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Please enter characters in depature city or code."); BookForm.DepCity.focus(); return (false); } var checkOK2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,.() " var checkStr2 = BookForm.ArrCity.value; var allValid2 = true; for (k = 0; k< checkStr2.length; k++) { ch = checkStr2.charAt(k); for (j = 0; j < checkOK2.length; j++) if (ch == checkOK2.charAt(j)) break; if (j == checkOK2.length) { allValid2 = false; break; } } if (!allValid2) { alert("Please enter characters in arrival city or code."); BookForm.ArrCity.focus(); return (false); } {if (f.SQLDEPDATE.value=="mm/dd/yyyy") { alert("Please enter Departing Date") f.SQLDEPDATE.focus(); return(false)} else {if (f.SQLDEPDATE.value=="") {alert("Please enter Departing Date") f.SQLDEPDATE.focus(); return(false) } if (f.OWRT[1].checked) { if (document.BookForm.SQLRETDATE.value=="mm/dd/yyyy") {alert("Please enter Return Date") document.BookForm.SQLRETDATE.focus(); return(false); };} {if (f.SQLRETDATE.value=="") {alert("Please enter Return Date") f.SQLRETDATE.focus(); return(false) } {if (document.BookForm.SQLRETDATE.value != "mm/dd/yyyy") { if ((ar_year)<(dp_year)) { alert("Please Verify the Return Date: Return Date Can Not be Before Departure Date"); f.SQLRETDATE.focus(); return(false); } if ((ar_year)==(dp_year)) { if ((ar_month) < (dp_month)) { alert("Please Verify the Return Date: Return Date Can Not be Before Departure Date"); f.SQLRETDATE.focus(); return(false); } if ((ar_month) == (dp_month)) { if ((ar_date) < (dp_date)) { alert("Please Verify the Return Date: Return Date Can Not be Before Departure Date"); f.SQLRETDATE.focus(); return(false); } } } } {if (f.ADT.value=="0") {alert("Please select number of passengers travelling.") f.ADT.focus(); return(false) } { var now = new Date(); var today = new Date(now.getYear(),now.getMonth(),now.getDate()); if (document.BookForm.SQLDEPDATE.value==today.toString()) {alert("Please Date") f.SQLRETDATE.focus(); return(false) } {Form.style.display = 'none';Search.style.display = 'block';;return true;} }}}}}}}}}} }}}} //Check PNR input function checkGetPnrInput(f) { if (Login.Locator.value=="") { alert ("Enter your Confirmation Number"); return false } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789" var checkStr = Login.Locator.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Please enter characters or numbers only. No 0's allowed"); Login.Locator.focus(); return (false); } if (Login.Locator.value.length<6) { alert ("Your Confirmation Number in incomplete!"); return false } } function val(f) { if (Login1.Locator.value=="") { alert ("Enter your Confirmation Number to find Itinerary/Flight information "); return false } if (Login1.Locator.value.length<6) { alert ("Your Confirmation Number in incomplete!"); return false } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789" var checkStr = Login1.Locator.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Please enter characters or numbers only.No 0's allowed"); Login1.Locator.focus(); return (false); } } function checkAgentsInput(f) {if (f.Company.value==""){alert ("Your Company name is missing!");return false} else {if (f.Address.value==""){alert ("Your Address is missing!"); return false} else { if (f.City.value==""){alert ("Your City is missing!");return false} else {if (f.State.value==""){alert ("Your State is missing!"); return false} else {if (f.Zip.value==""){alert ("Your Zip Code is missing!");return false} else {if (f.Phone.value==""){alert ("Your Phone Number is missing!"); return false} else {if (f.Fax.value==""){alert ("Your Fax Number is missing!"); return false} else {if (f.Email.value==""){alert ("Your Email Address is missing!"); return false} else {if (f.Users.value==""){alert ("Your User Name is missing!"); return false} else {if (f.Password.value==""){alert ("Your Password is missing!"); return false} else {return true;} }}}}}}}}} } //credit card form function CreditCardInput(f) { var mastercard=f.Ctype.value; var cvv=f.CardID.value; if(mastercard=="AX") { if((cvv.length < 4)||(cvv.length > 4)) { alert ( "Please enter 4 digit Security Code" ); return false;; } } if(mastercard !="AX") { if((cvv.length < 3)||(cvv.length > 3)) { alert ( "Please enter 3 digit Security Code" ); return false; } } if (f.Cname.value=='') {alert ('Please verify and enter Credit Card holders name'); f.Cname.focus(); return false;} var checkOK4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz " var checkStr4 = f.Cname.value; var allValid4 = true; for (i = 0; i < checkStr4.length; i++) { ch = checkStr4.charAt(i); for (j = 0; j < checkOK4.length; j++) if (ch == checkOK4.charAt(j)) break; if (j == checkOK4.length) { allValid4 = false; break; } } if (!allValid4) { alert("Please enter characters only"); f.Cname.focus(); return (false); } else {if (f.Address.value=='') {alert ('Please verify and enter Your Billing Address for Credit Card'); f.Address.focus(); return false;} else {if (f.Address.value.length<7) {alert ('Please verify and enter Credit Card Holders complete address'); f.Address.focus(); return false;} else {if (f.City.value=='') {alert ('Please verify and enter City'); f.City.focus(); return false;} var checkOK5 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz " var checkStr5 = f.City.value; var allValid5 = true; for (i = 0;i < checkStr5.length;i++) { ch = checkStr5.charAt(i); for (j = 0; j < checkOK5.length; j++) if (ch == checkOK5.charAt(j)) break; if (j == checkOK5.length) { allValid5 = false; break; } } if (!allValid5) { alert("Please enter characters only in City"); f.City.focus(); return (false); } else {if (f.State.value=='') {alert ('Please verify and enter State'); f.State.focus(); return false;} var checkOK6 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" var checkStr6 = f.State.value; var allValid6 = true; for (i = 0;i < checkStr6.length;i++) { ch = checkStr6.charAt(i); for (j = 0; j < checkOK6.length; j++) if (ch == checkOK6.charAt(j)) break; if (j == checkOK6.length) { allValid6 = false; break; } } if (!allValid6) { alert("Please enter characters only in State"); f.State.focus(); return (false); } else {if (f.Zip.value=='') {alert ('Please verify and enter Zip Code'); f.Zip.focus(); return false;} if (f.Zip.value.length<5) { alert('Please enter a valid zip code') f.Zip.focus(); return false; } else var checkOK = "1234567890" var checkStr = f.Zip.value; var allValid = true; for (i = 0;i < checkStr.length;i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Please enter or numbers only in zip code"); f.Zip.focus(); return (false); } else {if (f.Email.value=='') {alert ('Please verify and enter Email'); f.Email.focus(); return false;} else if (f.Email.value.indexOf("@", 0) < 0) { window.alert("Please enter a valid e-mail address."); f.Email.focus(); return false; } else if (f.Email.value.indexOf(".", 0) < 0) { window.alert("Please enter a valid e-mail address."); f.Email.focus(); return false; } else {if (f.Phone.value=='') {alert ('Please verify and enter Phone Number on file with your Credit Card company'); f.Phone.focus(); return false;} var checkOK3 = "1234567890 -" var checkStr3 = f.Phone.value; var allValid3 = true; for (i = 0; i < checkStr3.length; i++) { ch = checkStr3.charAt(i); for (j = 0; j < checkOK3.length; j++) if (ch == checkOK3.charAt(j)) break; if (j == checkOK3.length) { allValid3 = false; break; } } if (!allValid3) { alert("Please enter numbers in Phone."); f.Phone.focus(); return (false); } else {if (f.Ccno.value=='') {alert ('Please verify and enter correct Credit Card number'); f.Ccno.focus(); return false;} var checkOK2 = "1234567890" var checkStr2 = f.Ccno.value; var allValid2 = true; for (i = 0; i < checkStr2.length; i++) { ch = checkStr2.charAt(i); for (j = 0; j < checkOK2.length; j++) if (ch == checkOK2.charAt(j)) break; if (j == checkOK2.length) { allValid2 = false; break; } } if (!allValid2) { alert("Please enter numbers only in Credit Cards"); f.Ccno.focus(); return (false); } {if (f.Exp1.value=='') {alert ('Please verify Credit Card Expiration Month'); f.Exp1.focus(); return false;} else {if (f.Exp2.value=='') {alert ('Please verify Credit Card Expiration Year'); f.Exp2.focus(); return false;} else {if (f.Ctype.value=='') {alert ('Please select Credit Card Type'); f.Ctype.focus(); return false;} else {if (f.CardID.value=='') {alert ('Security Code Missing: Please verify and enter Security Code from your Credit Card, Last 3 digit on the back of most cards except American Express 4 digit on front right corner'); f.CardID.focus(); return false;} else { // place any other field validations that you require here // validate myradiobuttons myOption = -1; for (i=f.CC_Passenger.length-1; i > -1; i--) { if (f.CC_Passenger[i].checked) { myOption = i; } } if (myOption == -1) { alert("Please select option whether Credit Card Holder is a passenger or not."); return false; } {Form.style.display = 'none';Search.style.display = 'block';;return true;} }}}}}}}}}}}}}} //accept form function AcceptForm(f) {if (f.AgreeCheck.checked){return true;}else{alert ('You Must Check the box to agree to the terms and conditions');return false;};} // security site seal pop up function popUp(url) { sealWin=window.open(url,'win','toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450'); self.name = "mainWin";} // pop ups function function MM_openBrWindow(theURL,winName,features) { window.open(theURL,winName,features);} //THIS PART FOR THE MOVING PIC