// JavaScript Document
//Function to check form is filled in correctly before submitting

function CheckForm() 
{
	var errorMsg = "";
	var errorMsgLong = "";
	var ss = new Date();
	var tmp = new String;

	if (document.frmReserve.cboHour.value == "HH" || document.frmReserve.cboMinute.value == "MM")
	{
		errorMsg += " - Pick-up Time is invalid";
	}
	else
	{
		var tmpdt = document.frmReserve.txtpickupdate.value;
		var dt = 0,mon = 0, yr = 0,tdt = 0,tmon = 0,tyr = 0,tmp;
		dt = parseInt(ss.getDate());
		mon = parseInt(ss.getMonth()+1);
		yr = parseInt(ss.getYear());
		tmp = tmpdt.substr(0,2);
		if(tmp.charAt(0) == '0')
			tmon = parseInt(tmp.charAt(1));
		else
			tmon = parseInt(tmp);
		tmp = tmpdt.substr(3,2);
		if(tmp.charAt(0) == '0')
			tdt = parseInt(tmp.charAt(1));
		else
			tdt = parseInt(tmp);
		tyr = parseInt(tmpdt.substr(6,4));
		var hr = 0;
		hr = parseInt(document.all.cboHour.value);
		if (document.all.cboAMPM.value == "AM" || document.all.cboAMPM.value == "am")
		{
			if (hr == 12)
				hr = 0;
		}
		else
		{	
			if (hr != 12)
			{
				hr = hr + 12;
			}
			else
			{
				hr = 0;
			}
		}
		var rdate = new Date(); //todays date
		var tdate = new Date(tyr,tmon-1,tdt,hr,parseInt(document.all.cboMinute.value),00,00);
						// user entered date
		if (tdate <= rdate)
			errorMsg += "\n - Please check the Pickup Time and Date";		
	}
	
	if(document.frmReserve.chkround.checked)
	{
		if (document.frmReserve.cboRHour.value == "HH" || document.frmReserve.cboRMinute.value == "MM")
		{
			errorMsg += "\n - Return Time is invalid";
		}
		else
		{
			var ttmpdt = document.frmReserve.txtrounddate.value;
			var tdt = 0,tmon = 0, tyr = 0,ttdt = 0,ttmon = 0,ttyr = 0,ttmp;
			tdt = parseInt(ss.getDate());
			tmon = parseInt(ss.getMonth()+1);
			tyr = parseInt(ss.getYear());
			ttmp = ttmpdt.substr(0,2);
			if(ttmp.charAt(0) == '0')
				ttmon = parseInt(ttmp.charAt(1));
			else
				ttmon = parseInt(ttmp);
			ttmp = ttmpdt.substr(3,2);
			if(ttmp.charAt(0) == '0')
				ttdt = parseInt(ttmp.charAt(1));
			else
				ttdt = parseInt(ttmp);
			ttyr = parseInt(ttmpdt.substr(6,4));
			var thr = 0;
			thr = parseInt(document.all.cboRHour.value);
			if (document.all.cboRAMPM.value == "AM" || document.all.cboRAMPM.value == "am")
			{
				if (thr == 12)
					thr = 0;
			}
			else
			{	
				if (thr != 12)
				{
					thr = thr + 12;
				}
				else
				{
					thr = 0;
				}
			}
			var trdate = new Date(); //todays date
			var ttdate = new Date(ttyr,ttmon-1,ttdt,thr,parseInt(document.all.cboRMinute.value),00,00);
							// user entered date
			if (ttdate <= trdate)
				errorMsg += "\n - Please check the Return Time and Date";		
		}
	}
	
	if (document.frmReserve.txtname.value.length < 1 ){
		errorMsg += "\n - Passenger(s) name cannot be blank";
	}

	if (document.frmReserve.txtPhone.value.length < 1){
		errorMsg += "\n - Phone cannot be blank";
	}
	
	if (document.frmReserve.txtEmail.value.length < 1){
		errorMsg += "\n - Email address cannot be blank";
	}
	
	if (document.frmReserve.rdopickup[0].checked == false && document.frmReserve.rdopickup[1].checked == false)
	{
		errorMsg += "\n - Please Select the Pickup Location";
	}
	else if(document.frmReserve.rdopickup[0].checked == true)
	{
		if(document.frmReserve.cboFromAirport.value == "")
		{
			errorMsg += "\n - Please select Pickup Airport";
		}
		if(document.frmReserve.cboFromAirline.value == "")
		{
			errorMsg += "\n - Please select Airline in From Airport Column";
		}
		
/*		if(document.frmReserve.txtArrivingFrom.value == "")
		{
			errorMsg += "\n - Airriving From Cannot be Blank";
		}
*/		
		//this by ramu
		
		if(document.frmReserve.txtfromAirportSpeciaInstr.value.length>100)
		{
		  errorMsg += "\n - From Airport Special Instructions are too long";
		}
		
	}
	else if(document.frmReserve.rdopickup[1].checked == true)
	{
		if(document.frmReserve.txtfromAddr.value == "")
		{
			errorMsg += "\n - From Address Cannot be Blank";
		}
		if(document.frmReserve.txtfromCity.value == "")
		{
			errorMsg += "\n - From City Cannot be Blank";
		}
		if(document.frmReserve.cbofromState.value == "")
		{
			errorMsg += "\n - Please Select The From State";
		}
		if(document.frmReserve.txtfromAddrSpeciaInstr.value.length>100)
		{
			errorMsg += "\n - From Address Special Instructions are too long";
		}
	}
	
	if (document.frmReserve.rdoDropoff[0].checked == false && document.frmReserve.rdoDropoff[1].checked == false)
	{
		errorMsg += "\n - Please Select the DropOff Location";
	}
	else if(document.frmReserve.rdoDropoff[0].checked == true)
	{
		if(document.frmReserve.cboToAirport.value == "")
		{
			errorMsg += "\n - Please select DropOff Airport";
		}
		if(document.frmReserve.cboToAirline.value == "")
		{
			errorMsg += "\n - Please select Airline in To Airport Column";
		}
/*		if(document.frmReserve.txtDepartingTo.value == "")
		{
			errorMsg += "\n - Departing To Cannot be Blank";
		}
*/		if(document.frmReserve.txtToAirportSpeciaInstr.value.length>100)
		{
			errorMsg += "\n - To Airpot Special Instructions are too long";
		}
	}
	else if(document.frmReserve.rdoDropoff[1].checked == true)
	{
		if(document.frmReserve.txtToAddr.value == "")
		{
			errorMsg += "\n - To Address Cannot be Blank";
		}
		if(document.frmReserve.txtToCity.value == "")
		{
			errorMsg += "\n - To City Cannot be Blank";
		}
		if(document.frmReserve.cboToState.value == "")
		{
			errorMsg += "\n - Please Select The To State";
		}
		if(document.frmReserve.txtToAddrSpeciaInstr.value.length>100)
		{
			errorMsg += "\n - To Address Special Instructions are too long";
		}
	}
	
	if(document.frmReserve.txtGeneralInstr.value.length>200)
	{
		errorMsg += "\n -  Notes/Comments/Suggestions are too long";
	}	
	     
	if (!document.frmReserve.chkAgree.checked){
		errorMsg += "\n - You need to agree to the Terms & Conditions before making the reservations";
	}
	if (errorMsg != ""){
		msg = "-----------------------------------------------------------\n";
		msg += "The following field(s) need to be corrected:\n";
		msg += "-----------------------------------------------------------\n";

		alert(msg + errorMsg + "\n" + "");
		return false;
	}
	/*else
	{
		////////////////ur code comes here
		var str= "";
		
		str = "reserve_confirm.asp?txtpickupdate=" + document.all.txtpickupdate.value;
		str+= "&cboHour=" + document.all.cboHour.value + "&cboMinute=" + document.all.cboMinute.value + "&cboAMPM=" + document.all.cboAMPM .value + "&cboTransfer=" + document.all.cboTransfer.value + "&cboVehicles=" + document.all.cboVehicles.value + "&txtNumPass=" +  document.all.txtNumPass.value + "&cboStops=" +  document.all.cboStops.value;
		str+= "&txtname=" + document.all.txtname.value + "&txtPhone=" + document.all.txtPhone.value + "&cboPhoneType=" + document.all.cboPhoneType.value + "&txtEmail=" + document.all.txtEmail.value + "&cboFromAirport=" + document.all.cboFromAirport.value + "&cboFromAirline=" + document.all.cboFromAirline.value +"&txtArrivingFrom=" + document.all.txtArrivingFrom.value;
	    str+= "&txtFromFlightNum=" + document.all.txtFromFlightNum.value + "&txtfromAirportSpeciaInstr=" + document.all.txtfromAirportSpeciaInstr.value + "&txtfromAddr=" + document.all.txtfromAddr.value + "&txtfromCity=" + document.all.txtfromCity.value + "&cbofromState=" + document.all.cbofromState.value + "&txtfromZip=" + document.all.txtfromZip.value +"&txtfromAddrSpeciaInstr=" + document.all.txtfromAddrSpeciaInstr.value;
	    str+= "&cboToAirport=" + document.all.cboToAirport.value+ "&cboToAirline=" + document.all.cboToAirline.value + "&txtDepartingTo=" + document.all.txtDepartingTo.value + "&txtToFlightNum=" + document.all.txtToFlightNum.value + "&txtToAirportSpeciaInstr=" + document.all.txtToAirportSpeciaInstr.value +"&txtToAddr=" + document.all.txtToAddr.value;
		str+= "&txtToCity=" + document.all.txtToCity.value+ "&cboToState=" + document.all.cboToState.value + "&txtToZip=" + document.all.txtToZip.value + "&txtToAddrSpeciaInstr=" + document.all.txtToAddrSpeciaInstr.value;
        str+= "&txtGeneralInstr=" + document.all.txtGeneralInstr.value;
		//alert(str);
		window.open(str,"","width=600,height=500,addressbar=0,statusbar=0,scrollbars=1,directories=0,top=10px,left=10px");
	}*/
	return true;
}


//this is by ramu

function validateName()
{
	var strn = NameTrim(document.frmReserve.txtname.value);
	document.frmReserve.txtname.value = strn;
}

function NameTrim(txtname)
 {

	 while (txtname.substring(0,1) == ' ')
	 {
	 txtname = txtname.substring(1, txtname.length);
	 }
	 while (txtname.substring(txtname.length-1, txtname.length) == ' ')
	 {
	 txtname = txtname.substring(0,txtname.length-1);
	 }
	 return txtname;
 }
 
 function validateEmail()
 {
 	var stre =  EmailTrim(document.frmReserve.txtEmail.value);
 	document.frmReserve.txtEmail.value = stre;
}
function EmailTrim(txtEmail)
 {

	 while (txtEmail.substring(0,1) == ' ')
	 {
	 txtEmail = txtEmail.substring(1, txtEmail.length);
	 }
	 while (txtEmail.substring(txtEmail.length-1, txtEmail.length) == ' ')
	 {
	 txtEmail = txtEmail.substring(0,txtEmail.length-1);
	 }
	 return txtEmail;
 }
 
  function validateFlight()
  {
   var strf =  FlightTrim(document.frmReserve.txtFromFlightNum.value);
   document.frmReserve.txtFromFlightNum.value = strf;
  } 
 	function FlightTrim(txtFromFlightNum)
	 {
	
		 while (txtFromFlightNum.substring(0,1) == ' ')
		 {
		 txtFromFlightNum = txtFromFlightNum.substring(1, txtFromFlightNum.length);
		 }
		 while (txtFromFlightNum.substring(txtFromFlightNum.length-1, txtFromFlightNum.length) == ' ')
		 {
		 txtFromFlightNum = txtFromFlightNum.substring(0,txtFromFlightNum.length-1);
		 }
		 return txtFromFlightNum;
 }
 
 function validateANY()
   {
    var strany =  ANYTrim(document.frmReserve.txtfromAirportSpeciaInstr.value);
    document.frmReserve.txtfromAirportSpeciaInstr.value = strany;
   } 
  function ANYTrim(txtfromAirportSpeciaInstr)
 	 {
 	
 		 while (txtfromAirportSpeciaInstr.substring(0,1) == ' ')
 		 {
 		 txtfromAirportSpeciaInstr = txtfromAirportSpeciaInstr.substring(1, txtfromAirportSpeciaInstr.length);
 		 }
 		 while (txtfromAirportSpeciaInstr.substring(txtfromAirportSpeciaInstr.length-1, txtfromAirportSpeciaInstr.length) == ' ')
 		 {
 		 txtfromAirportSpeciaInstr = txtfromAirportSpeciaInstr.substring(0,txtfromAirportSpeciaInstr.length-1);
 		 }
 		 return txtfromAirportSpeciaInstr;
  }
  
  function validateSpetial()
  {
    var strspe =  SpeTrim(document.frmReserve.txtfromAddrSpeciaInstr.value);
    document.frmReserve.txtfromAddrSpeciaInstr.value = strspe;
   } 
   function SpeTrim(txtfromAddrSpeciaInstr)
    	 {
    	
    		 while (txtfromAddrSpeciaInstr.substring(0,1) == ' ')
    		 {
    		 txtfromAddrSpeciaInstr = txtfromAddrSpeciaInstr.substring(1, txtfromAddrSpeciaInstr.length);
    		 }
    		 while (txtfromAddrSpeciaInstr.substring(txtfromAddrSpeciaInstr.length-1, txtfromAddrSpeciaInstr.length) == ' ')
    		 {
    		 txtfromAddrSpeciaInstr = txtfromAddrSpeciaInstr.substring(0,txtfromAddrSpeciaInstr.length-1);
    		 }
    		 return txtfromAddrSpeciaInstr;
  }
   
 
 function validateDTA()
 {
     var strdta =  DTATrim(document.frmReserve.cboToAirport.value);
     document.frmReserve.cboToAirport.value = strdta;
    } 
    function DTATrim(cboToAirport)
     	 {
     	
     		 while (cboToAirport.substring(0,1) == ' ')
     		 {
     		 cboToAirport = cboToAirport.substring(1, cboToAirport.length);
     		 }
     		 while (cboToAirport.substring(cboToAirport.length-1, cboToAirport.length) == ' ')
     		 {
     		 cboToAirport = cboToAirport.substring(0,cboToAirport.length-1);
     		 }
     		 return cboToAirport;
   }
   
  

function validateArrive()
{
	var stra = ArriveTrim(document.frmReserve.txtArrivingFrom.value);
	document.frmReserve.txtArrivingFrom.value = stra;
}

function ArriveTrim(txtArrivingFrom)
 {

	 while (txtArrivingFrom.substring(0,1) == ' ')
	 {
	 txtArrivingFrom = txtArrivingFrom.substring(1, txtArrivingFrom.length);
	 }
	 while (txtArrivingFrom.substring(txtArrivingFrom.length-1, txtArrivingFrom.length) == ' ')
	 {
	 txtArrivingFrom = txtArrivingFrom.substring(0,txtArrivingFrom.length-1);
	 }
	 return txtArrivingFrom;


 }
 
 function validateLocation()
 {
 	var strl = LocationTrim(document.frmReserve.txtfromAddr.value);
 	document.frmReserve.txtfromAddr.value = strl;
 }
 
 function LocationTrim(txtfromAddr)
  {
 
 	while (txtfromAddr.substring(0,1) == ' ')
 	 {
 	txtfromAddr = txtfromAddr.substring(1, txtfromAddr.length);
 	 }
 	 while (txtfromAddr.substring(txtfromAddr.length-1, txtfromAddr.length) == ' ')
 	 {
 	 txtfromAddr = txtfromAddr.substring(0,txtfromAddr.length-1);
 	 }
 	 return txtfromAddr;
 
  }
  
  function validateDFlight()
  {
  	var strdf = DFlightTrim(document.frmReserve.txtToFlightNum.value);
  	document.frmReserve.txtToFlightNum.value = strdf;
  }
  
  function DFlightTrim(txtToFlightNum)
   {
  
  	 while (txtToFlightNum.substring(0,1) == ' ')
  	 {
  	 txtToFlightNum = txtToFlightNum.substring(1, txtToFlightNum.length);
  	 }
  	 while (txtToFlightNum.substring(txtToFlightNum.length-1, txtToFlightNum.length) == ' ')
  	 {
  	 txtToFlightNum = txtToFlightNum.substring(0,txtToFlightNum.length-1);
  	 }
  	 return txtToFlightNum;
   
 }
  
  function validateCity()
  {
   	var strc = CityTrim(document.frmReserve.txtfromCity.value);
   	document.frmReserve.txtfromCity.value = strc;
   }
   
   function CityTrim(txtfromCity)
    {
   
   	while (txtfromCity.substring(0,1) == ' ')
   	 {
   	txtfromCity = txtfromCity.substring(1, txtfromCity.length);
   	 }
   	 while (txtfromCity.substring(txtfromCity.length-1, txtfromCity.length) == ' ')
   	 {
   	 txtfromCity = txtfromCity.substring(0,txtfromCity.length-1);
   	 }
   	 return txtfromCity;
   
  }
  
  function validateDany()
    {
    	var strdany = DanyTrim(document.frmReserve.txtToAirportSpeciaInstr.value);
    	document.frmReserve.txtToAirportSpeciaInstr.value = strdany;
    }
    
    function DanyTrim(txtToAirportSpeciaInstr)
     {
    
    	 while (txtToAirportSpeciaInstr.substring(0,1) == ' ')
    	 {
    	 txtToAirportSpeciaInstr = txtToAirportSpeciaInstr.substring(1, txtToAirportSpeciaInstr.length);
    	 }
    	 while (txtToAirportSpeciaInstr.substring(txtToAirportSpeciaInstr.length-1, txtToAirportSpeciaInstr.length) == ' ')
    	 {
    	 txtToAirportSpeciaInstr = txtToAirportSpeciaInstr.substring(0,txtToAirportSpeciaInstr.length-1);
    	 }
    	 return txtToAirportSpeciaInstr;
     
 }
 
 function validateDAS()
     {
     	var strddas = DASTrim(document.frmReserve.txtToAddrSpeciaInstr.value);
     	document.frmReserve.txtToAddrSpeciaInstr.value = strddas;
     }
     
     function DASTrim(txtToAddrSpeciaInstr)
      {
     
     	 while (txtToAddrSpeciaInstr.substring(0,1) == ' ')
     	 {
     	 txtToAddrSpeciaInstr = txtToAddrSpeciaInstr.substring(1, txtToAddrSpeciaInstr.length);
     	 }
     	 while (txtToAddrSpeciaInstr.substring(txtToAddrSpeciaInstr.length-1, txtToAddrSpeciaInstr.length) == ' ')
     	 {
     	 txtToAddrSpeciaInstr = txtToAddrSpeciaInstr.substring(0,txtToAddrSpeciaInstr.length-1);
     	 }
     	 return txtToAddrSpeciaInstr;
      
 }
 
 function validateDeparting()
 {
    	var strd = DepartingTrim(document.frmReserve.txtDepartingTo.value);
    	document.frmReserve.txtDepartingTo.value = strd;
   }
 function DepartingTrim(txtDepartingTo)
     {
    
    	while (txtDepartingTo.substring(0,1) == ' ')
    	 {
    	txtDepartingTo = txtDepartingTo.substring(1, txtDepartingTo.length);
    	 }
    	 while (txtDepartingTo.substring(txtDepartingTo.length-1, txtDepartingTo.length) == ' ')
    	 {
    	 txtDepartingTo = txtDepartingTo.substring(0,txtDepartingTo.length-1);
    	 }
    	 return txtDepartingTo;
    
  }
   function validateLDA()
   {
       	var strlda = LDATrim(document.frmReserve.txtToAddr.value);
       	document.frmReserve.txtToAddr.value = strlda;
   }
   
   function LDATrim(txtToAddr)
        {
       
       	while (txtToAddr.substring(0,1) == ' ')
       	 {
       	txtToAddr = txtToAddr.substring(1, txtToAddr.length);
       	 }
       	 while (txtToAddr.substring(txtToAddr.length-1, txtToAddr.length) == ' ')
       	 {
       	 txtToAddr = txtToAddr.substring(0,txtToAddr.length-1);
       	 }
       	 return txtToAddr;
       
  }
  
  function validateNCS()
   {
      	var strncs = NCSTrim(document.frmReserve.txtGeneralInstr.value);
      	document.frmReserve.txtGeneralInstr.value = strncs;
     }
   function NCSTrim(txtGeneralInstr)
       {
      
      	while (txtGeneralInstr.substring(0,1) == ' ')
      	 {
      	txtGeneralInstr = txtGeneralInstr.substring(1, txtGeneralInstr.length);
      	 }
      	 while (txtGeneralInstr.substring(txtGeneralInstr.length-1, txtGeneralInstr.length) == ' ')
      	 {
      	 txtGeneralInstr = txtGeneralInstr.substring(0,txtGeneralInstr.length-1);
      	 }
      	 return txtGeneralInstr;
      
  }
  
  function validateCTY()
  {
         	var strcty = CTYTrim(document.frmReserve.txtToCity.value);
         	document.frmReserve.txtToCity.value = strcty;
  }
 function CTYTrim(txtToCity)
             {
            
            	while (txtToCity.substring(0,1) == ' ')
            	 {
            	txtToCity = txtToCity.substring(1, txtToCity.length);
            	 }
            	 while (txtToCity.substring(txtToCity.length-1, txtToCity.length) == ' ')
            	 {
            	 txtToCity = txtToCity.substring(0,txtToCity.length-1);
            	 }
            	 return txtToCity;
            
  }
   
  

var nums=new Array('document.frmReserve.txtPhone');
function doCheckPhone(){

var re= /\D/;
// test for this format: (xxx)xxx-xxxx
var re2 = /^\({1}\d{3}\)\d{3}-\d{4}/;
// test for this format: xxx-xxx-xxxx
//var re2 = /^\d{3}-\d{3}-\d{4}/;

for (i=0; i<nums.length;i++){
var num=eval(nums[i]+'.value');

var newNum;
 if (num != "" && re2.test(num)!=true){
   if (num != ""){
     while (re.test(num)){
     num = num.replace(re,"");
     }
   }

  if (num.length != 10){
    alert('Please enter a 10 digit phone number');
    document.frmReserve.txtPhone.focus();
    //eval(nums[i]).select();
    break;
    }
   else {
     // for format (xxx)xxx-xxxx
     newNum = '(' + num.substring(0,3) + ') ' + num.substring(3,6) + '-' + num.substring(6,10);
     // for format xxx-xxx-xxxx
     // newNum = num.substring(0,3) + '-' + num.substring(3,6) + '-' + num.substring(6,10);
     eval(nums[i]).value=newNum;
     }
   }
  }
}

// Radio Button Validation
function valButton(btn) {
var cnt = -1;
for (var i=0; i < btn.length; i++) {
   if (btn[i].checked) {cnt = i; i = btn.length;}
   }
if (cnt > -1) return btn[cnt].value;
else return null;
}

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}

 function togglepickup(){
	len = document.frmReserve.cbopickup.length
	i=0
	chosen = "none"

	for(i=0;i<len;i++) {
		if(document.frmReserve.cbopickup[i].selected) {
			chosen=document.frmReserve.cbopickup[i].value
			}
		}

		return chosen
	}

function numbersonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("0123456789").indexOf(keychar) > -1))
		return true;
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function OnFocusPhone()
{
	var str = document.frmReserve.txtPhone.value;
	str = str.replace("(","");
	str = str.replace(")","");
	str = str.replace("-","");
	str = str.replace(" ","");
	document.frmReserve.txtPhone.value = str;
}

function nameonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ,").indexOf(keychar) > -1))
		return true;
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function emailonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@_.,").indexOf(keychar) > -1))
		return true;
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function arrfromonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ").indexOf(keychar) > -1))
		return true;
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function fromflightonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
		return true;
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function fromairportinstonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
	{
		if(document.frmReserve.txtfromAirportSpeciaInstr.value.length<200)
			return true;
		else
			return false;
	}
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function fromaddronly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("0123456789#, .-/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
		return true;
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function fromcityonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if (((" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
		return true;
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function fromziponly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("0123456789").indexOf(keychar) > -1))
		return true;
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function fromaddrinstonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("#,-/0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
	{
		if(document.frmReserve.txtfromAddrSpeciaInstr.value.length<200)
			return true;
		else
			return false;
	}
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function todepartonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if (((" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
		return true;
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function toflightonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
		return true;
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function tospecinstonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("0123456789#,-/. ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
	{
		if(document.frmReserve.txtToAirportSpeciaInstr.value.length<200)
			return true;
		else
			return false;
	}
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function toaddronly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("#,-/.0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
		return true;
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function tocityonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if (((" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
		return true;
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function toaddinstonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("#,-/.0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
	{
		if(document.frmReserve.txtToAddrSpeciaInstr.value.length<200)
			return true;
		else
			return false;
	}
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}

function txtgeneralonly(myfield, e, dec)
{
	var key;
	var keychar;
	if (window.event)
		key = window.event.keyCode;
	else if (e)
		key = e.which;
	else
		return true;
	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) || 	(key==9) || (key==13) || (key==27) )
		return true;
	// numbers
	else if ((("0123456789#,-/.~!@#$%^&*()_+|?><:;{}[] ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
	{
		if(document.frmReserve.txtGeneralInstr.value.length<200)
			return true;
		else
			return false;
	}
	// decimal point jump
	else if (dec && (keychar == "."))
	{
		myfield.form.elements[dec].focus();
		return false;
	}
	else
		return false;
}