function LTrim(str)
{
   var whitespace = new String(" \t\n\r");
   var s = new String(str);

   if (whitespace.indexOf(s.charAt(0)) != -1) {
      var j=0, i = s.length;
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;
      s = s.substring(j, i);
   }
   return s;
}

function RTrim(str)
{
   var whitespace = new String(" \t\n\r");
   var s = new String(str);

   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
			var i = s.length - 1;       
			while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
      	i--;
			s = s.substring(0, i+1);
   }
	return s;
}

function Trim(str)
{
   return RTrim(LTrim(str));
}

function checkCID() 
{
	Msg=tMsg1;
	if (document.searchform.CID.value=="") {block=1;alert(Msg);document.searchform.CID.focus();return false;}			
	return true;
}

function dataValidationC()
{
	Msg=tMsg2;
	Msg2=tMsg3;	
	if (document.payment.FName.value=="") {alert(Msg);document.payment.FName.focus();return false;}	
	else if (document.payment.LName.value=="") {alert(Msg);document.payment.LName.focus();return false;}
	else if (trFlag=="1")
		{
		if (Trim(document.payment.AHour.value)=="") {alert(Msg);document.payment.AHour.focus();return false;}
		else if (Trim(document.payment.AMin.value)=="") {alert(Msg);document.payment.AMin.focus();return false;}
		else if (Trim(document.payment.arAirport2.value)=="") {alert(Msg);document.payment.arAirport2.focus();return false;}
		else if (Trim(document.payment.arAirport.value)=="") {alert(Msg);document.payment.arAirport.focus();return false;}
		else if (Trim(document.payment.arAirline.value)=="") {alert(Msg);document.payment.arAirline.focus();return false;}
		else if (Trim(document.payment.arFlight.value)=="") {alert(Msg);document.payment.arFlight.focus();return false;}
		
		}
	else if (trFlag=="2")
		{
		if (Trim(document.payment.DHour.value)=="") {alert(Msg);document.payment.DHour.focus();return false;}
		else if (Trim(document.payment.DMin.value)=="") {alert(Msg);document.payment.DMin.focus();return false;}
		else if (Trim(document.payment.deAirport.value)=="") {alert(Msg);document.payment.deAirport.focus();return false;}
		else if (Trim(document.payment.deAirport2.value)=="") {alert(Msg);document.payment.deAirport2.focus();return false;}
		else if (Trim(document.payment.deAirline.value)=="") {alert(Msg);document.payment.deAirline.focus();return false;}
		else if (Trim(document.payment.deFlight.value)=="") {alert(Msg);document.payment.deFlight.focus();return false;}

		}
	else if (trFlag=="3")
		{
		if (Trim(document.payment.AHour.value)=="") {alert(Msg);document.payment.AHour.focus();return false;}
		else if (Trim(document.payment.AMin.value)=="") {alert(Msg);document.payment.AMin.focus();return false;}
		else if (Trim(document.payment.arAirport2.value)=="") {alert(Msg);document.payment.arAirport2.focus();return false;}
		else if (Trim(document.payment.arAirport.value)=="") {alert(Msg);document.payment.arAirport.focus();return false;}
		else if (Trim(document.payment.arAirline.value)=="") {alert(Msg);document.payment.arAirline.focus();return false;}
		else if (Trim(document.payment.arFlight.value)=="") {alert(Msg);document.payment.arFlight.focus();return false;}
		else if (Trim(document.payment.DHour.value)=="") {alert(Msg);document.payment.DHour.focus();return false;}
		else if (Trim(document.payment.DMin.value)=="") {alert(Msg);document.payment.DMin.focus();return false;}
		else if (Trim(document.payment.deAirport.value)=="") {alert(Msg);document.payment.deAirport.focus();return false;}
		else if (Trim(document.payment.deAirport2.value)=="") {alert(Msg);document.payment.deAirport2.focus();return false;}
		else if (Trim(document.payment.deAirline.value)=="") {alert(Msg);document.payment.deAirline.focus();return false;}
		else if (Trim(document.payment.deFlight.value)=="") {alert(Msg);document.payment.deFlight.focus();return false;}
	
		}
	if (Trim(document.payment.SpLoc.value)=="") {alert(Msg);document.payment.SpLoc.focus();return false;}
	if (Trim(document.payment.Phone.value)=="") {alert(Msg);document.payment.Phone.focus();return false;}
	if (Trim(document.payment.Mobile.value)=="") {alert(Msg);document.payment.Mobile.focus();return false;}
	if (Trim(document.payment.Email.value)=="") {alert(Msg);document.payment.Email.focus();return false;}
	if (Trim(document.payment.CCType.value)=="") {alert(Msg);document.payment.CCType.focus();return false;}
	if (Trim(document.payment.CCHolder.value)=="") {alert(Msg);document.payment.CCHolder.focus();return false;}
	if (Trim(document.payment.CCExpiredM.value)=="") {alert(Msg);document.payment.CCExpiredM.focus();return false;}
	if (Trim(document.payment.CCExpiredY.value)=="") {alert(Msg);document.payment.CCExpiredY.focus();return false;}
	if (Trim(document.payment.CCNumber.value)=="") {alert(Msg);document.payment.CCNumber.focus();return false;}		
	if (Trim(document.payment.CCSecCode.value)=="") {alert(Msg);document.payment.CCSecCode.focus();return false;}	
	if (Trim(document.payment.CCBillAddress.value)=="") {alert(Msg);document.payment.CCBillAddress.focus();return false;}	
	if (Trim(document.payment.CCBillPCode.value)=="") {alert(Msg);document.payment.CCBillPCode.focus();return false;}	
	if (Trim(document.payment.CCBillCity.value)=="") {alert(Msg);document.payment.CCBillCity.focus();return false;}	
	if (document.payment.bookcont.checked == false){alert(Msg2);document.payment.bookcont.focus();return false;}		
}

function dataValidationC2()
{
	Msg=tMsg2;
	Msg2=tMsg3;	
	Msg3=tMsg4;
	if (document.payment.FName.value=="") {alert(Msg);document.payment.FName.focus();return false;}	
	else if (document.payment.LName.value=="") {alert(Msg);document.payment.LName.focus();return false;}
	else if (trFlag=="1")
		{
		if (Trim(document.payment.AHour.value)=="") {alert(Msg);document.payment.AHour.focus();return false;}
		else if (Trim(document.payment.AMin.value)=="") {alert(Msg);document.payment.AMin.focus();return false;}
		else if (Trim(document.payment.arAirport2.value)=="") {alert(Msg);document.payment.arAirport2.focus();return false;}
		else if (Trim(document.payment.arAirport.value)=="") {alert(Msg);document.payment.arAirport.focus();return false;}
		else if (Trim(document.payment.arAirline.value)=="") {alert(Msg);document.payment.arAirline.focus();return false;}
		else if (Trim(document.payment.arFlight.value)=="") {alert(Msg);document.payment.arFlight.focus();return false;}
		
		}
	else if (trFlag=="2")
		{
		if (Trim(document.payment.DHour.value)=="") {alert(Msg);document.payment.DHour.focus();return false;}
		else if (Trim(document.payment.DMin.value)=="") {alert(Msg);document.payment.DMin.focus();return false;}
		else if (Trim(document.payment.deAirport.value)=="") {alert(Msg);document.payment.deAirport.focus();return false;}
		else if (Trim(document.payment.deAirport2.value)=="") {alert(Msg);document.payment.deAirport2.focus();return false;}
		else if (Trim(document.payment.deAirline.value)=="") {alert(Msg);document.payment.deAirline.focus();return false;}
		else if (Trim(document.payment.deFlight.value)=="") {alert(Msg);document.payment.deFlight.focus();return false;}

		}
	else if (trFlag=="3")
		{
		if (Trim(document.payment.AHour.value)=="") {alert(Msg);document.payment.AHour.focus();return false;}
		else if (Trim(document.payment.AMin.value)=="") {alert(Msg);document.payment.AMin.focus();return false;}
		else if (Trim(document.payment.arAirport2.value)=="") {alert(Msg);document.payment.arAirport2.focus();return false;}
		else if (Trim(document.payment.arAirport.value)=="") {alert(Msg);document.payment.arAirport.focus();return false;}
		else if (Trim(document.payment.arAirline.value)=="") {alert(Msg);document.payment.arAirline.focus();return false;}
		else if (Trim(document.payment.arFlight.value)=="") {alert(Msg);document.payment.arFlight.focus();return false;}
		else if (Trim(document.payment.DHour.value)=="") {alert(Msg);document.payment.DHour.focus();return false;}
		else if (Trim(document.payment.DMin.value)=="") {alert(Msg);document.payment.DMin.focus();return false;}
		else if (Trim(document.payment.deAirport.value)=="") {alert(Msg);document.payment.deAirport.focus();return false;}
		else if (Trim(document.payment.deAirport2.value)=="") {alert(Msg);document.payment.deAirport2.focus();return false;}
		else if (Trim(document.payment.deAirline.value)=="") {alert(Msg);document.payment.deAirline.focus();return false;}
		else if (Trim(document.payment.deFlight.value)=="") {alert(Msg);document.payment.deFlight.focus();return false;}
	
		}
	if (Trim(document.payment.SpLoc.value)=="") {alert(Msg);document.payment.SpLoc.focus();return false;}
	if (Trim(document.payment.ChildAge.value)=="") {alert(Msg3);document.payment.ChildAge.focus();return false;}
	if (Trim(document.payment.Phone.value)=="") {alert(Msg);document.payment.Phone.focus();return false;}
	if (Trim(document.payment.Mobile.value)=="") {alert(Msg);document.payment.Mobile.focus();return false;}
	if (Trim(document.payment.Email.value)=="") {alert(Msg);document.payment.Email.focus();return false;}
	if (Trim(document.payment.CCType.value)=="") {alert(Msg);document.payment.CCType.focus();return false;}
	if (Trim(document.payment.CCHolder.value)=="") {alert(Msg);document.payment.CCHolder.focus();return false;}
	if (Trim(document.payment.CCExpiredM.value)=="") {alert(Msg);document.payment.CCExpiredM.focus();return false;}
	if (Trim(document.payment.CCExpiredY.value)=="") {alert(Msg);document.payment.CCExpiredY.focus();return false;}
	if (Trim(document.payment.CCNumber.value)=="") {alert(Msg);document.payment.CCNumber.focus();return false;}		
	if (Trim(document.payment.CCSecCode.value)=="") {alert(Msg);document.payment.CCSecCode.focus();return false;}	
	if (Trim(document.payment.CCBillAddress.value)=="") {alert(Msg);document.payment.CCBillAddress.focus();return false;}	
	if (Trim(document.payment.CCBillPCode.value)=="") {alert(Msg);document.payment.CCBillPCode.focus();return false;}	
	if (Trim(document.payment.CCBillCity.value)=="") {alert(Msg);document.payment.CCBillCity.focus();return false;}	
	if (document.payment.bookcont.checked == false){alert(Msg2);document.payment.bookcont.focus();return false;}		
}

function dataValidationA()
{
	Msg=tMsg2;
	Msg2=tMsg3;	
	if (document.payment.FName.value=="") {alert(Msg);document.payment.FName.focus();return false;}	
	else if (document.payment.LName.value=="") {alert(Msg);document.payment.LName.focus();return false;}
	else if (trFlag=="1")
		{
		if (document.payment.AHour.value=="") {alert(Msg);document.payment.AHour.focus();return false;}
		else if (document.payment.AMin.value=="") {alert(Msg);document.payment.AMin.focus();return false;}
		else if (document.payment.arAirport.value=="") {alert(Msg);document.payment.arAirport.focus();return false;}
		else if (document.payment.arAirline.value=="") {alert(Msg);document.payment.arAirline.focus();return false;}
		else if (document.payment.arFlight.value=="") {alert(Msg);document.payment.arFlight.focus();return false;}
		
		}
	else if (trFlag=="2")
		{
		if (document.payment.DHour.value=="") {alert(Msg);document.payment.DHour.focus();return false;}
		else if (document.payment.DMin.value=="") {alert(Msg);document.payment.DMin.focus();return false;}
		else if (document.payment.deAirport.value=="") {alert(Msg);document.payment.deAirport.focus();return false;}
		else if (document.payment.deAirline.value=="") {alert(Msg);document.payment.deAirline.focus();return false;}
		else if (document.payment.deFlight.value=="") {alert(Msg);document.payment.deFlight.focus();return false;}
		
		}
	else if (trFlag=="3")
		{
		if (document.payment.AHour.value=="") {alert(Msg);document.payment.AHour.focus();return false;}
		else if (document.payment.AMin.value=="") {alert(Msg);document.payment.AMin.focus();return false;}
		else if (document.payment.arAirport.value=="") {alert(Msg);document.payment.arAirport.focus();return false;}
		else if (document.payment.arAirline.value=="") {alert(Msg);document.payment.arAirline.focus();return false;}		
		else if (document.payment.arFlight.value=="") {alert(Msg);document.payment.arFlight.focus();return false;}
		else if (document.payment.DHour.value=="") {alert(Msg);document.payment.DHour.focus();return false;}
		else if (document.payment.DMin.value=="") {alert(Msg);document.payment.DMin.focus();return false;}
		else if (document.payment.deAirport.value=="") {alert(Msg);document.payment.deAirport.focus();return false;}
		else if (document.payment.deAirline.value=="") {alert(Msg);document.payment.deAirline.focus();return false;}
		else if (document.payment.deFlight.value=="") {alert(Msg);document.payment.deFlight.focus();return false;}
	
		}
	if (document.payment.SpLoc.value=="") {alert(Msg);document.payment.SpLoc.focus();return false;}
	if (document.payment.bookcont.checked == false){alert(Msg2);document.payment.bookcont.focus();return false;}		
}
function checkAddArTr() 
{
    if (document.payment.arAdd.checked==true)
	{ 
		document.getElementById("arR0").style.visibility = "visible";
		document.getElementById("arR0").style.display = "block";
	}	
	else
	{
	  document.getElementById("arR0").style.display= "none";
	}   
}		
function checkAddDeTr() 
{
    if (document.payment.deAdd.checked==true)
	{ 
		document.getElementById("deR0").style.visibility = "visible";
		document.getElementById("deR0").style.display = "block";
	}	
	else
	{
	  document.getElementById("deR0").style.display= "none";
	}   

}

function dataModValidation()
{
	Msg=tMsg2;
	if (document.payment.FName.value=="") {alert(Msg);document.payment.FName.focus();return false;}	
	else if (document.payment.LName.value=="") {alert(Msg);document.payment.LName.focus();return false;}
	else if (document.payment.arAdd.checked==true)
		{
		if (document.payment.AHour.value=="") {alert(Msg);document.payment.AHour.focus();return false;}
		else if (document.payment.AMin.value=="") {alert(Msg);document.payment.AMin.focus();return false;}
		else if (document.payment.arAirport.value=="") {alert(Msg);document.payment.arAirport.focus();return false;}
		else if (document.payment.arFlight.value=="") {alert(Msg);document.payment.arFlight.focus();return false;}
		
		}
	else if (document.payment.deAdd.checked==true)
		{
		if (document.payment.DHour.value=="") {alert(Msg);document.payment.DHour.focus();return false;}
		else if (document.payment.DMin.value=="") {alert(Msg);document.payment.DMin.focus();return false;}
		else if (document.payment.deAirport.value=="") {alert(Msg);document.payment.deAirport.focus();return false;}
		else if (document.payment.deFlight.value=="") {alert(Msg);document.payment.deFlight.focus();return false;}
		
		}
	
}

function CheckValues()
{
	Msg=tMsg2;
	if (document.newsletter.Name.value=="") {alert(Msg);document.newsletter.Name.focus();return false;}	
	if (document.newsletter.Email.value=="") {alert(Msg);document.newsletter.Email.focus();return false;}
}


