
var firstCal;
var firstCallLeft;
firstCal=1;
firstCallLeft=1;
var FfirstCal=1;
var FfirstCallLeft=1;
var FHfirstCal=1;
var FHfirstCallLeft=1;

var HfirstCal=1;
var HfirstCallLeft=1;
var setvalidDD;
var setvalidRR;
var strDayName="";
//------------------------------------------------submit validation for different submit pages-------------

function setDMY(num)
{
	if(num=='FH')
		{
			setDatMonYearFH(document.FltHtlSearch.FHDptDateDDMMYY,document.FltHtlSearch.FHDayMonth,document.FltHtlSearch.FHDptMon,document.FltHtlSearch.FHDptDate,document.FltHtlSearch.FHDptMonYr,document.FltHtlSearch.FHRetDateDDMMYY,document.FltHtlSearch.FHDayMonthRet,document.FltHtlSearch.FHRetMon,document.FltHtlSearch.FHRetDate,document.FltHtlSearch.FHRetMonYr,document.FltHtlSearch.FHDptMonthName,document.FltHtlSearch.FHRetMonthName);
		}
		if(num=='F')
		{
		setDatMonYear(document.FlightSearch.FDptDateDDMMYY,document.FlightSearch.FDayMonth,document.FlightSearch.FDptMon,document.FlightSearch.FDptDate,document.FlightSearch.FDptMonYr,document.FlightSearch.FRetDateDDMMYY,document.FlightSearch.FDayMonthRet,document.FlightSearch.FRetMon,document.FlightSearch.FRetDate,document.FlightSearch.FRetMonYr,document.FlightSearch.FDptMonthName,document.FlightSearch.FRetMonthName);
		}
		if(num=='H')
		{
		setDatMonYear2(document.HotelSearch.HDptDateDDMMYY,document.HotelSearch.HDayMonth,document.HotelSearch.HDptMon,document.HotelSearch.HDptDate,document.HotelSearch.HDptMonYr,document.HotelSearch.HRetDateDDMMYY,document.HotelSearch.HDayMonthRet,document.HotelSearch.HRetMon,document.HotelSearch.HRetDate,document.HotelSearch.HRetMonYr,document.HotelSearch.HDptMonthName,document.HotelSearch.HRetMonthName);
		}
}



function setDatMonYear(DptDateDDMMYY,DptYr,DptMon,DptDate,DptMonYr,RetDateDDMMYY,RetYr,RetMon,RetDate,RetMonYr,DptMonName,RetMonName)
{
	var DepMMYY="";
	var RetMMYY="";
	var Dep=document.getElementById(DptDateDDMMYY.id).value;
	var day=document.getElementById(DptYr.id).value;//Depdate[0];
	var year=Dep.substring(2)//Depdate[2];
	var mon=Dep.substring(0,2)//Depdate[1];
	monn=parseInt(mon);
	var monName=getMonthNameString(monn);
	//document.getElementById(DptYr.id).options[monn].selected=true;
	var Ret=document.getElementById(RetDateDDMMYY.id).value;//
	var Ret2="";
	Ret2= document.getElementById("JType").value;
	if(Ret=="00" || Ret2=="1")
	{
	        var year1=Dep.substring(2)
	        var mon1=Dep.substring(0,2)
	        var day1=document.getElementById(DptDate.id).value;
	}
	else
	{
	        var year1=Ret.substring(2)
	        var mon1=Ret.substring(0,2)
	        var day1=document.getElementById(RetYr.id).value;
	}	
    monnn=parseInt(mon1);
    var monName1=getMonthNameString(monnn);
    	if(mon<=11)
		{
		
		DepMMYY=mon+year;
		if(day<10)
		{
		day="0"+day;
		}
		document.getElementById(DptDate.id).value=day;
		document.getElementById(DptMonYr.id).value=DepMMYY;
		}
		else
		{
		DepMMYY=mon+year;
		document.getElementById(DptDate.id).value=day;
		document.getElementById(DptMonYr.id).value=DepMMYY;
		}
		//document.getElementById(DptYr.id).value=year;
		document.getElementById(DptMon.id).value=mon;
	
	if(mon1<=12)
		{
		    RetMMYY=mon1+year1;
		        	if(Ret=="00" || Ret2=="1")
		        {
		        document.getElementById(RetDate.id).value=day;
		        }
		        else
		        {
		             if(day1<10)
		             {       
		                day1="0"+day1;
		             }
		             document.getElementById(RetDate.id).value=day1
		        }
		        document.getElementById(RetMonYr.id).value=RetMMYY;
	    }
		else
		{
		RetMMYY=mon1+year1
		document.getElementById(RetDate.id).value=day1
		document.getElementById(RetMonYr.id).value=RetMMYY;
		}
		document.getElementById(RetMon.id).value=mon1;
		
}






//only hotel date validation
function setDatMonYear2(DptDateDDMMYY,DptYr,DptMon,DptDate,DptMonYr,RetDateDDMMYY,RetYr,RetMon,RetDate,RetMonYr,DptMonName,RetMonName)
{
	var DepMMYY="";
	var RetMMYY="";
	var Dep=document.getElementById(DptDateDDMMYY.id).value;
	var day=document.getElementById(DptYr.id).value;//Depdate[0];
	var year=Dep.substring(2)//Depdate[2];
//	var mon=parseInt(Dep.substring(0,2))-1//Depdate[1];
//	monn=parseInt(mon);
	
	var mon
	if (Dep.substring(0,1)==0)
	{
	mon=parseInt(Dep.substring(1,2))-1
	}
	else
	{
	mon=parseInt(Dep.substring(0,2))-1
	}
	monn=parseInt(mon);
	
	
	var monName=getMonthNameString(monn);
	//document.getElementById(DptYr.id).options[monn].selected=true;
	
	
	var Ret=document.getElementById(RetDateDDMMYY.id).value;//
	var mon1
	if (Ret.substring(0,1)==0)
	{
	mon1=parseInt(Ret.substring(1,2))-1
	}
	else
	{
	mon1=parseInt(Ret.substring(0,2))-1
	}
	        var year1=Ret.substring(2)
	       // var mon1=parseInt(Ret.substring(0,2))-1
	        var day1=document.getElementById(RetYr.id).value;
    monnn=parseInt(mon1);
    var monName1=getMonthNameString(monnn);
    if (mon<10)
    {
    mon="0"+mon;
    }
    if (mon1<10)
    {
    mon1="0"+mon1;
    }
	if(mon<=11)
		{
		
		DepMMYY=mon+year;
		if(day<10)
		{
		day="0"+day;
		}
		document.getElementById(DptDate.id).value=day;
		document.getElementById(DptMonYr.id).value=DepMMYY;
		}
		else
		{
		DepMMYY=mon+year;
		document.getElementById(DptDate.id).value=day;
		document.getElementById(DptMonYr.id).value=DepMMYY;
		}
		document.getElementById(DptMon.id).value=monn+1;
	
	if(mon1<=12)
		{
		    RetMMYY=mon1+year1;
		        	
		       
		             if(day1<10)
		             {       
		                day1="0"+day1;
		             }
		             document.getElementById(RetDate.id).value=day1
		       
		        document.getElementById(RetMonYr.id).value=RetMMYY;
	    }
		else
		{
		RetMMYY=mon1+year1
		document.getElementById(RetDate.id).value=day1
		document.getElementById(RetMonYr.id).value=RetMMYY;
		}
			document.getElementById(RetMon.id).value=monnn+1;
		
}

function setDatMonYearFH(DptDateDDMMYY,DptYr,DptMon,DptDate,DptMonYr,RetDateDDMMYY,RetYr,RetMon,RetDate,RetMonYr,DptMonName,RetMonName)
{
	var DepMMYY="";
	var RetMMYY="";
	var Dep=document.getElementById(DptDateDDMMYY.id).value;
	var day=document.getElementById(DptYr.id).value;//Depdate[0];
	var year=Dep.substring(2)//Depdate[2];
	var mon
	if (Dep.substring(0,1)==0)
	{
	mon=parseInt(Dep.substring(1,2))-1
	}
	else
	{
	mon=parseInt(Dep.substring(0,2))-1
	}//Depdate[1];
	monn=parseInt(mon);
	var monName=getMonthNameString(monn);
	//document.getElementById(DptYr.id).options[monn].selected=true;
	var Ret=document.getElementById(RetDateDDMMYY.id).value;//
	var mon1
	if (Ret.substring(0,1)==0)
	{
	mon1=parseInt(Ret.substring(1,2))-1
	}
	else
	{
	mon1=parseInt(Ret.substring(0,2))-1
	}
	
	        var year1=Ret.substring(2)
	         var day1=document.getElementById(RetYr.id).value;
    monnn=parseInt(mon1);
    var monName1=getMonthNameString(monnn);
    if (mon<10)
    {
    mon="0"+mon;
    }
    if (mon1<10)
    {
    mon1="0"+mon1;
    }
	if(mon<=11)
		{
		
		DepMMYY=mon+year;
		if(day<10)
		{
		day="0"+day;
		}
		document.getElementById(DptDate.id).value=day;
		document.getElementById(DptMonYr.id).value=DepMMYY;
		}
		else
		{
		DepMMYY=mon+year;
		document.getElementById(DptDate.id).value=day;
		document.getElementById(DptMonYr.id).value=DepMMYY;
		}
		document.getElementById(DptMon.id).value=monn+1;
	
	if(mon1<=12)
		{
		    RetMMYY=mon1+year1;
		        	
		       
		             if(day1<10)
		             {       
		                day1="0"+day1;
		             }
		             document.getElementById(RetDate.id).value=day1
		       
		        document.getElementById(RetMonYr.id).value=RetMMYY;
	    }
		else
		{
		RetMMYY=mon1+year1
		document.getElementById(RetDate.id).value=day1
		document.getElementById(RetMonYr.id).value=RetMMYY;
		}
			document.getElementById(RetMon.id).value=monnn+1;
		
}
//end here

//FLight Hotel validation 

function fHValidateSearch() //for flight page fHValidateSearch
{


	        if(document.FltHtlSearch.FHDestFrom.value.toUpperCase()=="PLEASE ENTER DEPARTURE AIRPORT" || document.FltHtlSearch.FHDestFrom.value.toUpperCase()=="NO MATCH FOUND" || document.FltHtlSearch.FHDestFrom.value.length<3)
			{
			alert("Enter atleast three characters of departure airport Code or name and select desired departure airport.");
			document.FltHtlSearch.FHDestFrom.focus();
			return false;
			}
			
			if(document.FltHtlSearch.FHDestTo.value.toUpperCase()=="PLEASE ENTER ARRIVAL AIRPORT" || document.FltHtlSearch.FHDestTo.value.toUpperCase()=="NO MATCH FOUND" || document.FltHtlSearch.FHDestTo.value.length<3)
			{
				alert("Enter atleast three characters of arrival airport Code or name and select desired arrival airport.")
				document.FltHtlSearch.FHDestTo.focus();
				return false;
			}
                if(validDest(document.FltHtlSearch.FHDestFrom)==false)
                {
                alert('Please Enter a valid "From Destination" value');
                document.FltHtlSearch.FHDestFrom.value="";
                document.FltHtlSearch.FHDestFrom.focus();
                return false;
                }

                if(validDest(document.FltHtlSearch.FHDestTo)==false)
                {
                alert('Please Enter a valid "City break to:" value');
                document.FltHtlSearch.FHDestTo.value="";
                document.FltHtlSearch.FHDestTo.focus();
                return false;
                }
				
			if(document.FltHtlSearch.FHDestFrom.value==document.FltHtlSearch.FHDestTo.value)
			{
				alert(" Departure Airport and Destination Airport can't be same");
				document.FltHtlSearch.FHDestTo.focus();
				return false;
			}
		if(fHDateValidation()==false)
			{
			return false;
			}	
			
			if (FlightHotelSearch()==false)
			{
			return false;
			}	
		
return true;
}



function fHDateValidation()
{

	var CurDate= new Date(document.FltHtlSearch.hFHBookYr.value, document.FltHtlSearch.hFHBookMon.value, document.FltHtlSearch.hFHBookDD.value);
	var Dptdate= new Date(document.FltHtlSearch.FHDptMonYr.value.substr(2,4), document.FltHtlSearch.FHDptMonYr.value.substr(0,2), document.FltHtlSearch.FHDptDate.value);
	var retDate= new Date(document.FltHtlSearch.FHRetMonYr.value.substr(2,4), document.FltHtlSearch.FHRetMonYr.value.substr(0,2), document.FltHtlSearch.FHRetDate.value);
//To Check the Valid Depart Dates

		if(validDate(document.FltHtlSearch.FHDptMonYr.value.substr(2,4), document.FltHtlSearch.FHDptMonYr.value.substr(0,2), document.FltHtlSearch.FHDptDate.value)==false)
		{
		alert("Please Select the Valid Depart date");
		document.FltHtlSearch.FHDptDateDDMMYY.focus();
		return false;
		}

//To Check the Valid Return Date
//remove by sachine
//		if(validDate(document.FltHtlSearch.FHRetMonYr.value.substr(2,4), document.FltHtlSearch.FHRetMonYr.value.substr(0,2), document.FltHtlSearch.FHRetDate.value)==false)
//		{
//		alert("Please Select the Valid Return date");
//		document.FltHtlSearch.FHRetDateDDMMYY.focus();
//		return false;
//		}
//till here

//To check Depart Date is not Less than the Current Date
		var DD=new Date();
		var D =new Date(DD.getFullYear(),DD.getMonth(),DD.getDate()+2);
		//var D = new Date(document.FltHtlSearch.hFHBookYr.value, document.FltHtlSearch.hFHBookMon.value, eval(document.FltHtlSearch.hFHBookDD.value) + 1);
		if(Dptdate<=D)
		{			
		alert("IF DEPARTURE IS WITHIN 72 HOURS, PLEASE CONTACT OUR RESERVATIONS DEPARTMENT ON 0800 368 0300");
		document.FltHtlSearch.FHDptDateDDMMYY.focus();
		return false;
		}
//To Check the Return Date is greater Than the Depart Date

		if(retDate<=Dptdate)
		{
		alert("Return Date Must be greater than Depart date");
		document.FltHtlSearch.FHRetDateDDMMYY.focus();
		return false;
}
			
}
//room and no. of person validation
function FlightHotelSearch()  //return for flthtlsearch.aspx 
{
		var adValue,twValue,doValue,siValue,triValue,total;
		adValue=new Number(document.FltHtlSearch.FHAdult.value);
		chValue=new Number(document.FltHtlSearch.FHChild.value);
		invalue=new Number(document.FltHtlSearch.FHInfant.value);
		siValue=new Number(document.FltHtlSearch.FHSngRoom.value);
		twValue=new Number(document.FltHtlSearch.FHTwnRoom.value);
		doValue=new Number(document.FltHtlSearch.FHDblRoom.value);
		triValue=new Number(document.FltHtlSearch.FHTplRoom.value);
		
		twValue=twValue*2
		doValue=doValue*2
		triValue=triValue*3
		total=(twValue+doValue+siValue+triValue)
		if(adValue == 0)
			{
			alert("Invalid Room Selection.")
			document.FltHtlSearch.FHAdult.focus();
			return false;
			}
			else if (chValue==0 && invalue==0)
			{
			if(total!=adValue)
				{
				alert("Invalid Room Selection.")
				document.FltHtlSearch.FHAdult.focus();
				return false;
				}
			}
			else if (chValue>0 && invalue==0)
			{ 
			var adchtotal=chValue+adValue
				if (adchtotal>9)
  				{
				alert("Total no of person should not be more than 9")
				document.FltHtlSearch.FHAdult.focus();
				return false;
				}
				
				if ((doValue==adValue || twValue==adValue || (twValue+doValue)==adValue || total==adValue ) && chValue<=adValue/2 )
				{
				if (total!=adValue )
					{
					alert("Invalid Room Selection.")
					document.FltHtlSearch.FHAdult.focus();
					return false;
					}
				}
				else if (total!=adchtotal)
 	 			{
				alert("Invalid Room Selection.")
				document.FltHtlSearch.FHAdult.focus();
				return false;
    	     	}
			}
			else if (chValue==0 && invalue>0)
			{
			var inadtotal=invalue+adValue
  			if (inadtotal>9)
  				{
				alert("Total no of person should not be more than 9")
				document.FltHtlSearch.FHAdult.focus();
				return false;
  				}

				if (invalue>adValue)
			  	{
				alert("Number of infants should be equal to or less then number of adults")
				document.FltHtlSearch.FHAdult.focus();
				return false;
			  	}
				else if(total!=adValue)
				{
				alert("Invalid Room Selection.")
				document.FltHtlSearch.FHAdult.focus();
				return false;
				}
			}
			else if (chValue>0 && invalue>0)
			{
			var chinadtotal=invalue+adValue+chValue
			if (chinadtotal>9)
  				{
				alert("Total no of person should not be more than 9")
				document.FltHtlSearch.FHAdult.focus();
				return false;
               }
			   
			if (invalue>adValue)
  				{
				alert("Number of infants should be equal to or less then number of adults")
				document.FltHtlSearch.FHAdult.focus();
				return false;
  				}


			if ((doValue==adValue || twValue==adValue || (twValue+doValue)==adValue || total==adValue) && chValue<=adValue/2 && invalue<=adValue)
				{
				if (total!=adValue )
					{
					alert("Invalid Room Selection.")
					document.FltHtlSearch.FHAdult.focus();
					return false;
					}
				}

		 if(total!=adValue+chValue)
				{
				alert("Invalid Room Selection.")
				document.FltHtlSearch.FHAdult.focus();
				return false;
				}
		}	

}

//end of validation

function fHDateValidationFltSearch(){

	var CurDate= new Date(document.FltHtlSearch.FHBookYr.value, document.FltHtlSearch.FHBookMon.value, document.FltHtlSearch.FHBookDD.value);
	var Dptdate= new Date(document.FltHtlSearch.FHDptMonYr.value.substring(2,7), document.FltHtlSearch.FHDptMonYr.value.substring(0,2), document.FltHtlSearch.FHdptDate.value);
    var retDate= new Date(document.OnlineSearch.RetMonYr.value.substring(2,7), document.OnlineSearch.RetMonYr.value.substring(0,2), document.OnlineSearch.retDate.value);
//To Check the Valid Depart Dates

		if(validDate(document.FltHtlSearch.FHDptMonYr.value.substring(2,7), document.FltHtlSearch.FHDptMonYr.value.substring(0,2), document.FltHtlSearch.FHdptDate.value)==false)
		{
		alert("Please Select the Valid Depart date");
		document.FltHtlSearch.FHDptDateDDMMYY.focus();
		return false;
		}
//To check Depart Date is not Less than the Current Date

		if(Dptdate<=CurDate)
		{
		alert("Depart Date Must be greater than Current date");
		document.FltHtlSearch.FHDptDateDDMMYY.focus();
		return false;
		}
}


//End of Flight Hotel Validation
//==========================================================================================================================

//=======================================================================================================
//FLight form validation 
function fValidateSearch() //
{

//anju
		if(document.FlightSearch.FDestFrom.value.toUpperCase()=="PLEASE ENTER DEPARTURE AIRPORT" || document.FlightSearch.FDestFrom.value.toUpperCase()=="NO MATCH FOUND" || document.FlightSearch.FDestFrom.value.length<3)
			{
			alert("Enter atleast three characters of departure airport Code or name and select desired departure airport.");
			document.FlightSearch.FDestFrom.focus();
			return false;
			}
			
			if(document.FlightSearch.FDestTo.value.toUpperCase()=="PLEASE ENTER YOUR DESTINATION" || document.FlightSearch.FDestTo.value.toUpperCase()=="NO MATCH FOUND" || document.FlightSearch.FDestTo.value.length<3)
			{
				alert("Enter atleast three characters of arrival airport Code or name and select desired arrival airport.")
				document.FlightSearch.FDestTo.focus();
				return false;
			}
				
                if(validDest(document.FlightSearch.FDestFrom)==false)
                {
                alert('Please Enter a valid "From Destination" value');
                document.FlightSearch.FDestFrom.value="";
                document.FlightSearch.FDestFrom.focus();
                return false;
                }

                if(validDest(document.FlightSearch.FDestTo)==false)
                {
                alert('Please Enter a valid "Going To:" value');
                document.FlightSearch.FDestTo.value="";
                document.FlightSearch.FDestTo.focus();
                return false;
                }
				
				

		if(document.FlightSearch.FDestFrom.value==document.FlightSearch.FDestTo.value)
			{
				alert(" Departure Airport and Destination Airport can't be same");
				document.FlightSearch.FDestTo.focus();
				return false;
			}

	
	var Adult,child,Infant,total
	Adult=new Number(document.FlightSearch.FAdult.value)
	try
	{
	child=new Number(document.FlightSearch.FChild.value)
	Infant=new Number(document.FlightSearch.FInfant.value)
	}
	catch(e)
	{
	}
	total=(Adult+child+Infant)
	if (Infant > Adult) 
	{
	alert("Number of infants should be equal to or less then number of adults")
	return false;
	}
	
	if(total>9)
	{
	alert("Total no of person should not be more than 9")
	return false;
	}
	
	if(fDateValidation()==false)
	{
	return false;
	}	
	
return true;
}


function fDateValidation()
{
	currDate=new Date();
	var CurDate= new Date(document.FlightSearch.hFBookYr.value, document.FlightSearch.hFBookMon.value, document.FlightSearch.hFBookDD.value);
	var Dptdate= new Date(document.FlightSearch.FDptMonYr.value.substr(2,4), (document.FlightSearch.FDptMonYr.value.substr(0,2)-1), document.FlightSearch.FDptDate.value);
	var retDate= new Date(document.FlightSearch.FRetMonYr.value.substr(2,4), (document.FlightSearch.FRetMonYr.value.substr(0,2)-1), document.FlightSearch.FRetDate.value);

		if(validDate(document.FlightSearch.FDptMonYr.value.substring(2,7), document.FlightSearch.FDptMonYr.value.substring(0,2), document.FlightSearch.FDptDate.value)==false)
		{
		alert("Please Select the Valid Depart date");
		document.FlightSearch.FDptDateDDMMYY.focus();
		return false;
		}

//To Check the Valid Return Date

try
{
//to check the validations for the selected Month and Year value
var invalidDdate=setvalidDD;
var invalidDdate2=document.getElementById("FDptDateDDMMYY").selectedIndex;
var invalidRdate=document.getElementById("FDayMonthRet").selectedIndex;
var invalidRdate2=document.getElementById("FRetDateDDMMYY").selectedIndex;


//current date
var RDDate=new Date();
var todaydate=RDDate.getDate()+1;

// to show the valid date in the alert message for departure
var getdmonval=document.getElementById("FDptDateDDMMYY").value;
var getdyearval=document.getElementById("FDptDateDDMMYY").value;
getdmonval=getdmonval.substring(0,2);
getdyearval=getdyearval.substring(2,6);

// to show the valid date in the alert message for Return
var getRmonval=document.getElementById("FRetDateDDMMYY").value;
var getRyearval=document.getElementById("FRetDateDDMMYY").value;
getRmonval=getRmonval.substring(0,2);
getRyearval=getRyearval.substring(2,6);

        if(invalidDdate > RDDate.getDate() && invalidDdate2==11)
        {
             document.getElementById("FDayMonth").options[setvalidDD].selected=true;
             alert("Sorry,departure date should be less than "+todaydate+" "+GetMonthVal(getdmonval-1)+" "+getdyearval);
             document.getElementById("FDayMonth").focus();
             document.getElementById("FDayMonth").options[setvalidDD].selected=true;
            return false;
        }

var jtypeval2="0";
var JrnTypeval2="Return";
//jtypeval2=document.getElementById("JType").value;
JrnTypeval2=document.getElementById("FJrnType").value;

if(JrnTypeval2!="1")
{
        if(invalidRdate > RDDate.getDate() && invalidRdate2==11)
        {
            document.getElementById("FDayMonth").options[setvalidDD].selected=true;
            alert("Sorry,return date should be less than "+todaydate+" "+GetMonthVal(getRmonval-1)+" "+getRyearval);
            document.getElementById("FDayMonthRet").focus();
            document.getElementById("FDayMonth").options[setvalidDD].selected=true;
            return false;
           
        }
        if(invalidRdate==0)
                {
                   if(invalidRdate2!=11)
                    {
             
                    alert("Please Select the Valid Return date");
                    return false;
                    }
                }
                else if(invalidRdate2==12)//change by sachin
                {
                    if(invalidRdate!=0)
                    {
                 
                     alert("Please Select the Valid Return date");
                     return false;
                    }
                }        
}
        document.getElementById("FDayMonth").options[setvalidDD].selected=true;
}
catch(err){}
try
{
if(document.getElementById("JType").value=="1" || document.getElementById("FJrnType").value=="1")
{
}
else
{
		if(validDate(document.FlightSearch.FRetMonYr.value.substring(2,7), document.FlightSearch.FRetMonYr.value.substring(0,2), document.FlightSearch.FRetDate.value)==false)
		{
	
		alert("Please Select the Valid Return date");
		document.FlightSearch.FRetDateDDMMYY.focus();
		return false;
		}

}
}
catch(e)
{}
		var DD=new Date();
		var D =new Date(DD.getFullYear(),DD.getMonth(),DD.getDate()+2);
		
		
		if(Dptdate<=D )
		{
		alert("IF DEPARTURE IS WITHIN 72 HOURS, PLEASE CONTACT OUR RESERVATIONS DEPARTMENT ON 0800 368 0300");
		document.getElementById("FDayMonth").options[StartingDate].selected=true
		document.FlightSearch.FDptDateDDMMYY.focus();
		
		return false;
		}
//------------------------------------7 day validation------------------------------------------------		
		var flexibledate=""
		var one_day=1000*60*60*24;
        var strdiff=Math.ceil((retDate.getTime()-Dptdate.getTime())/(one_day))
		 var onewaycheck=document.FlightSearch.FJrnType.value;
		flexbibledate=document.getElementById("flexcalender").value;
	//&& onewaycheck!="1"
		if(flexbibledate=="1")
		{
	    var flexD =new Date(DD.getFullYear(),DD.getMonth(),DD.getDate()+2);
	   
	    if(Dptdate<=flexD)
	    {
		   // alert("If you want to search less than 7 days,please uncheck the 'My dates are flexible'")
		   if ( onewaycheck!="1")
		   {
		   alert("The minimum difference between the Departure Date and Return Date should be 7 days and  IF DEPARTURE IS WITHIN 72 HOURS, PLEASE CONTACT OUR RESERVATIONS DEPARTMENT ON 0800 368 0300. If you want to search less than 7 days,please uncheck the 'My dates are flexible'")
		   }
		   else
		   {
		  
		  alert("IF DEPARTURE IS WITHIN 72 HOURS, PLEASE CONTACT OUR RESERVATIONS DEPARTMENT ON 0800 368 0300");
		   }
		   
		   
		    return false;
		    }
       else 
         if(strdiff<7 && onewaycheck!="1") 
          {
          alert("The minimum diffenrence between the dates should be 7 days.If you want to search less than 7 days,please uncheck the 'My dates are flexible'")
          return false;
          } 
		    
		}
//------------------------------------------------------------------------------------			
		
//To Check the Return Date is greater Than the Depart Date

 var DMM=document.FlightSearch.FRetMonYr.value.substring(0,2)
 DDD=document.FlightSearch.FRetDate.value;

 if (document.getElementById("FDayMonthRet").value=="00")
 {
 document.FlightSearch.FJrnType.value=1;
 }
 var JType=document.FlightSearch.FJrnType.value;
    if(DMM!="00" && DDD!="000" && JType!="1" )
    {
  
		         if(retDate<=Dptdate)
		                {
		                 alert("Return Date Must be greater than Depart date");
		                document.FlightSearch.FRetDateDDMMYY.focus();
		                return false;
		                }	
    }
    			
}


function fDateValidationFltSearch(){

	var CurDate= new Date(document.FlightSearch.FBookYr.value, document.FlightSearch.FBookMon.value, document.FlightSearch.FBookDD.value);
	var Dptdate= new Date(document.FlightSearch.FDptMonYr.value.substring(2,7), document.FlightSearch.FDptMonYr.value.substring(0,2), document.FlightSearch.FdptDate.value);
//	var retDate= new Date(document.OnlineSearch.RetMonYr.value.substring(2,7), document.OnlineSearch.RetMonYr.value.substring(0,2), document.OnlineSearch.retDate.value);
//To Check the Valid Depart Dates

		if(validDate(document.FlightSearch.FDptMonYr.value.substring(2,7), document.FlightSearch.FDptMonYr.value.substring(0,2), document.FlightSearch.FdptDate.value)==false)
		{
		alert("Please Selet the Valid Depart date");
		document.FlightSearch.FDptDate.focus();
		return false;
		}
//To check Depart Date is not Less than the Current Date

		if(Dptdate<=CurDate)
		{
		alert("Depart Date Must be greater than Current date");
		document.FlightSearch.FDptDate.focus();
		return false;
		}
}


//End of Flight from Validation
//==========================================================================================================================




//=======================================================================================================
//Hotel form validation 
function hValidateSearch() 
{

	    if(document.HotelSearch.HDestTo.value.toUpperCase()=="PLEASE ENTER YOUR DESTINATION" || document.HotelSearch.HDestTo.value.toUpperCase()=="NO MATCH FOUND" || document.HotelSearch.HDestTo.value.length<3)
		{
				alert("Enter atleast three characters of destincation code or name and select desired destination.")
				document.HotelSearch.HDestTo.focus();
				return false;
		}
        if(validDest(document.HotelSearch.HDestTo)==false)
        {
                alert('Please Enter a valid Destination');
                document.HotelSearch.HDestTo.focus();
                return false;
        }

		var twnRoom,dblRoom,sngRoom,tplRoom,total
		if(hDateValidation()==false)
		{			
			return false;
		}		
		twnRoom=new Number(document.HotelSearch.HTwnRoom.value)
		dblRoom=new Number(document.HotelSearch.HDblRoom.value)
		sngRoom=new Number(document.HotelSearch.HSngRoom.value)
		tplRoom=new Number(document.HotelSearch.HTplRoom.value)
		total=(twnRoom+dblRoom+sngRoom+tplRoom)
		if(total<1)
		{
		alert("Please select a room type")
		document.HotelSearch.HSngRoom.value;
		return false;
		}
return true;
}

function validDest(obj)
{
//	var destFrm="";
//	var validcode="";
//	try
//	{
//	     destFrm=obj.value;
//	    if(destFrm!="")
//	    {
//	        var indval=destFrm.indexOf("(",0);
//	        if(indval==-1 || indval==1)
//	        return false;
//	        else
//	        {
//	            destCode=destFrm.split("(",3);
//	            var indval2=destCode[1].indexOf(")",0);
//	             if(indval2==-1 || indval2==1)
//	             return false;
//	             else
//	             {
//	                validcode=destCode[1].split(")")
//	                if(validcode[0].length==3)
//	                return true;
//	                else
//	                return false;
//	            }
//	         } 
//	    }
//	    else
//	    {
//	    return false;
//	    }
//	}catch(err){}
return true;
}

function hDateValidation()
{


	var CurDate= new Date(document.HotelSearch.hHBookYr.value, document.HotelSearch.hHBookMon.value, document.HotelSearch.hHBookDD.value);
	var Dptdate= new Date(document.HotelSearch.HDptMonYr.value.substring(2,7), document.HotelSearch.HDptMonYr.value.substring(0,2), document.HotelSearch.HDptDate.value);
	var RetDate= new Date(document.HotelSearch.HRetMonYr.value.substring(2,7), document.HotelSearch.HRetMonYr.value.substring(0,2), document.HotelSearch.HRetDate.value);
//To Check the Valid Depart Dates

		if(validDate(document.HotelSearch.HDptMonYr.value.substring(2,7), document.HotelSearch.HDptMonYr.value.substring(0,2), document.HotelSearch.HDptDate.value)==false)
		{
		alert("Please Select the Valid Depart date");
		document.HotelSearch.HDptDateDDMMYY.focus();
		return false;
		}

//To Check the Valid Return Date
//remove by sachin

//		if(validDate(document.HotelSearch.HRetMonYr.value.substring(2,7), document.HotelSearch.HRetMonYr.value.substring(0,2), document.HotelSearch.HRetDate.value)==false)
//		{
//		alert("Please Select the Valid Return date");
//		document.HotelSearch.HRetDateDDMMYY.focus();
//		return false;
//		}
//till here

//To check Depart Date is not Less than the Current Date
	
//To Check the Return Date is greater Than the Depart Date


 var DD=new Date();
		var D =new Date(DD.getFullYear(),DD.getMonth(),DD.getDate()+2);
		
		
		if(Dptdate<=D )
		{
		alert("IF DEPARTURE IS WITHIN 72 HOURS, PLEASE CONTACT OUR RESERVATIONS DEPARTMENT ON 0800 368 0300");
		document.getElementById("HDayMonth").options[StartingDate].selected=true
		document.HotelSearch.HDptDateDDMMYY.focus();
		return false;
		}		


		if(RetDate<=Dptdate)
		{
		alert("Return Date Must be greater than Depart date");
		document.HotelSearch.HRetDateDDMMYY.focus();
		return false;
		}
	
		
		try
{
//to check the validations for the selected Month and Year value
var invalidDdate=setvalidDD;
var invalidDdate2=document.getElementById("HDptDateDDMMYY").selectedIndex;
var invalidRdate=document.getElementById("HDayMonthRet").selectedIndex;
var invalidRdate2=document.getElementById("HRetDateDDMMYY").selectedIndex;


//current date
var RDDate=new Date();
var todaydate=RDDate.getDate()+1;

// to show the valid date in the alert message for departure
var getdmonval=document.getElementById("HDptDateDDMMYY").value;
var getdyearval=document.getElementById("HDptDateDDMMYY").value;
getdmonval=getdmonval.substring(0,2);
getdyearval=getdyearval.substring(2,6);

// to show the valid date in the alert message for Return
var getRmonval=document.getElementById("HRetDateDDMMYY").value;
var getRyearval=document.getElementById("HRetDateDDMMYY").value;
getRmonval=getRmonval.substring(0,2);
getRyearval=getRyearval.substring(2,6);

        if(invalidDdate > RDDate.getDate() && invalidDdate2==10)
        {
             document.getElementById("HDayMonth").options[setvalidDD].selected=true;
             alert("Sorry,departure date should be less than "+todaydate+" "+GetMonthVal(getdmonval-1)+" "+getdyearval);
             document.getElementById("HDayMonth").focus();
             document.getElementById("HDayMonth").options[setvalidDD].selected=true;
            return false;
        }
        
        
 }
 catch(e)
 {}
		
       
		
		
		
		
		
		
}


function hDateValidationFltSearch(){

	var CurDate= new Date(document.HotelSearch.HBookYr.value, document.HotelSearch.HBookMon.value, document.HotelSearch.HBookDD.value);
	var Dptdate= new Date(document.HotelSearch.HDptMonYr.value.substring(2,7), document.HotelSearch.HDptMonYr.value.substring(0,2), document.HotelSearch.HdptDate.value);
//	var retDate= new Date(document.OnlineSearch.RetMonYr.value.substring(2,7), document.OnlineSearch.RetMonYr.value.substring(0,2), document.OnlineSearch.retDate.value);
//To Check the Valid Depart Dates

		if(validDate(document.HotelSearch.HDptMonYr.value.substring(2,7), document.HotelSearch.HDptMonYr.value.substring(0,2), document.HotelSearch.HdptDate.value)==false)
		{
		alert("Please Select the Valid Depart date");
		document.HotelSearch.HDptDate.focus();
		return false;
		}
//To check Depart Date is not Less than the Current Date

		if(Dptdate<=CurDate)
		{
		alert("Depart Date Must be greater than Current date");
		document.HotelSearch.HDptDate.focus();
		return false;
		}
}


//End of Hotel from Validation
//==========================================================================================================================


var multiHTMtext="";
var radioButtHTMtext="";
var hiddenJrn="";

function changeReturn()
{
	if(document.OnlineSearch.RdJrnType[0].checked)
	{
		document.OnlineSearch.JrnType.value="Return"
	}
	if(document.OnlineSearch.RdJrnType[1].checked)
	{
		document.OnlineSearch.JrnType.value="OneWay"
	}
}
function moreFlt()
{
	if(radioButtHTMtext=="")
	{
		radioButtHTMtext = document.getElementById("radioButtRow").innerHTML;
	}
	if(document.OnlineSearch.checkbox.checked)
	{
		document.getElementById("radioButtRow").innerHTML=radioButtHTMtext;
	}
	else
	{
		document.getElementById("radioButtRow").innerHTML=""
		document.OnlineSearch.JrnType.value="Return"
	}
}
function removeCheck()
{
	document.OnlineSearch.checkbox.checked=false
}
//----------------------------end of fltsearch.aspx
//-------------------------------begining of fltLeftSearch.aspx ------------------
function fltLeftValid() //for flight page
{
		if(datevalidation()==false)
		{
			
		return false;
		}
		
return true;
}
//----------------------------------------------------------------------

function hotelSearch() //for hotel search
{
		if(datevalidation()==false)
		{
		return false;
		}
		var twnRoom,dblRoom,sngRoom,tplRoom,total
		twnRoom=new Number(document.OnlineSearch.twnRoom.value)
		dblRoom=new Number(document.OnlineSearch.dblRoom.value)
		sngRoom=new Number(document.OnlineSearch.sngRoom.value)
		tplRoom=new Number(document.OnlineSearch.tplRoom.value)
		total=(twnRoom+dblRoom+sngRoom+tplRoom)
		if(total<1)
		{
		alert("Please select a room type")
		return false;
		}
}


function ValidateTravel() //for flight page
{
		if(document.OnlineSearch.package.value==0)
		{
		alert("Please Select a package")
		document.OnlineSearch.package.focus()
		return false;
		}

		if(datevalidation()==false)
		{
		return false;
		}
		
return true;
}



function readcondition()
{
	if(!document.localHotels.agree.checked)
	{
		alert("Please Read the Terms & Conditions before Booking !")
		return false;
	}
	window.parent.scroll(0,0);
}
//----------validation for htlsummary.asp page ends------------------------------------
//----------------ends for htlccinfo.asps----------------------------------------------
var Cards = new makeArray(8);
Cards[0] = new CardType("MasterCard", "51,52,53,54,55", "16");
var MasterCard = Cards[0];
Cards[1] = new CardType("VisaCard", "4", "13,16");
var VisaCard = Cards[1];
Cards[2] = new CardType("AmExCard", "34,37", "15");
var AmExCard = Cards[2];
Cards[3] = new CardType("DinersClubCard", "30,36,38", "14");
var DinersClubCard = Cards[3];
Cards[4] = new CardType("DiscoverCard", "6011", "16");
var DiscoverCard = Cards[4];
Cards[5] = new CardType("enRouteCard", "2014,2149", "15");
var enRouteCard = Cards[5];
Cards[6] = new CardType("JCBCard", "3088,3096,3112,3158,3337,3528", "16");
var JCBCard = Cards[6];
var LuhnCheckSum = Cards[7] = new CardType();

/*************************************************************************\
CheckCardNumber(form)
function called when users click the "check" button.
\*************************************************************************/
function remove_XS_whitespace(item)
{
  var tmp = "";
  var item_length = item.value.length;
  var item_length_minus_1 = item.value.length - 1;
  for (index = 0; index < item_length; index++)
  {
	if (item.value.charAt(index) != ' ')
	{
	  tmp += item.value.charAt(index);
	}
	else
	{
	  if (tmp.length > 0)
	  {
		if (item.value.charAt(index+1) != ' ' && index != item_length_minus_1)
		{
		  tmp += item.value.charAt(index);
		}
	  }
	}
  }
  item.value = tmp;
}
function validateHtlccinfo()
{
	RSpace();
	if(document.ThisForm.getElementByID("MPFname").value=="")
	{
		alert("Please Enter the First Name");
		document.ThisForm.MPFname.focus()

		return false;
	}
	else if(document.ThisForm.MPLname.value=="")
	{
		alert("Please Enter the Last Name");
		document.ThisForm.MPLname.focus()
		return false;
	}
		else if(document.ThisForm.txtAdd1.value=="")
		{
			alert("Please Enter the First Address");
			document.ThisForm.txtAdd1.focus()
			return false;
		}
		else if(document.ThisForm.txtCity.value=="")
		{
			alert("Please Enter the City");
			document.ThisForm.txtCity.focus()
			return false;
		}
		else if(document.ThisForm.txtCountry.value=="")
		{
			alert("Please Enter the Country");
			document.ThisForm.txtCountry.focus()
			return false;
		}
		else if(document.ThisForm.txtPostCode.value=="")
		{
			alert("Please Enter the Post code");
			document.ThisForm.txtPostCode.focus()
			return false;
		}
		x=CheckCardNumber(ThisForm)
	if(x==false)
	{
		return false;
	}
window.parent.scroll(0,0);
}
function RSpace()
{
	remove_XS_whitespace(document.ThisForm.MPFname);
	remove_XS_whitespace(document.ThisForm.MPLname);
	remove_XS_whitespace(document.ThisForm.txtAdd1);
	remove_XS_whitespace(document.ThisForm.txtAdd2);
	remove_XS_whitespace(document.ThisForm.txtCity);
	remove_XS_whitespace(document.ThisForm.txtCountry);
	remove_XS_whitespace(document.ThisForm.txtPostCode);
}
function Validate1()
{
	RSpace();
	var x;
	x=CheckCardNumber(ThisForm)
	if(x==false)
	{
		return false;
	}
	if(document.ThisForm.MPFname.value=="")
	{
		alert("Please Enter the First Name");
		document.ThisForm.MPFname.focus()
		return false;
	}
	else if(document.ThisForm.MPLname.value=="")
	{
		alert("Please Enter the Last Name");
		document.ThisForm.MPLname.focus()
		return false;
	}
		else if(document.ThisForm.IssueNo.value=="")
		{
			alert("Please Enter the Issue No.");
			document.ThisForm.IssueNo.focus()
			return false;
		}				
		else if(document.ThisForm.txtAdd1.value=="")
		{
			alert("Please Enter the First Address");
			document.ThisForm.txtAdd1.focus()
			return false;
		}
		else if(document.ThisForm.txtAdd2.value=="")
		{
			alert("Please Enter the Second Address");
			document.ThisForm.txtAdd2.focus()
			return false;
		}
		else if(document.ThisForm.txtCity.value=="")
		{
			alert("Please Enter the City");
			document.ThisForm.txtCity.focus()
			return false;
		}
		else if(document.ThisForm.txtCountry.value=="")
		{
			alert("Please Enter the Country");
			document.ThisForm.txtCountry.focus()
			return false;
		}
		else if(document.ThisForm.txtPostCode.value=="")
		{
			alert("Please Enter the Post code");
			document.ThisForm.txtPostCode.focus()
			return false;
		}
	}
function RUSure()
{
	if(document.ThisForm.PC.checked==false)
		alert("We highly recommend you paying for your documents to be sent via special delivery postage.\n As any reissue costs for lost tickets/hotel vouchers will be payable by yourselves.");
}

function CheckCardNumber(form) 
{
	var tmpyear;

	if (form.CardType.selectedIndex == 1  && form.CardNumber.value == "4111111111111111" )
	{
		alert("Invalid card Number");
		form.CardNumber.select()	
		form.CardNumber.focus();
		return false;
	}
	if (form.CardNumber.value.length == 0) 
	{
		alert("Please enter a Card Number.");
		form.CardNumber.focus();
		return false;
	}
		if (form.CVVNo.value.length==0) 
		{
		alert("Please enter CVV No.");
		form.CVVNo.focus();
		return false;
		}
		else if(form.CVVNo.value.length < 3)
		{
		alert("It should have atleast three digit long. ");
		form.CVVNo.focus();
		return false;
		}
	
	if (form.requiredExpYear.value.length == 0) 
	{
		alert("Please enter the Expiration Year.");
		form.requiredExpYear.focus();
		return false;
	}
	if (form.requiredExpYear.value > 96)
		tmpyear = "19" + form.requiredExpYear.value;
	else if (form.requiredExpYear.value < 21)
		tmpyear = "20" + form.requiredExpYear.value;
	else
	{
		alert("The Expiration Year is not valid.");
		return false;
	}
	tmpmonth = form.ExpMon.options[form.ExpMon.selectedIndex].value;
// The following line doesn't work in IE3, you need to change it
// to something like "(new CardType())...".
// if (!CardType().isExpiryDate(tmpyear, tmpmonth)) {
	if (!(new CardType()).isExpiryDate(tmpyear, tmpmonth)) 
	{
		alert("This card has already expired.");
		return false;
	}
	if (form.CardType.selectedIndex == 4  && form.IssueNo.value.length == 0)
	{
		alert("Please enter Issue No. for Switch Cards.");
		form.IssueNo.focus();
		return false;
	}
	if (form.CardType.selectedIndex<4)
	{
		card = form.CardType.options[form.CardType.selectedIndex].value;
		var retval = eval(card + ".checkCardNumber(\"" + form.CardNumber.value +
		"\", " + tmpyear + ", " + tmpmonth + ");");
		cardname = "";
		if (retval)
		{
		// comment this out if used on an order form
		//alert("This card number appears to be valid.");
		}
		else 
		{
		// The cardnumber has the valid luhn checksum, but we want to know which
		// cardtype it belongs to.
			for (var n = 0; n < Cards.size; n++) 
			{
				if (Cards[n].checkCardNumber(form.CardNumber.value, tmpyear, tmpmonth)) 
				{
					cardname = Cards[n].getCardType();
					break;
		   		}
			}
			if (cardname.length > 0) 	
			{
				alert("This looks like a " + cardname + " number, not a " + card + " number.");
				return false;
			}
			else 
			{
				alert("This card number is not valid.");
				form.CardNumber.select()	
				form.CardNumber.focus();
				return false;
			}
		}
	}
//document.getElementById("flash").style.visibility="Visible";
	return true;
}
/*************************************************************************\
Object CardType([String cardtype, String rules, String len, int year, 
                                        int month])
cardtype    : type of card, eg: MasterCard, Visa, etc.
rules       : rules of the cardnumber, eg: "4", "6011", "34,37".
len         : valid length of cardnumber, eg: "16,19", "13,16".
year        : year of expiry date.
month       : month of expiry date.
eg:
var VisaCard = new CardType("Visa", "4", "16");
var AmExCard = new CardType("AmEx", "34,37", "15");
\*************************************************************************/

function CardType() 
{
	var n;
	var argv = CardType.arguments;
	var argc = CardType.arguments.length;

	this.objname = "object CardType";

	var tmpcardtype = (argc > 0) ? argv[0] : "CardObject";
	var tmprules = (argc > 1) ? argv[1] : "0,1,2,3,4,5,6,7,8,9";
	var tmplen = (argc > 2) ? argv[2] : "13,14,15,16,19";

	this.setCardNumber = setCardNumber;  // set CardNumber method.
	this.setCardType = setCardType;  // setCardType method.
	this.setLen = setLen;  // setLen method.
	this.setRules = setRules;  // setRules method.
	this.setExpiryDate = setExpiryDate;  // setExpiryDate method.
	this.setCardType(tmpcardtype);
	this.setLen(tmplen);
	this.setRules(tmprules);
	if (argc > 4)
	this.setExpiryDate(argv[3], argv[4]);
	this.checkCardNumber = checkCardNumber;  // checkCardNumber method.
	this.getExpiryDate = getExpiryDate;  // getExpiryDate method.
	this.getCardType = getCardType;  // getCardType method.
	this.isCardNumber = isCardNumber;  // isCardNumber method.
	this.isExpiryDate = isExpiryDate;  // isExpiryDate method.
	this.luhnCheck = luhnCheck;// luhnCheck method.
	return this;
}

/*************************************************************************\
boolean checkCardNumber([String cardnumber, int year, int month])
return true if cardnumber pass the luhncheck and the expiry date is
valid, else return false.
\*************************************************************************/
function checkCardNumber() 
{
	var argv = checkCardNumber.arguments;
	var argc = checkCardNumber.arguments.length;
	var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
	var year = (argc > 1) ? argv[1] : this.year;
	var month = (argc > 2) ? argv[2] : this.month;

	this.setCardNumber(cardnumber);
	this.setExpiryDate(year, month);
	if (!this.isCardNumber())
	return false;
	if (!this.isExpiryDate())
	return false;

	return true;
}
/*************************************************************************\
String getCardType()
return the cardtype.
\*************************************************************************/
function getCardType() 
{
	return this.cardtype;
}
/*************************************************************************\
String getExpiryDate()
return the expiry date.
\*************************************************************************/
function getExpiryDate() 
{
	return this.month + "/" + this.year;
}
/*************************************************************************\
boolean isCardNumber([String cardnumber])
return true if cardnumber pass the luhncheck and the rules, else return
false.
\*************************************************************************/
function isCardNumber() 
{
	var argv = isCardNumber.arguments;
	var argc = isCardNumber.arguments.length;
	var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
	if (!this.luhnCheck())
	return false;

	for (var n = 0; n < this.len.size; n++)
	if (cardnumber.toString().length == this.len[n]) 
	{
		for (var m = 0; m < this.rules.size; m++) 	
		{
			var headdigit = cardnumber.substring(0, this.rules[m].toString().length);
			if (headdigit == this.rules[m])
			return true;
		}
		return false;
	}
	return false;
}

/*************************************************************************\
boolean isExpiryDate([int year, int month])
return true if the date is a valid expiry date,
else return false.
\*************************************************************************/
function isExpiryDate() 	
{
	var argv = isExpiryDate.arguments;
	var argc = isExpiryDate.arguments.length;

	year = argc > 0 ? argv[0] : this.year;
	month = argc > 1 ? argv[1] : this.month;
	if (!isNum(year+""))
	return false;
	if (!isNum(month+""))
	return false;
	today = new Date();
	expiry = new Date(year, month);
	if (today.getTime() > expiry.getTime())
	return false;
	else
	return true;
}

/*************************************************************************\
boolean isNum(String argvalue)
return true if argvalue contains only numeric characters,
else return false.
\*************************************************************************/
function isNum(argvalue) 
{
	argvalue = argvalue.toString();

	if (argvalue.length == 0)
	return false;

	for (var n = 0; n < argvalue.length; n++)
	if (argvalue.substring(n, n+1) < "0" || argvalue.substring(n, n+1) > "9")
	return false;
	return true;
}

/*************************************************************************\
boolean luhnCheck([String CardNumber])
return true if CardNumber pass the luhn check else return false.
Reference: http://www.ling.nwu.edu/~sburke/pub/luhn_lib.pl
\*************************************************************************/
function luhnCheck() 
{
	var argv = luhnCheck.arguments;
	var argc = luhnCheck.arguments.length;

	var CardNumber = argc > 0 ? argv[0] : this.cardnumber;

	if (! isNum(CardNumber)) 
	{
		return false;
  	}

	var no_digit = CardNumber.length;
	var oddoeven = no_digit & 1;
	var sum = 0;

	for (var count = 0; count < no_digit; count++) 
	{
		var digit = parseInt(CardNumber.charAt(count));
		if (!((count & 1) ^ oddoeven)) 
		{
			digit *= 2;
			if (digit > 9)
			digit -= 9;
		}
	sum += digit;
	}	
	if (sum % 10 == 0)
	return true;
	else
	return false;
}

/*************************************************************************\
ArrayObject makeArray(int size)
return the array object in the size specified.
\*************************************************************************/
function makeArray(size) 	
{
	this.size = size;
	return this;	
}

/*************************************************************************\
CardType setCardNumber(cardnumber)
return the CardType object.
\*************************************************************************/
function setCardNumber(cardnumber) 
{
	this.cardnumber = cardnumber;
	return this;
}

/*************************************************************************\
CardType setCardType(cardtype)
return the CardType object.
\*************************************************************************/
function setCardType(cardtype) 
{
	this.cardtype = cardtype;
	return this;
}

/*************************************************************************\
CardType setExpiryDate(year, month)
return the CardType object.
\*************************************************************************/
function setExpiryDate(year, month) 
{
	this.year = year;
	this.month = month;
	return this;
}

/*************************************************************************\
CardType setLen(len)
return the CardType object.
\*************************************************************************/
function setLen(len) 	
{
// Create the len array.
	if (len.length == 0 || len == null)
	len = "13,14,15,16,19";
	var tmplen = len;
	n = 1;
	while (tmplen.indexOf(",") != -1) 
	{
		tmplen = tmplen.substring(tmplen.indexOf(",") + 1, tmplen.length);
		n++;
	}
	this.len = new makeArray(n);
	n = 0;
	while (len.indexOf(",") != -1) 
	{
		var tmpstr = len.substring(0, len.indexOf(","));
		this.len[n] = tmpstr;
		len = len.substring(len.indexOf(",") + 1, len.length);
		n++;
	}
	this.len[n] = len;
	return this;
}

/*************************************************************************\
CardType setRules()
return the CardType object.
\*************************************************************************/
function setRules(rules) 
{
	// Create the rules array.
	if (rules.length == 0 || rules == null)
	rules = "0,1,2,3,4,5,6,7,8,9";
	var tmprules = rules;
	n = 1;
	while (tmprules.indexOf(",") != -1) 
	{
		tmprules = tmprules.substring(tmprules.indexOf(",") + 1, tmprules.length);
		n++;
	}
	this.rules = new makeArray(n);
	n = 0;
	while (rules.indexOf(",") != -1) 
	{
		var tmpstr = rules.substring(0, rules.indexOf(","));
		this.rules[n] = tmpstr;
		rules = rules.substring(rules.indexOf(",") + 1, rules.length);
		n++;
	}
	this.rules[n] = rules;
	return this;
}
//document.getElementById("flash").style.visibility="visible";

function cValue()
{}

function RUSure()
	{
		if(document.ThisForm.PC.checked==false)
			alert("We highly recommend you paying for your documents to be sent via special delivery postage.\n As any reissue costs for lost tickets/hotel vouchers will be payable by yourselves.");
	//		alert("We cannot guarantee the delivery of your documents.\nAny lost documents will have to be reissued and \nall costs will have to be paid again.");
	}



//----------------ends for htlccinfo.asps----------------------------------------------

//----------------start of fltPaxDetail.asps----------------------------------------------

//----------------ends for fltPaxDetails.asps----------------------------------------------
function remove_XS_whitespace(item)
{
  var tmp = "";
  var item_length = item.value.length;
  var item_length_minus_1 = item.value.length - 1;
  for (index = 0; index < item_length; index++)
  {
    if (item.value.charAt(index) != ' ')
    {
      tmp += item.value.charAt(index);
    }
    else
    {
      if (tmp.length > 0)
      {
        if (item.value.charAt(index+1) != ' ' && index != item_length_minus_1)
        {
          tmp += item.value.charAt(index);
        }
      }
    }
  }
  item.value = tmp;
}

function checkrequired(which) {

var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if(tempobj.type=="text"||tempobj.type=="textarea"){
	remove_XS_whitespace(tempobj);
}

if (tempobj.name.substring(0,8)=="required") {
if (((tempobj.type=="text"||tempobj.type=="textarea") && tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s" && tempobj.selectedIndex==0)) {
	pass=false;
	break;
         }
      }
   }
}
if (!pass) {
	shortFieldName=tempobj.name.substring(8,30).toUpperCase();
	alert("Please make sure all fields have been completed.");
	tempobj.focus();
	return false;
}
else
	if(emailCheck(which.elements['requiredEMail'].value)){
		return true;
	}
	else{
		return false;
	}

}

function emailCheck (emailStr) {
var checkTLD=1;
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
alert("Email address seems incorrect (check @ and .'s)");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];
for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Ths username contains invalid characters.");
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Ths domain name contains invalid characters.");
return false;
   }
}
if (user.match(userPat)==null) {
alert("The username doesn't seem to be valid.");
return false;
}
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
return false;
   }
}
return true;
}
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("The domain name does not seem to be valid.");
return false;
   }
}
if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain or two letter " + "country.");
return false;
}
if (len<2) {
alert("This address is missing a hostname!");
return false;
}
return true;
}
//----------------validation ends for htlPaxinfo.js-----------------




function ValidateSearchLeft() //for left_navbot.aspx
{
		if(datevalidation()==false)
		{
		return false;
		}
		
		var Adult,child,Infant,total
		Adult=new Number(document.OnlineSearch.Adult.value)
		child=new Number(document.OnlineSearch.Child.value)
		Infant=new Number(document.OnlineSearch.Infant.value)
		total=(Adult+child+Infant)
		if(total>9)
		{
		alert("Total no of person should be less than 9")
		return false;
		}
		
return true;
}
//------end of left_navbot.aspx



//------------------------------------------------submit validation for different submit pages ends

//--------------------------------------- select a city validation
function htlSelDestValid()
{

if(datevalidation()==false)
		{
		return false;
		}

		var twnRoom,dblRoom,sngRoom,tplRoom,total
		twnRoom=new Number(document.OnlineSearch.twnRoom.value)
		dblRoom=new Number(document.OnlineSearch.dblRoom.value)
		sngRoom=new Number(document.OnlineSearch.sngRoom.value)
		tplRoom=new Number(document.OnlineSearch.tplRoom.value)
		total=(twnRoom+dblRoom+sngRoom+tplRoom)

		if(total<1)
		{
		alert("Please select a room type")
		return false;
		}

		if(dateDiff()==false)
		{
		return false;
		}

}





function goToBookMarkflthtl(pp)
{
var d,f,pos,nn
locationName=document.getElementById("IFrameSelectCountryInner").src

pos=locationName.indexOf('?')
nn=locationName.substring(0,pos)
d=document.MainForm.select.selectedIndex
f=document.MainForm.select.options[d].text

	if(nn=="countryInnerflthtl.aspx")
	document.IFrameSelectCountryInner.location.href = "countryInnerflthtl.aspx?CN="+f+"";
	else
	document.IFrameSelectCountryInner.location.href = "countryInnerflthtlleft.aspx?CN="+f+"";
	
}



function closeWin1()
{
document.getElementById("IFrameSelectCountryInner").src=""
window.parent.document.getElementById("selectCountry").style.visibility="hidden";
}


function showContinent()
{
window.document.getElementById("selectCountry").style.visibility="visible";
}

function goBack()
{
document.getElementById("IFrameSelectCountryInner").src=""
window.parent.document.getElementById("selectCountry").style.visibility="hidden";
window.parent.document.getElementById("selectContinent").style.visibility="visible";
}
function passValueflthtl(vCode,vDestName)
{

window.parent.window.parent.window.document.getElementById("DestinationText").value=vDestName
window.parent.window.parent.window.document.getElementById("Destination").value=vCode
window.parent.window.parent.window.document.getElementById("selectCountry").style.visibility="hidden";
}



function setConLayer()
{
window.parent.document.getElementById("IFrameSelect").width="267"
window.parent.document.getElementById("IFrameSelect").scrolling="yes"
}

function DropSelCity(ll)
{


var d,f
d=document.MainForm.select.selectedIndex
f=document.MainForm.select.options[d].text
location.href="country.aspx?CN="+f+""
}
	

//-------------------end of select a city validation on search.asp continent

function datevalidation(){

	var CurDate= new Date(document.OnlineSearch.BookYr.value, document.OnlineSearch.BookMon.value, document.OnlineSearch.BookDD.value);
	var Dptdate= new Date(document.OnlineSearch.DptMonYr.value.substring(2,7), document.OnlineSearch.DptMonYr.value.substring(0,2), document.OnlineSearch.dptDate.value);
	var retDate= new Date(document.OnlineSearch.RetMonYr.value.substring(2,7), document.OnlineSearch.RetMonYr.value.substring(0,2), document.OnlineSearch.retDate.value);
//To Check the Valid Depart Dates

		if(validDate(document.OnlineSearch.DptMonYr.value.substring(2,7), document.OnlineSearch.DptMonYr.value.substring(0,2), document.OnlineSearch.dptDate.value)==false)
		{
		alert("Please Selet the Valid Depart date");
		document.OnlineSearch.dptDate.focus();
		return false;
		}

//To Check the Valid Return Date

		if(validDate(document.OnlineSearch.RetMonYr.value.substring(2,7), document.OnlineSearch.RetMonYr.value.substring(0,2), document.OnlineSearch.retDate.value)==false)
		{
		alert("Please Selet the Valid Return date");
		document.OnlineSearch.retDate.focus();
		return false;
		}

//To check Depart Date is not Less than the Current Date

		var D = new Date(document.OnlineSearch.BookYr.value, document.OnlineSearch.BookMon.value, eval(document.OnlineSearch.BookDD.value) + 2);
		if(Dptdate<=D)
		{
		alert("IF DEPARTURE IS WITHIN 72 HOURS, PLEASE CONTACT OUR RESERVATIONS DEPARTMENT ON 0800 368 0300");
		document.OnlineSearch.dptDate.focus();
		return false;
		}
//To Check the Return Date is greater Than the Depart Date
if(document.getElementById("JrnTypeR").checked==true)
{

		if(retDate<=Dptdate)
		{
		alert("Return Date Must be greater than Depart date");
		document.OnlineSearch.retDate.focus();
		return false;
		}
}
			
}



// Function to Check the Dates r Valid or Not

function validDate(YYYY,MM,DD)
{
		
	var gg
	gg=new Number(MM)
	//MM=gg + 1
	MM=gg

		if(MM==4 || MM==6 || MM==9 || MM==11 )
		{
			if(parseInt(DD)>=31)
			{				
				return false;
			}
		}
		
		else if(MM==2 && YYYY%4 ==0)
		{
			if(DD>=30)
			return false;
		}
		
		else if(MM==2)
		{
			if(DD>=29)
			return false;
		}
		
		else if(DD==" " || DD=="0")
		{		
			return false;
			
	
	     }
		
		
		
		
return true;
}


//Function to remove the White Space from the Control

function remove_XS_whitespace(item)
{
	  var tmp = "";
	  var item_length = item.value.length;
	  var item_length_minus_1 = item.value.length - 1;

		for (index = 0; index < item_length; index++)
		{
			if (item.value.charAt(index) != ' ')
			{
			  tmp += item.value.charAt(index);
			}
			else
			{
				  if (tmp.length > 0)
				  {
						if (item.value.charAt(index+1) != ' ' && index != item_length_minus_1)
						{
						  tmp += item.value.charAt(index);
						}
		  		  }
		    }
	   }

	item.value = tmp;
}


// veerus function starts from here
// on change of departure date
//==============================================================================================================


function dptValid()
{

	var Dptdate= new Date(document.OnlineSearch.DptMonYr.value.substring(2,7), document.OnlineSearch.DptMonYr.value.substring(0,2), document.OnlineSearch.dptDate.value);
	var retDate= new Date(document.OnlineSearch.RetMonYr.value.substring(2,7), document.OnlineSearch.RetMonYr.value.substring(0,2), document.OnlineSearch.retDate.value);

		if(validDate(document.OnlineSearch.DptMonYr.value.substring(2,7), document.OnlineSearch.DptMonYr.value.substring(0,2), document.OnlineSearch.dptDate.value)==false)
		{
		alert("Please Select the Valid Depart date");
		document.OnlineSearch.dptDate.focus();
		return false;
		}


//if(retDate<=Dptdate)
//{
		//retDate.setDate(Dptdate.getDate()+3)
		var dDpt,mDpt,yDpt,dRet,mRet,yRet
		dDpt=Dptdate.getDate()   //departure date
		mDpt=Dptdate.getMonth()	 //departure month
		yDpt=Dptdate.getFullYear() //departure year
		dRet=retDate.getDate()	 //return date
		mRet=retDate.getDate()	 //return month
		yRet=retDate.getFullYear()	 //return month
		mDpt=mDpt+1

		if(mDpt==4 || mDpt==6 || mDpt==9 || mDpt==11 )
		{
				if(dDpt>28)
				{
					var I,l
					I=document.OnlineSearch.DptMonYr.length
					l=document.OnlineSearch.DptMonYr.selectedIndex
	
					if(l<10)
					{
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l+1].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l].selected=true;
					return false;
					}
				}
				else if(dDpt<=28)
				{
					document.getElementById("retDate").options[mRet-1].selected=true;
					l=document.OnlineSearch.DptMonYr.selectedIndex
						document.OnlineSearch.RetMonYr.options[l].selected=true;
					return false;
				}
				return false;
		} // end of months of 30 days validation

		if(mDpt==1 ||  mDpt==3 || mDpt==5 || mDpt==7 || mDpt==8 || mDpt==10 || mDpt==12 )
		{
				if(dDpt>29)
				{
					var I,l
					I=document.OnlineSearch.DptMonYr.length
					l=document.OnlineSearch.DptMonYr.selectedIndex
					
					if(l<10)
					{
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l+1].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l].selected=true;
					return false;
					}
				}
				else if(dDpt<29)
				{
					document.getElementById("retDate").options[mRet-1].selected=true;
					l=document.OnlineSearch.DptMonYr.selectedIndex
					document.OnlineSearch.RetMonYr.options[l].selected=true;
				}
				return false;
				
          }// end of months of 31 days validation


  		if(mDpt==2)
		{			
			 if(yDpt%4 ==0)
			{
				if(dDpt>=29)
					{
						var I,l
						I=document.OnlineSearch.DptMonYr.length
						l=document.OnlineSearch.DptMonYr.selectedIndex
					
							if(l<10)
							{
							document.getElementById("retDate").options[mRet-1].selected=true;
							document.OnlineSearch.RetMonYr.options[l+1].selected=true;
							return false;
							}
							else if(l==10)
							{
							document.getElementById("retDate").options[mRet-1].selected=true;
							document.OnlineSearch.RetMonYr.options[l].selected=true;
							return false;
							}
					} //end of Dtp > than 30
					
					else if(dDpt<=28)
					{
						document.getElementById("retDate").options[mRet-1].selected=true;
						return false;
					} //end of Dtp < than 30

			} //end of if month is a leap year 

			 if(yDpt%4 !=0)
			{
					if(dDpt>=28)
					{
						var I,l
						I=document.OnlineSearch.DptMonYr.length
						l=document.OnlineSearch.DptMonYr.selectedIndex
					
							if(l<10)
							{
							document.getElementById("retDate").options[mRet-1].selected=true;
							document.OnlineSearch.RetMonYr.options[l+1].selected=true;
							return false;
							}
							else if(l==10)
							{
							document.getElementById("retDate").options[mRet-1].selected=true;
							document.OnlineSearch.RetMonYr.options[l].selected=true;
							return false;
							}
					} //end of Dtp > than 30
					
					else if(dDpt<28)
					{
						document.getElementById("retDate").options[mRet-1].selected=true;
						l=document.OnlineSearch.DptMonYr.selectedIndex
						document.OnlineSearch.RetMonYr.options[l].selected=true;
						return false;
					} //end of Dtp < than 30

			} //end of not a leap year

          }// end of months of feburary  validation

//} //end of function if return date is less than depart date


//To Check the Valid Depart Dates

		if(validDate(document.OnlineSearch.DptMonYr.value.substring(2,7), document.OnlineSearch.DptMonYr.value.substring(0,2), document.OnlineSearch.dptDate.value)==false)
		{
		alert("Please Selet the Valid Depart date");
		document.OnlineSearch.dptDate.focus();
		return false;
		}

//To Check the Valid Return Date

		if(validDate(document.OnlineSearch.RetMonYr.value.substring(2,7), document.OnlineSearch.RetMonYr.value.substring(0,2), document.OnlineSearch.retDate.value)==false)
		{
		alert("Please Selet the Valid Return date");
		document.OnlineSearch.retDate.focus();
		return false;
		}
	
}// end of departure date change function






//departure month validation begin here==================================================================

function dptMonthValid()
{

	var Dptdate= new Date(document.OnlineSearch.DptMonYr.value.substring(2,7), document.OnlineSearch.DptMonYr.value.substring(0,2), document.OnlineSearch.dptDate.value);
	var retDate= new Date(document.OnlineSearch.RetMonYr.value.substring(2,7), document.OnlineSearch.RetMonYr.value.substring(0,2), document.OnlineSearch.retDate.value);



		if(validDate(document.OnlineSearch.DptMonYr.value.substring(2,7), document.OnlineSearch.DptMonYr.value.substring(0,2), document.OnlineSearch.dptDate.value)==false)
		{
		alert("Please Selet the Valid Depart date");
//		document.getElementById("dptDate").options[29].selected=true;
		document.OnlineSearch.dptDate.focus();
		return false;
		}

//To Check the Valid Return Date

		if(validDate(document.OnlineSearch.RetMonYr.value.substring(2,7), document.OnlineSearch.RetMonYr.value.substring(0,2), document.OnlineSearch.retDate.value)==false)
		{
		alert("Please Selet the Valid Return date");
		document.OnlineSearch.retDate.focus();
		return false;
		}



//if(retDate<=Dptdate)
//{
		retDate.setDate(Dptdate.getDate()+3)
		var dDpt,mDpt,yDpt,dRet,mRet,yRet
		dDpt=Dptdate.getDate()   //departure date
		mDpt=Dptdate.getMonth()	 //departure month
		yDpt=Dptdate.getFullYear() //departure year
		dRet=retDate.getDate()	 //return date
		mRet=retDate.getDate()	 //return month
		yRet=retDate.getFullYear()	 //return month
		mDpt=mDpt+1

			if(mDpt==4 || mDpt==6 || mDpt==9 || mDpt==11 )   //for months having 30 days
			{
			
				if(dDpt>=30)
				{
					var I,l
					I=document.OnlineSearch.DptMonYr.length
					l=document.OnlineSearch.DptMonYr.selectedIndex
		
					if(l<10)
					{
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l+1].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l].selected=true;
					return false;
					}
				} // end of if dDpt >=30
				
			else if(dDpt<30)
				{
					document.getElementById("retDate").options[mRet-1].selected=true;
					var I,l
					I=document.OnlineSearch.DptMonYr.length
					l=document.OnlineSearch.DptMonYr.selectedIndex
					
					if(l<10)
					{
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l].selected=true;
					return false;
					}
				return false;
				}
				return false;
			} // end of months of 30 days validation


		if(mDpt==1 ||  mDpt==3 || mDpt==5 || mDpt==7 || mDpt==8 || mDpt==10 || mDpt==12 ) // for months having 31 days
		{
			if(dDpt>=30)
			{
				var I,l
				I=document.OnlineSearch.DptMonYr.length
				l=document.OnlineSearch.DptMonYr.selectedIndex
					if(l<10)
					{
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l+1].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l].selected=true;
					return false;
					}
			}
			else if(dDpt<30)
			{
				document.getElementById("retDate").options[mRet-1].selected=true;
				var I,l
				I=document.OnlineSearch.DptMonYr.length
				l=document.OnlineSearch.DptMonYr.selectedIndex
					if(l<10)
					{
					document.getElementById("retDate").options[dDpt].selected=true;						
					document.getElementById("retDate").options[dDpt].selected=true;						
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l].selected=true;
					return false;
					}
			}
			return false;
      }// end of months of 31 days validation
	  
		  
	if(mDpt==2)  //for month of feburary
	{
		 if(yDpt%4 ==0) //for leap year
		{
			if(dDpt>=29)
			{
				var I,l
				I=document.OnlineSearch.DptMonYr.length
				l=document.OnlineSearch.DptMonYr.selectedIndex
					if(l<10)
					{
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l+1].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.getElementById("retDate").options[mRet-1].selected=true;
					document.OnlineSearch.RetMonYr.options[l].selected=true;
					return false;
					}
   			 } //end of Dtp > than 29
					
			else if(dDpt<=28)
			{
				document.getElementById("retDate").options[mRet-1].selected=true;
				return false;
			} //end of Dtp < than 30

	} //end of if month is a leap year 

		 if(yDpt%4 !=0)  // for a year which is not leap year
			{
				if(dDpt>=28)
				{
					var I,l
					I=document.OnlineSearch.DptMonYr.length
					l=document.OnlineSearch.DptMonYr.selectedIndex
					if(l<10)
					{
					document.getElementById("retDate").options[2].selected=true;
					document.OnlineSearch.RetMonYr.options[l+1].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.getElementById("retDate").options[2].selected=true;
					document.OnlineSearch.RetMonYr.options[l].selected=true;
					return false;
					}
				} //end of Dtp >= than 28
					
			else if(dDpt<=27)
				{
					document.getElementById("retDate").options[mRet-1].selected=true;
					var I,l
					I=document.OnlineSearch.DptMonYr.length
					l=document.OnlineSearch.DptMonYr.selectedIndex
						if(dDpt==26)
						{
							var I,l
							I=document.OnlineSearch.DptMonYr.length
							l=document.OnlineSearch.DptMonYr.selectedIndex
								if(l<10)
								{
								document.getElementById("retDate").options[1].selected=true;						
								document.OnlineSearch.RetMonYr.options[l+1].selected=true;
								return false;
								}
								else if(l==10)
								{
								document.getElementById("retDate").options[mRet-1].selected=true;
								document.OnlineSearch.RetMonYr.options[l].selected=true;
								return false;
								}
						}// end of dDpt==26
						if(l<10)
						{
						document.getElementById("retDate").options[dDpt].selected=true;						
						document.getElementById("retDate").options[dDpt].selected=true;						
						document.getElementById("retDate").options[mRet-1].selected=true;
						document.OnlineSearch.RetMonYr.options[l].selected=true;
						return false;
						}
							
						else if(l==10)
						{
						document.getElementById("retDate").options[mRet-1].selected=true;
						document.OnlineSearch.RetMonYr.options[l].selected=true;
						return false;
						}

						return false;
			} //end of Dtp < than 27

		} //end of year not a leap year

     }// end of months of feburary  validation mDpt==2
//} //end of function if return date is less than depart date

} // end of on change of month of departure date


//=======================================================================

//---------end of month change of return date
function  retMonthChange()
{}
//---------end of month change of return date---------

function dateDiff()
{
	
	var CurDate= new Date(document.OnlineSearch.BookYr.value, document.OnlineSearch.BookMon.value, document.OnlineSearch.BookDD.value);
	var Dptdate= new Date(document.OnlineSearch.DptMonYr.value.substring(2,7), document.OnlineSearch.DptMonYr.value.substring(0,2), document.OnlineSearch.dptDate.value);
	var retDate= new Date(document.OnlineSearch.RetMonYr.value.substring(2,7), document.OnlineSearch.RetMonYr.value.substring(0,2), document.OnlineSearch.retDate.value);
	var vdiff

	if(document.OnlineSearch.rdotype(0).checked == true || document.OnlineSearch.rdotype(2).checked == true )
	{
		vdiff=((retDate-Dptdate)/86400)/1000
		if (vdiff>30)
		{
			alert("The return dates must be within 1 months from the depart date, please adjust.");
			return false;
		}
	}

return true;
}
//---------------end of date validation-------------------------------------

//------------------- option buttons on search page validation--------------------

function call_page()
{
	window.location.href="htlSearch.aspx";
}

function call_Car()
{
		document.car_rent.submit();
		//window.location.href="car_rental.aspx";
}

function call_page1()
{
	window.location.href="flthtlsearch.aspx";
}

function opTravel()
{
	window.location.href="travelinsurance1.aspx";
}
					
function opAPT()
{
	  document.Apt_Exp.submit();

}

function call_Flights()
{
	window.location.href="fltsearch.aspx";
}

//---------------------------------------end of option buttons on search page validation-------------------------------

//--------------showing and hiding of calender on home page validation-----------------------------------------------------


function ShowHideLayer(x,Fr)
{
	if(firstCal==1)
	{
		window.document.getElementById("IFrameCalander").src="calender.htm"
		resizeCaller1();
		window.document.getElementById("calander").style.visibility="visible";
		window.document.getElementById("calType").value=Fr
	}
	else
	{
		window.document.getElementById("calander").style.visibility="visible";
		resizeCaller1();
		window.document.getElementById("calType").value=Fr
	}
firstCal=0;
}
//-------------- end showing and hiding of calender on home page validation-----------------------------------------------------

//--------------showing and hiding of left calender on left page validation-----------------------------------------------------
//==========================================================================
//Flight Hotel Clander
function fHShowHideLayerLeft(x,Fr)
{
	if(FHfirstCallLeft==1)
	{
		window.document.getElementById("FHIFrameCalander").src="fhcalender.htm"
		window.document.getElementById("FHCalander").style.visibility="visible";
		window.document.getElementById("hFHCalType").value=Fr
	}
	else
	{
		window.document.getElementById("FHCalander").style.visibility="visible";
		window.document.getElementById("hFHCalType").value=Fr
	}
FHfirstCallLeft=0;
}

function fHShowHideLayer(x,Fr)
{
	if(FHfirstCal==1)
	{
		window.document.getElementById("FHIFrameCalander").src="fhcalender.htm"
		window.document.getElementById("FHCalander").style.visibility="visible";
		window.document.getElementById("hFHCalType").value=Fr
	}
	else
	{
		window.document.getElementById("FHCalander").style.visibility="visible";
		resizeCaller1();
		window.document.getElementById("hFHCalType").value=Fr
	}
FHfirstCal=0;
}
//End Flight Hotel Clander
//==========================================================================

//==========================================================================
//Hotel Clander
function hShowHideLayerLeft(x,Fr)
{
	
	if(HfirstCallLeft==1)
	{
		window.document.getElementById("HIFrameCalander").src="hcalender.htm"
		window.document.getElementById("HCalander").style.visibility="visible";
		window.document.getElementById("hHCalType").value=Fr
	}
	else
	{
		window.document.getElementById("HCalander").style.visibility="visible";
		window.document.getElementById("hHCalType").value=Fr
	}
HfirstCallLeft=0;
}
function hShowHideLayer(x,Fr)
{
	if(HfirstCal==1)
	{
		window.document.getElementById("HIFrameCalander").src="hcalender.htm"
		window.document.getElementById("HCalander").style.visibility="visible";
		window.document.getElementById("hHCalType").value=Fr
	}
	else
	{
		window.document.getElementById("HCalander").style.visibility="visible";
		resizeCaller1();
		window.document.getElementById("hHCalType").value=Fr
	}
HfirstCal=0;
}
//End Hotel Clander
//==========================================================================

//==========================================================================
//Flight Clander
function fShowHideLayerLeft(x,Fr)
{
	
	if(FfirstCallLeft==1)
	{
		window.document.getElementById("FIFrameCalander").src="fcalender.htm"
		window.document.getElementById("FCalander").style.visibility="visible";
		window.document.getElementById("hFCalType").value=Fr
	}
	else
	{
		window.document.getElementById("FCalander").style.visibility="visible";
		window.document.getElementById("hFCalType").value=Fr
	}
FfirstCallLeft=0;
}
function hShowHideLayer(x,Fr)
{
	if(FfirstCal==1)
	{
		window.document.getElementById("FIFrameCalander").src="fcalender.htm"
		window.document.getElementById("FCalander").style.visibility="visible";
		window.document.getElementById("hFCalType").value=Fr
	}
	else
	{
		window.document.getElementById("FCalander").style.visibility="visible";
		window.document.getElementById("hFCalType").value=Fr
	}
FfirstCal=0;
}
//End Flight Clander
//==========================================================================




function ShowHideLayerLeft(x,Fr)
{
	if(firstCallLeft==1)
	{
		window.document.getElementById("IFrameCalander").src="calender.htm"
		resizeCaller1();
		window.document.getElementById("calander").style.visibility="visible";
		window.document.getElementById("calType").value=Fr
	}
	else
	{
		window.document.getElementById("calander").style.visibility="visible";
		resizeCaller1();
		window.document.getElementById("calType").value=Fr
	}
firstCallLeft=0;
}
//-----------------------------end of reseting of tabs in different pages-----------------------------------------------------------

function commonValidate()
{
	if(document.mailform.txtname.value=="")
	{	
	alert("Please enter your name.")
	document.mailform.txtname.focus()
	return false
	}
	else if(document.mailform.txtname.value==parseInt(document.mailform.txtname.value))
	{
	alert("Your name is invalid")
	document.mailform.txtname.focus()
	document.mailform.txtname.select()
	return false
	}
	else if(document.mailform.txtmail.value=="")
	{
	alert("Please enter your E-mail address.")
	document.mailform.txtmail.focus()
	return false
	}
	else if(document.mailform.txtmail.value.indexOf("@")==-1)
	{
	alert("Please enter your valid E-mail address.")
	document.mailform.txtmail.focus()
	document.mailform.txtmail.select()
	return false
	}
	else if(document.mailform.txtmail.value.indexOf(".")==-1)
	{
	alert("Please enter your valid E-mail address.")
	document.mailform.txtmail.focus()
	document.mailform.txtmail.select()
	return false
	}
}
//---------------------------------end of common submit function checking email,name,etc.----------------------------------


//-----------------converter validation------------------------------
//-----------------converter validation------------------------------

//---------for booking.asp reset button-----------

//---------for booking.asp reset button-----------

function test()
{
}


//----------------validation for city offer cmg.aspx file-----------------------------

//----------------validation ends for city offer cmg.aspx file-----------------------------	

//--------------------------select validation


function goToBookMark(pp)
{

var d,f
d=document.MainForm.select.selectedIndex
f=document.MainForm.select.options[d].text
document.IFrameSelectCountryInner.location.hash = f;
}

function hideContinentLayer(dd)
{

window.parent.window.parent.window.document.getElementById("selectContinent").style.visibility="hidden";
window.parent.window.parent.window.document.getElementById("selectCountry").style.visibility="visible";
window.parent.window.parent.window.document.getElementById("IFrameSelectCountry").src="country.aspx?CN="+dd+""
window.parent.window.parent.window.document.getElementById("IFrameSelectCountry").height=340
}

function passValue(ff)
{

window.parent.window.parent.window.document.getElementById("DestTo").value=ff

window.parent.window.parent.window.document.getElementById("selectCountry").style.visibility="hidden";
}

function CloseWind()
{

window.parent.document.getElementById("selectContinent").style.visibility="hidden";
}

function setConLayer()
{
window.parent.document.getElementById("IFrameSelect").width="267"
window.parent.document.getElementById("IFrameSelect").height="133"
window.parent.document.getElementById("IFrameSelect").scrolling="yes"
}

function DropSelCity(ll)
{

var d,f
d=document.MainForm.select.selectedIndex
f=document.MainForm.select.options[d].text
location.href="country.aspx?CN="+f+""
}
//end of select validation	

//------for fltsummary.aspx-----and flthtlsummary.aspx----------
function checkCheckBox(f){

if (f.agree.checked == false )
{
alert('Please read the Terms and Conditions and check box to acknowledge them.');
return false;
}else
return true;
}
//------for fltsummary.aspx---------------

//travel insuarence page validation for help tec

var buts = new Array();
 buts[0] = 'next';
 buts[1] = 'next_on';
 buts[2] = 'back';
 buts[3] = 'back_on';
 buts[4] = 'help';
 buts[5] = 'help_on';
 buts[6] = 'purchase';
 buts[7] = 'purchase_on';
 buts[8] = 'emailquote';
 buts[9] = 'emailquote_on';
 buts[10] = 'covertable';
 buts[11] = 'covertable_on';
 buts[12] = 'delproc';
 buts[13] = 'delproc_on';

var but = new Array();

function sWap(butName,arrNo) {
 window.document[butName].src = but[arrNo].src;
}
 
function popUpHelp(){
     
 var CenW=(screen.width - 700) /2; 
  var CenH=(screen.height - 360) /2;
   Help=window.open("https://www.ahrisk.net/otis_v3/clientvault/IGL/help/index.htm","Help","width=700,height=360,top="+CenH+",left="+CenW+",toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes");
}

function eMail()	{
 var CenW    = (screen.width - 390) /2;   
 var CenH    = (screen.height - 160) /2; 

 eMailWin=window.open("email.asp","eMailWin","width=390,height=160,top="+CenH+",left="+CenW+",toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes");
}

function coverTable()	{
 var CenW    = (screen.width - 540) /2;   
 var CenH    = (screen.height - 360) /2; 

coverTab=window.open("https://www.ahrisk.net/otis_v3/clientvault/IGL/help/covertable.htm","coverTab","width=540,height=360,top="+CenH+",left="+CenW+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
}

function gothere()
{
	alert('got here step 4');
}


function popUpGlos(i){
 CenW    = (screen.width - 500) /2;   
 CenH    = (screen.height - 300) /2; 
 url='https://www.ahrisk.net/otis_v3/clientvault/IGL/help/glossary.htm#'+i;

 Glos=window.open(url,"Glos","width=500,height=300,top="+CenH+",left="+CenW+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
}
//------------validation of travle insurance ends-----------------------


//------------------function used in booking.aspx------------------
function monthNameString(ll)
{
	if(ll=="00")
	return "Jan"
	if(ll=="01")
	return "Feb"
	if(ll=="02")
	return "Mar"
	if(ll=="03")
	return "Apr"
	if(ll=="04")
	return "May"
	if(ll=="05")
	return "Jun"
	if(ll=="06")
	return "Jul"
	if(ll=="07")
	return "Aug"
	if(ll=="08")
	return "Sep"
	if(ll=="09")
	return "Oct"
	if(ll=="10")
	return "Nov"
	if(ll=="11")
	return "Dec"
}

function monthName(ll)
{
	if(ll=="JAN")
	return 00
	if(ll=="FEB")
	return 01
	if(ll=="MAR")
	return 02
	if(ll=="APR")
	return 03
	if(ll=="MAY")
	return 04
	if(ll=="JUN")
	return 05
	if(ll=="JUL")
	return 06
	if(ll=="AUG")
	return 07
	if(ll=="SEP")
	return 08
	if(ll=="OCT")
	return 09
	if(ll=="NOV")
	return 10
	if(ll=="DEC")
	return 11
}
//-------------------end of function used in booking.aspx-------------

//---onSubmit of travel insurance----------------------------------------------------


function travelSubmit()
{
	if(validDate(document.OnlineSearch.Year0.value, document.OnlineSearch.month0.value, document.OnlineSearch.date0.value)==false)
	{
		alert("Please Selet the Valid date");
		document.OnlineSearch.date0.focus();
		return false;
	}
	if(document.OnlineSearch.Initial0.value=="")
	{	
		alert("Please enter your first name.")
		document.OnlineSearch.Initial0.focus()
		return false
	}
	else if(document.OnlineSearch.Surname0.value=="")
	{	
		alert("Please enter your Surname.") 
		document.OnlineSearch.Surname0.focus()
		return false
	}	
	else if(document.OnlineSearch.address1.value=="")
	{	
		alert("Please enter your Address.")
		document.OnlineSearch.address1.focus()
		return false
	}
	else if(document.OnlineSearch.city.value=="")
	{	
		alert("Please enter your City name.")
		document.OnlineSearch.city.focus()
		return false
	}
	else if(document.OnlineSearch.postcode.value=="")
	{	
		alert("Please enter your Post Code.")
		document.OnlineSearch.postcode.focus()
		return false
	}	
	else if(document.OnlineSearch.telephone.value=="")
	{	
		alert("Please enter your Telephone no.")
		document.OnlineSearch.telephone.focus()
		return false
	}
	else if(document.OnlineSearch.email.value=="")
	{
		alert("Please enter your E-mail address.")
		document.OnlineSearch.email.focus()
		return false
	}
	else if(document.OnlineSearch.email.value.indexOf("@")==-1)
	{
		alert("Please enter your valid E-mail address.")
		document.OnlineSearch.email.focus()
		document.OnlineSearch.email.select()
		return false
	}
	else if(document.OnlineSearch.email.value.indexOf(".")==-1)
	{
		alert("Please enter your valid E-mail address.")
		document.OnlineSearch.email.focus()
		document.OnlineSearch.email.select()
		return false
	}
	else if(!document.OnlineSearch.checkbox.checked)
	{
		alert("Please Read the Terms & Conditions before Booking !")
		document.OnlineSearch.checkbox.focus()		
		return false;
	}
}

//----------------end of trabel insurance on submit------------------------------


//---------date validation where there is only on date either departure or return
function datevalidationfltSearFch(){

	var CurDate= new Date(document.OnlineSearch.BookYr.value, document.OnlineSearch.BookMon.value, document.OnlineSearch.BookDD.value);
	var Dptdate= new Date(document.OnlineSearch.DptMonYr.value.substring(2,7), document.OnlineSearch.DptMonYr.value.substring(0,2), document.OnlineSearch.dptDate.value);

//To Check the Valid Depart Dates

		if(validDate(document.OnlineSearch.DptMonYr.value.substring(2,7), document.OnlineSearch.DptMonYr.value.substring(0,2), document.OnlineSearch.dptDate.value)==false)
		{
		alert("Please Selet the Valid Depart date");
		document.OnlineSearch.dptDate.focus();
		return false;
		}
//To check Depart Date is not Less than the Current Date

		if(Dptdate<=CurDate)
		{
		alert("Depart Date Must be greater than Current date");
		document.OnlineSearch.dptDate.focus();
		return false;
		}
}
//-------------end of date validation whre there is only one date---------------------
//--------for headder innerPage result car_hire etc...-------------------

function headInnHome()
{
	window.parent.document.location.href="default.aspx"
}

function headInnMap()
{
	window.parent.document.location.href="default.aspx?PG=MG"
}

function headInnTravel()
{
	window.parent.document.location.href="default.aspx?PG=TR"
}

function headInnCompany()
{
	window.parent.document.location.href="default.aspx?PG=OC"
}

function headInnContact()
{
	window.parent.document.location.href="default.aspx?PG=CU"
}


function getMonthNameString(num)
{
	var ll=num;
	if(ll==1)
	return "Jan"
	if(ll==2)
	return "Feb"
	if(ll==3)
	return "Mar"
	if(ll==4)
	return "Apr"
	if(ll==5)
	return "May"
	if(ll==6)
	return "Jun"
	if(ll==7)
	return "Jul"
	if(ll==8)
	return "Aug"
	if(ll==9)
	return "Sep"
	if(ll==10)
	return "Oct"
	if(ll==11)
	return "Nov"
	if(ll==12)
	return "Dec"
}
//---------------end of headder inner------------------------------------
function sendValue(DestTo,Destination,DestFrom,dptDate,DptMonYr,retDate,RetMonYr,Adult,Child,infant,sngRoom,twnRoom,dblRoom,tplRoom,AirLine,RequestType,JrnType,rdotype,conDesName,allCountry,desIndex,fulldestination,desttoindex,fromdest,FHDptDate,FHDptMon,FHDptYr,FHRetDate,FHRetMon,FHRetYr)
	{
	document.flthtlSearch.DestTo.value=DestTo;
	document.flthtlSearch.Destination.value=Destination;
	document.flthtlSearch.DestFrom.value=DestFrom;
	document.flthtlSearch.dptDate.value=dptDate;
	document.flthtlSearch.DptMonYr.value=DptMonYr;
	document.flthtlSearch.retDate.value=retDate;
	document.flthtlSearch.RetMonYr.value=RetMonYr;
	document.flthtlSearch.Adult.value=Adult;
	document.flthtlSearch.Child.value=Child;
	document.flthtlSearch.infant.value=infant;
	document.flthtlSearch.sngRoom.value=sngRoom;
	document.flthtlSearch.twnRoom.value=twnRoom;
	document.flthtlSearch.dblRoom.value=dblRoom;
	document.flthtlSearch.tplRoom.value=tplRoom;
	document.flthtlSearch.AirLine.value=AirLine;
	document.flthtlSearch.RequestType.value=RequestType;
	document.flthtlSearch.JrnType.value=JrnType;
	document.flthtlSearch.rdotype.value=rdotype;
	document.flthtlSearch.conDesName.value=conDesName;
	document.flthtlSearch.allCountry.value=allCountry;
	document.flthtlSearch.desIndex.value=desIndex;
	document.flthtlSearch.fulldestination.value=fulldestination;
	document.flthtlSearch.desttoindex.value=desttoindex;
	document.flthtlSearch.fromdest.value=fromdest;
	document.flthtlSearch.FHDptDate.value=FHDptDate;
	document.flthtlSearch.FHDptMon.value=FHDptMon;
	document.flthtlSearch.FHDptYr.value=FHDptYr;
	document.flthtlSearch.FHRetDate.value=FHRetDate;
	document.flthtlSearch.FHRetMon.value=FHRetMon;
	document.flthtlSearch.FHRetYr.value=FHRetYr;
	document.flthtlSearch.method="post";
	document.flthtlSearch.target="_top";
	document.flthtlSearch.action="result.aspx";
	document.flthtlSearch.submit();
	
	}


function provideDayName(Ddayval,Dmonyearval)
{

    var Ddayval2=document.getElementById(Ddayval).value;
    var Dmonyearval2=document.getElementById(Dmonyearval).value;
    var Dmonval=Dmonyearval2.substring(0,2)
	var Dyearval=Dmonyearval2.substring(2,6)
	var Ddate1 = new Date(Dyearval, (Dmonval-1),Ddayval2);
	var myDays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"];
    var day=myDays[Ddate1.getDay()]
    
    if(Ddayval=="FDayMonth" && Dmonyearval=="FDptDateDDMMYY")
    {
    document.getElementById("DptdayName").value=day;
    setvalidDD=Ddayval2;
    }
    
     if(Ddayval=="HDayMonth" && Dmonyearval=="HDptDateDDMMYY")
    {
    document.getElementById("HDptdayName").value=day;
    setvalidDD=Ddayval2;
    }
    
    
      if(Ddayval=="FHDayMonth" && Dmonyearval=="FHDptDateDDMMYY")
    {
    document.getElementById("FHDptdayName").value=day;
    setvalidDD=Ddayval2;
    }
    
    
    if(Ddayval=="FDayMonthRet" && Dmonyearval=="FRetDateDDMMYY")
    {
        if(Ddayval2!="00" && Dmonyearval2!="00")
        {
        document.getElementById("RetdayName").value=day;
        }
        else
        {
        document.getElementById("RetdayName").value="";
        }
    }
    
    if(Ddayval=="HDayMonthRet" && Dmonyearval=="HRetDateDDMMYY")
    {
        if(Ddayval2!="00" && Dmonyearval2!="00")
        {
        document.getElementById("HRetdayName").value=day;
        }
        else
        {
        document.getElementById("HRetdayName").value="";
        }
    }
    
    
    if(Ddayval=="FHDayMonthRet" && Dmonyearval=="FHRetDateDDMMYY")
    {
        if(Ddayval2!="00" && Dmonyearval2!="00")
        {
        document.getElementById("FHRetdayName").value=day;
        }
        else
        {
        document.getElementById("FHRetdayName").value="";
        }
    }
    
    
}

function FlightDayName(Ddayval,Dmonyearval)
{
    var Dmonval=Dmonyearval.substring(0,2)
	var Dyearval=Dmonyearval.substring(2,6)
	var Ddate1 = new Date(Dyearval, (Dmonval-1),Ddayval);
	var myDays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"];
    var day=myDays[Ddate1.getDay()]
    return day;

}

function addoptiondate(FDayMonth2,FDptDateDDMMYY2)
{

var Dpt2date=document.getElementById(FDptDateDDMMYY2).value
var dmonth=Dpt2date.substring(0,2)
var currDateDATA=new Date();
var dmonth2=currDateDATA.getMonth();
if(dmonth2<9)
{
if(dmonth2==0)
dmonth2=dmonth2+""+1
else
dmonth2=0+""+(dmonth2+1)
}
else
{
dmonth2=dmonth2+1
}

var p=document.getElementById(FDayMonth2).value
if(p=="")
{
             document.getElementById(FDayMonth2).options[StartingDate].selected=true
}
else if(p=="00" || (document.getElementById("FDayMonthRet").value=="00" && FDptDateDDMMYY2=="FDayMonthRet"))
{

document.getElementById(FDayMonth2).options[0].selected=true
document.getElementById(FDptDateDDMMYY2).options[11].selected=true
}

}
//for hotel

function addoptiondateH(FDayMonth2,FDptDateDDMMYY2)
{
            var Dpt2date=document.getElementById(FDptDateDDMMYY2).value
            var dmonth=Dpt2date.substring(0,2)
            var currDateDATA=new Date();
            var dmonth2=currDateDATA.getMonth();
                if(dmonth2<9)
                {
                    if(dmonth2==0)
                    {
                    dmonth2=dmonth2+""+1
                    }
                    else
                    {
                    dmonth2=0+""+(dmonth2+1)
                    }
                }
                else
                {
                dmonth2=dmonth2+1
                }

            var p=document.getElementById(FDayMonth2).value
            if(p=="")
            {
                         document.getElementById(FDayMonth2).options[StartingDate].selected=true
            }
            else if(p=="00" || (document.getElementById("HDayMonthRet").value=="00" && FDptDateDDMMYY2=="HDayMonthRet"))
            {
            document.getElementById(FDayMonth2).options[0].selected=true
            document.getElementById(FDptDateDDMMYY2).options[11].selected=true

            }
            }

function addoptiondateFH(FDayMonth2,FDptDateDDMMYY2)
{

var Dpt2date=document.getElementById(FDptDateDDMMYY2).value
var dmonth=Dpt2date.substring(0,2)
var currDateDATA=new Date();
var dmonth2=currDateDATA.getMonth();
if(dmonth2<9)
{
if(dmonth2==0)
dmonth2=dmonth2+""+1
else
dmonth2=0+""+(dmonth2+1)
}
else
{
dmonth2=dmonth2+1
}

var p=document.getElementById(FDayMonth2).value
if(p=="")
{
             document.getElementById(FDayMonth2).options[StartingDate].selected=true
}
else if(p=="00" || (document.getElementById("FHDayMonthRet").value=="00" && FDptDateDDMMYY2=="FHDayMonthRet"))
{
document.getElementById(FDayMonth2).options[0].selected=true
document.getElementById(FDptDateDDMMYY2).options[11].selected=true
}

}
function addOption(FDayMonth1,FDptDateDDMMYY1,no,FDayMonthRet1)
{
emp=document.getElementById(FDayMonth1);
var p=1;
var jd=StartingDate

if(document.getElementById(FDayMonth1).value!="" && document.getElementById(FDayMonth1).value!="00")
{
p=document.getElementById(FDayMonth1).value
jd=p
}

Dptdate=document.getElementById(FDptDateDDMMYY1).value
mDpt=Dptdate.substring(0,2)

var currDateDATA=new Date();
var currmonthno=currDateDATA.getMonth();
var dmonth2=currDateDATA.getMonth();
if(dmonth2<9)
{
if(dmonth2==0)
dmonth2=dmonth2+""+1
else
dmonth2=0+""+(dmonth2+1)
}
else
{
dmonth2=dmonth2+1
}

if(no==2 || no==3 || no==4)
{
mDpt=FDayMonthRet1  //modified by last

}
var i;
var textValue; 
	var textText; 
	var optionItem;
	emp.options[i] = null;
	if(mDpt==00)
	{
	mDpt=1
	} 

if(mDpt==4 || mDpt==6 || mDpt==9 || mDpt==11)   //for months having 30 days
{
var loopval;
if (mDpt==currmonthno)
{
loopval=StartingDate;
}
else
{
loopval=30
}
emp.options[i] = null;
for (i=1; i <=loopval;++i)
{
if(i==0){ }
else
	{
		emp.options[i] = null;
        textValue = i;
       if(i<10)
        {
		textText = 0+""+i;
		}
		else
		{
		textText =i;
		}
		optionItem = new Option( textText, textValue);
		emp.options[i] = optionItem;
		document.getElementById(FDayMonth1).options[1].selected=true
		if(no==0)
		{
		var j=StartingDate
		k=StartingMon=currDate1.getMonth();
		DateString=currDate1.getDate()+"/"+currDate1.getMonth()+"/"+currDate1.getYear();
        var k=StartingMon
		document.getElementById(FDayMonth1).options[1].selected=true
		} 
		}
		}
}


////////////////////////////////////for 31 days//////////////////////////


if(mDpt==1 ||  mDpt==3 || mDpt==5 || mDpt==7 || mDpt==8 || mDpt==10 || mDpt==12 ) // for months having 31 days
{

var loopval;
if (mDpt==currmonthno)
{
loopval=StartingDate;
}
else
{
loopval=31
}
for (i=1; i <=31;++i)
{
emp.options[i] = null;
textValue = i;
		if(i<10)
        {
		textText = 0+""+i;
		}
		else
		{
		textText =i;
		}
		optionItem = new Option( textText,textValue);
		emp.options[i] = optionItem;						
		}
if(no==0)
		{
		var j=StartingDate
		DateString=currDate1.getDate()+"/"+currDate1.getMonth()+"/"+currDate1.getYear();
        var k=StartingMon
		document.getElementById(FDayMonth1).options[j].selected=true;
		document.getElementById(FDptDateDDMMYY1).options[0].selected=true;	
		try
		{
		document.getElementById(FDayMonthRet1).options[0].selected=true;
		}
		catch (e){}		
		} 
else
		{
		try
		{
		        if(FDptDateDDMMYY1=="FRetDateDDMMYY")
		        {
		      
		         document.getElementById(FDayMonth1).options[jd].selected=true;
				}
				else if(FDptDateDDMMYY1=="HRetDateDDMMYY")
		        {
		      
		          document.getElementById(FDayMonth1).options[jd].selected=true;
				}

                else if(FDptDateDDMMYY1=="FHRetDateDDMMYY")
		        {
		          document.getElementById(FDayMonth1).options[jd].selected=true;
				}
                else
                 {
                
				document.getElementById(FDayMonth1).options[p].selected=true;
				
				
        	     }
			
		}
		catch (e)
		{
		        document.getElementById(FDayMonth1).options[1].selected=true;
		}
}
}
if(mDpt==2)
{
for (i=1; i <=28;++i)
{
emp.options[i] = null;
textValue = i;
		if(i<10)
        {
		textText = 0+""+i;
		}
		else
		{
		textText =i;
		}
		textValue =i;
		optionItem = new Option( textText, textValue);
		emp.options[i] = optionItem;
}
}
if(no==0)
		{
		var j=StartingDate
		
		DateString=currDate1.getDate()+"/"+currDate1.getMonth()+"/"+currDate1.getYear();
        var k=StartingMon
		document.getElementById(FDayMonth1).options[j].selected=true;
		document.getElementById(FDptDateDDMMYY1).options[0].selected=true;		
		try
		{
		document.getElementById(FDayMonthRet1).options[0].selected=true;
		}
		catch (e)
		{}	
		} 
else
		{	
		try
		{
		if(mDpt==2 && jd>28)
		{
		jd=1
		}
		
		     if(FDptDateDDMMYY1=="FRetDateDDMMYY")
		        {
		        document.getElementById(FDayMonth1).options[jd].selected=true;
				}
				else if(FDptDateDDMMYY1=="HRetDateDDMMYY")
		        {
		          document.getElementById(FDayMonth1).options[jd].selected=true;
				}
				else if(FDptDateDDMMYY1=="FHRetDateDDMMYY")
		        {
		         document.getElementById(FDayMonth1).options[jd].selected=true;
				}
				else
				{
		 
				document.getElementById(FDayMonth1).options[p].selected=true;
				
				
				}
								
		}
		catch (e)
		{
		document.getElementById(FDayMonth1).options[1].selected=true;
	
		}
}

if(no==2 && FDayMonthRet1!=0)
{
var monValue;
   if(FDayMonthRet1<10)
   {
	    monValue = 0+""+FDayMonthRet1;
	    
   }
	else
	{
	monValue =FDayMonthRet1;
	}
	
	
	for(k=0;k<12;k++)//change by sachin from 11 to 12
    {
    var kval=0;
    kval=document.getElementById(FDptDateDDMMYY1).options[k].value;
    kval=kval.substring(0,2)
   
        if(monValue==kval)
        {
        
     document.getElementById(FDptDateDDMMYY1).options[k].selected=true;
     
    
        break;
        }
    }
}

}

function createMonthoptions(smonthselect)
{
var i;
var textValue; 
var textText; 
var optionItem;
crMonthDPT=document.getElementById(smonthselect);
var Ddate1 = new Date();
var myMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
var month=myMonths[Ddate1.getMonth()]
var arraylength;
var yearvalue=Ddate1.getFullYear()
for(j=0;j<myMonths.length;j++)
{
    if(month==myMonths[j])
    {
    arraylength=j;
    break;
    }
}
     for(i=0;i<=11;i++)
        {
        var monVal=0;
        monVal=arraylength+1;
                    if(monVal < 10)
                    {
		            textValue = 0+""+monVal;
		            }
		            else
		            {
		            textValue=monVal;
		            }
                    textValue =textValue+""+yearvalue;
                    if(arraylength<=12)
                    {
                    textText=myMonths[arraylength]+" "+yearvalue;
	                optionItem = new Option( textText,textValue);
	                crMonthDPT.options[i] = optionItem;
	                arraylength=arraylength+1;    
	                }
	                if(arraylength==12)
	                {
	                arraylength=0;
	                yearvalue=yearvalue+1;
	                }
	                 if(i==10 && smonthselect=="FRetDateDDMMYY")
                        {
                            optionItem = new Option( "Just one way","00");
	                        crMonthDPT.options[11] = optionItem;
//	                        crMonthDPT.options[11].selected=true;
                        }
                                              
                       
        }
}
function GetMonthVal(mon)
{
switch(mon)
	{
	case 0: return "JAN"; break;
	case 1: return "FEB"; break;
	case 2: return "MAR"; break;
	case 3: return "APR"; break;
	case 4: return "MAY"; break;
	case 5: return "JUN"; break;
	case 6: return "JUL"; break;
	case 7: return "AUG"; break;
	case 8: return "SEP"; break;
	case 9: return "OCT"; break;
	case 10: return "NOV"; break;
	case 11: return "DEC"; 
	}
}





//NOT IN USE

function FHDptValidDaysInOut()
{
	var flag=0;
	var DOutDay=document.getElementById("dOut1").innerHTML;
	var day=document.FltHtlSearch.FHDayMonth.value;
	
	var dayOut=DOutDay.split(",");
	if(DOutDay.toUpperCase()=="DAILY" || DOutDay.toUpperCase()=="--")
	{
		return true;
	}
	else
	{
		
	for(var i=0;i<dayOut.length;i++)
		{
			var dd=day.toUpperCase();
			var ddd="";
			if(i==0)
			{
			ddd=dayOut[i].toUpperCase();
			}
			else
			{
				dayOut[i]=dayOut[i].substr(1);
				ddd=dayOut[i].toUpperCase();
				
			}
		dd="\""+dd.substr(1)+"\"";
		ddd="\""+ddd+"\"";
		
		if(dd==ddd)
				{
					
					flag=1;
					break;
				}
		}
		if(flag==1)
		{
			
			return true;
		}
		else
		{
			return false;
		}
	
	} 
}

function FHRetValidDaysInOut()
{
	var flag=0;
	var DOutDay=document.getElementById("dIn1").innerHTML;
	var day=document.FltHtlSearch.FHDayMonthRet.value;
	var dayOut=DOutDay.split(",");
	if(DOutDay.toUpperCase()=="DAILY" || DOutDay.toUpperCase()=="--")
	{
	return true;
	}
	else
	{
		for(var i=0;i<dayOut.length;i++)
		{
		var dd=day.toUpperCase();
		var ddd="";
		if(i==0)
			{
			ddd=dayOut[i].toUpperCase();
			}
			else
			{
				dayOut[i]=dayOut[i].substr(1);
				ddd=dayOut[i].toUpperCase();
				
			}
		dd="\""+dd.substr(1)+"\"";
		ddd="\""+ddd+"\"";
		
		if(dd==ddd)
				{
					flag=1;
					break;
				}
		}
		if(flag==1)
		{
			return true;
		}
		else
		{
			return false;
		}
	
	} 
}

function setdptdate(tempDayMon,tempDateDDMMYY)
{
				var days=0;
				var ttldptdays;
				var Cdptdate=document.getElementById(tempDayMon).value;
				var CpreMMYY=document.getElementById(tempDateDDMMYY).value;
				var CdptMonth=CpreMMYY.substring(0,2)
				 if((CdptMonth==2 && predd<=25)|| ((CdptMonth==4 || CdptMonth==6 || CdptMonth==9 || CdptMonth==11)  &&  predd<=27) || ((CdptMonth==1 ||  CdptMonth==3 || CdptMonth==5 || CdptMonth==7 || CdptMonth==8 || CdptMonth==10 || CdptMonth==12 ) && Cdptdate <=28))
				  {	
				  document.getElementById(tempDayMon).selectedIndex=((document.getElementById(tempDayMon).selectedIndex)+3)				
				  }
				else
				{
						if(CdptMonth==2)
						  {
							days=28;
						  }
						  else if(CdptMonth==4 || CdptMonth==6 || CdptMonth==9 || CdptMonth==11)
						  {
							 days=30;
						  }
						  else if(CdptMonth==1 ||  CdptMonth==3 || CdptMonth==5 || CdptMonth==7 || CdptMonth==8 || CdptMonth==10 || CdptMonth==12 )
						  {
							 days=31
						  }
				}	
				if(days>0)
				{
					ttldptdays=days-parseInt(document.getElementById(tempDayMon).value);
					ttldptdays=3-ttldptdays;
					document.getElementById(tempDayMon).selectedIndex=ttldptdays
					document.getElementById(tempDateDDMMYY).selectedIndex+1
				}
				
}

function setdates()
{	
	try
		{
			
				var predd=parseInt(document.getElementById("FDayMonth").value);
				var preMMYY=document.getElementById("FDptDateDDMMYY").value;
				var prechkMM=preMMYY.substring(0,2)				
									  if((prechkMM==2 && predd<=11)|| ((prechkMM==4 || prechkMM==6 || prechkMM==9 || prechkMM==11)  &&  predd<=13) || ((prechkMM==1 ||  prechkMM==3 || prechkMM==5 || prechkMM==7 || prechkMM==8 || prechkMM==10 || prechkMM==12 ) && predd<=14))
									  {								  
										  	document.getElementById("FDayMonthRet").selectedIndex=document.getElementById("FDayMonth").selectedIndex+17;
											document.getElementById("FRetDateDDMMYY").selectedIndex=(document.getElementById("FDptDateDDMMYY").selectedIndex);
									  }
									  
									  else
									  {
												var totaladDays;						   
												if(prechkMM==2 && predd > 11)
												   {
													 totaladDays=(28-predd);									
												   }
												 else if ((prechkMM==4 || prechkMM==6 || prechkMM==9 || prechkMM==11)  &&  predd > 13)
												   {
													   totaladDays=(30-predd);		
												   }
												 else if ((prechkMM==1 ||  prechkMM==3 || prechkMM==5 || prechkMM==7 || prechkMM==8 || prechkMM==10 || prechkMM==12 ) && predd>14)
												  {
													  totaladDays=(31-predd);	
												  }
													totaladDays=(17-totaladDays);	
													document.getElementById("FRetDateDDMMYY").selectedIndex=document.getElementById("FDptDateDDMMYY").selectedIndex+1;
													document.getElementById("FDayMonthRet").selectedIndex=totaladDays;		
									  }
				provideDayName('FDayMonthRet','FRetDateDDMMYY');
		}
		catch(err){}
		addOption('FDayMonthRet','FRetDateDDMMYY');	
}




function setallvalues(fulldepseg1,fullretseg1,deplen1,retlen1,totlen1,BaseFare,Tax,TotalFlightPrice,BaseFarePP,TaxPP,totaladult,BaseFareChild,TaxChild,totalchild,BaseFareInf,TaxInf,totalinf,alternate,srctotal,ftype)
	{
		try{document.getElementById("alternate").value=alternate;}catch(e){}
		var retlp;
		var totval=fulldepseg1.split("-alt")
		for(var i=0;i<=deplen1-1;i++)
		{
			retlp=i;
			var sp=totval[i].split("-")
			if(i=="0")
			{
				
			document.getElementById("DestFromCode"+i).value=sp[0];
			document.getElementById("DepTime"+i).value=sp[1];
			document.getElementById("DepDay"+i).value=sp[2];
			document.getElementById("DepDate"+i).value=sp[3] + "-" + sp[4] + "-" + sp[5];
			document.getElementById("TIn"+i).value=sp[6];
			document.getElementById("TOut"+i).value=sp[7];
			document.getElementById("Airline"+i).value=sp[8];
			document.getElementById("FlightNo"+i).value=sp[9];
			document.getElementById("DestToCode"+i).value=sp[10];
			document.getElementById("Cls"+i).value=sp[11];
			document.getElementById("InOut"+i).value=sp[12];
			document.getElementById("ArrDate"+i).value=sp[13] + "-" + sp[14] + "-" + sp[15];
			document.getElementById("ArrDay"+i).value=sp[16];
			document.getElementById("ArrTime"+i).value=sp[17];
			}
			else
			{
			document.getElementById("DestFromCode"+i).value=sp[1];
			document.getElementById("DepTime"+i).value=sp[2];
			document.getElementById("DepDay"+i).value=sp[3];
			document.getElementById("DepDate"+i).value=sp[4] + "-" + sp[5] + "-" + sp[6];
			document.getElementById("TIn"+i).value=sp[7];
			document.getElementById("TOut"+i).value=sp[8];
			document.getElementById("Airline"+i).value=sp[9];
			document.getElementById("FlightNo"+i).value=sp[10];
			document.getElementById("DestToCode"+i).value=sp[11];
			document.getElementById("Cls"+i).value=sp[12];
			document.getElementById("InOut"+i).value=sp[13];
			document.getElementById("ArrDate"+i).value=sp[14] + "-" + sp[15] + "-" + sp[16];
			document.getElementById("ArrDay"+i).value=sp[17];
			document.getElementById("ArrTime"+i).value=sp[18];
			}
		} 
		
		var totval_ret=fullretseg1.split("-alt")
		var retloopstart=parseInt(retlp)+1;
		for(var i=0;i<=retlen1-1;i++)
		{
			var sp=totval_ret[i].split("-")
			if(i=="0")
			{
				
			document.getElementById("DestFromCode"+retloopstart).value=sp[0];
			document.getElementById("DepTime"+retloopstart).value=sp[1];
			document.getElementById("DepDay"+retloopstart).value=sp[2];
			document.getElementById("DepDate"+retloopstart).value=sp[3] + "-" + sp[4] + "-" + sp[5];
			document.getElementById("TIn"+retloopstart).value=sp[6];
			document.getElementById("TOut"+retloopstart).value=sp[7];
			document.getElementById("Airline"+retloopstart).value=sp[8];
			document.getElementById("FlightNo"+retloopstart).value=sp[9];
			document.getElementById("DestToCode"+retloopstart).value=sp[10];
			document.getElementById("Cls"+retloopstart).value=sp[11];
			document.getElementById("InOut"+retloopstart).value=sp[12];
			document.getElementById("ArrDate"+retloopstart).value=sp[13] + "-" + sp[14] + "-" + sp[15];
			document.getElementById("ArrDay"+retloopstart).value=sp[16];
			document.getElementById("ArrTime"+retloopstart).value=sp[17];
			}
			else
			{
			document.getElementById("DestFromCode"+retloopstart).value=sp[1];
			document.getElementById("DepTime"+retloopstart).value=sp[2];
			document.getElementById("DepDay"+retloopstart).value=sp[3];
			document.getElementById("DepDate"+retloopstart).value=sp[4] + "-" + sp[5] + "-" + sp[6];
			document.getElementById("TIn"+retloopstart).value=sp[7];
			document.getElementById("TOut"+retloopstart).value=sp[8];
			document.getElementById("Airline"+retloopstart).value=sp[9];
			document.getElementById("FlightNo"+retloopstart).value=sp[10];
			document.getElementById("DestToCode"+retloopstart).value=sp[11];
			document.getElementById("Cls"+retloopstart).value=sp[12];
			document.getElementById("InOut"+retloopstart).value=sp[13];
			document.getElementById("ArrDate"+retloopstart).value=sp[14] + "-" + sp[15] + "-" + sp[16];
			document.getElementById("ArrDay"+retloopstart).value=sp[17];
			document.getElementById("ArrTime"+retloopstart).value=sp[18];
			}
			retloopstart=retloopstart+1;
		} 
	
	document.getElementById("countDS").value=parseInt(totlen1);
	document.getElementById("Cls").value=document.getElementById("Cls0").value;
	document.getElementById("Airline").value=document.getElementById("Airline0").value;
	document.getElementById("BaseFare").value=BaseFare;
	document.getElementById("Tax").value=Tax;
	document.getElementById("tTotalFlightPrice").value=TotalFlightPrice;
	document.getElementById("BaseFaread").value=BaseFarePP;
	document.getElementById("Taxad").value=TaxPP;
	document.getElementById("totalad").value=totaladult;
	document.getElementById("BaseFareChild").value=BaseFareChild;
	document.getElementById("TaxChild").value=TaxChild;
	document.getElementById("childtotal").value=totalchild;
	document.getElementById("BaseFareInf").value=BaseFareInf;
	document.getElementById("TaxInf").value=TaxInf;
	document.getElementById("inftotal").value=totalinf;
	
	//document.getElementById("BaseFareWithoutComm").value=srctotal;
	try
	{	document.getElementById("TotalComm").value=srctotal;  }       //anju	
	catch(e){}
	document.getElementById("frtype").value=ftype;
	//document.ChousenContinue.action="FpSummary.aspx";
	document.ChousenContinue.submit();
	}
	
function setallvalues_ret(fulldepseg1,deplen1,BaseFare,Tax,TotalFlightPrice,BaseFarePP,TaxPP,totaladult,BaseFareChild,TaxChild,totalchild,BaseFareInf,TaxInf,totalinf,alternate,srctotal,ftype)
	{
		try{document.getElementById("alternate").value=alternate;}catch(e){}
		var retlp;
		var totval=fulldepseg1.split("-alt")
		for(var i=0;i<=deplen1-1;i++)
		{
			retlp=i;
			var sp=totval[i].split("-")
			if(i=="0")
			{
				
		
			document.getElementById("DestFromCode"+i).value=sp[0];
			document.getElementById("DepTime"+i).value=sp[1];
			document.getElementById("DepDay"+i).value=sp[2];
			document.getElementById("DepDate"+i).value=sp[3] + "-" + sp[4] + "-" + sp[5];
			document.getElementById("TIn"+i).value=sp[6];
			document.getElementById("TOut"+i).value=sp[7];
			document.getElementById("Airline"+i).value=sp[8];
			document.getElementById("FlightNo"+i).value=sp[9];
			document.getElementById("DestToCode"+i).value=sp[10];
			document.getElementById("Cls"+i).value=sp[11];
			document.getElementById("InOut"+i).value=sp[12];
			document.getElementById("ArrDate"+i).value=sp[13] + "-" + sp[14] + "-" + sp[15];
			document.getElementById("ArrDay"+i).value=sp[16];
			document.getElementById("ArrTime"+i).value=sp[17];
			}
			else
			{
			document.getElementById("DestFromCode"+i).value=sp[1];
			document.getElementById("DepTime"+i).value=sp[2];
			document.getElementById("DepDay"+i).value=sp[3];
			document.getElementById("DepDate"+i).value=sp[4] + "-" + sp[5] + "-" + sp[6];
			document.getElementById("TIn"+i).value=sp[7];
			document.getElementById("TOut"+i).value=sp[8];
			document.getElementById("Airline"+i).value=sp[9];
			document.getElementById("FlightNo"+i).value=sp[10];
			document.getElementById("DestToCode"+i).value=sp[11];
			document.getElementById("Cls"+i).value=sp[12];
			document.getElementById("InOut"+i).value=sp[13];
			document.getElementById("ArrDate"+i).value=sp[14] + "-" + sp[15] + "-" + sp[16];
			document.getElementById("ArrDay"+i).value=sp[17];
			document.getElementById("ArrTime"+i).value=sp[18];
			}
		} 
		
		
	document.getElementById("countDS").value=parseInt(deplen1);
	document.getElementById("Cls").value=document.getElementById("Cls0").value;
	document.getElementById("Airline").value=document.getElementById("Airline0").value;
	document.getElementById("BaseFare").value=BaseFare;
	document.getElementById("Tax").value=Tax;
	document.getElementById("tTotalFlightPrice").value=TotalFlightPrice;
	document.getElementById("BaseFaread").value=BaseFarePP;
	document.getElementById("Taxad").value=TaxPP;
	document.getElementById("totalad").value=totaladult;
	document.getElementById("BaseFareChild").value=BaseFareChild;
	document.getElementById("TaxChild").value=TaxChild;
	document.getElementById("childtotal").value=totalchild;
	document.getElementById("BaseFareInf").value=BaseFareInf;
	document.getElementById("TaxInf").value=TaxInf;
	document.getElementById("inftotal").value=totalinf;
	
	document.getElementById("BaseFareWithoutComm").value=srctotal;
	try
	{	document.getElementById("TotalComm").value=BaseFare-srctotal;  }       //anju	
	catch(e){}
	document.getElementById("frtype").value=ftype;
	//document.ChousenContinue.action="FpSummary.aspx";
	document.ChousenContinue.submit();
	}