var firstCal;
var firstCallLeft;
firstCal=1;
firstCallLeft=1;
//---------setting height of the frame----------

//--end of setting height of the frame---------

//------------------------------------------------submit validation for different submit pages-------------
function validfrom(curmonth,curyr)
	{
		var expmonsel=document.ThisForm.issumon.value;
		var i;
		while(document.ThisForm.issumon.options.length)
			{
				var d=document.ThisForm.issumon.options.length-1;
				document.ThisForm.issumon.options.remove(d);
			}
		var curr_year =curyr-2000;
		if (curr_year>10)
		{
			curr_year="0"+curr_year;
		}
		if (document.ThisForm.ISSYear.value==curr_year)
			{
				for (i=0;i<=curmonth-1;i++)
					{
						document.ThisForm.issumon.options[i] =  new Option();
						document.ThisForm.issumon.options[i].text = i+1;
						document.ThisForm.issumon.options[i].value = i+1;
					}
			}
		else
			{
				for (i=0;i<=11;i++)
					{
					document.ThisForm.issumon.options[i] =  new Option();
					document.ThisForm.issumon.options[i].text = i+1;
					document.ThisForm.issumon.options[i].value = i+1;
					}
			}
			if (expmonsel>document.ThisForm.issumon.options.length)
			{
				document.ThisForm.issumon.value=document.ThisForm.issumon.options.length;
			}
		else
			{
				document.ThisForm.issumon.value=expmonsel;
			}
	}
// end validetion for credirt card issue date
// fn start validetion for credirt card valid date
function validtill(expmonth,expyr)
	{
		var expmonsel=document.ThisForm.ExpMon.value;
		var i;
		while(document.ThisForm.ExpMon.options.length)
			{
				var d=document.ThisForm.ExpMon.options.length-1;
				document.ThisForm.ExpMon.options.remove(d);
			}
		var curr_year =expyr-2000;
		if (curr_year<10)
		{
			curr_year="0"+curr_year;
		}
		var monthexp=expmonth;
		if (document.ThisForm.ExpYear.value==curr_year)			{
				for (i=0;i<=11-expmonth+1;i++)
					{
						document.ThisForm.ExpMon.options[i] =  new Option();
						document.ThisForm.ExpMon.options[i].text = monthexp;
						document.ThisForm.ExpMon.options[i].value = monthexp;
						monthexp=monthexp+1;
					}
			}
		else
			{
				for (i=0;i<=11;i++)
					{
					document.ThisForm.ExpMon.options[i] =  new Option();
					document.ThisForm.ExpMon.options[i].text = i+1;
					document.ThisForm.ExpMon.options[i].value = i+1;
					}
			}
			
		if (expmonsel>document.ThisForm.ExpMon.options[0].value)
			{
				document.ThisForm.ExpMon.value=expmonsel;
			}
		else
			{
				document.ThisForm.ExpMon.value=document.ThisForm.ExpMon.options[0].value;
			}
		
	}

function ValidateSearch() //for flight page
{
remove_XS_whitespace(document.OnlineSearch.DestTo);(document.OnlineSearch.DestTo.value=="")
		{
		alert("Please Enter the Destination Name");
		document.OnlineSearch.DestTo.focus();
		return false;
		}
		
		if(document.OnlineSearch.DestTo.value==parseInt(document.OnlineSearch.DestTo.value))
		{
		alert("Invalid Destination name");
		document.OnlineSearch.DestTo.focus();
		document.OnlineSearch.DestTo.select();
		return false;
		}

		if(document.OnlineSearch.checkbox.checked)
		{
			if(document.OnlineSearch.RdJrnType[0].checked)
			{	if(datevalidation()==false)
				{ return false;
				}
			}
			else if(document.OnlineSearch.RdJrnType[1].checked)
			{
				if(datevalidationfltSearch()==false)
				{ return false;}
			}

		}
	

		if(document.OnlineSearch.checkbox.checked==false)
		{
			if(datevalidation()==false)
			{ return false;	}
		}

		
		
		
return true;
}



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
{
remove_XS_whitespace(document.OnlineSearch.DestTo);
	
		if(document.OnlineSearch.DestTo.value=="")
		{
		alert("Please fill a destination");
		document.OnlineSearch.DestTo.focus();
		document.OnlineSearch.DestTo.select();
		return false;
		}

	
		if(document.OnlineSearch.DestTo.value==parseInt(document.OnlineSearch.DestTo.value))
		{
		alert("Invalid Destination name");
		document.OnlineSearch.DestTo.focus();
		document.OnlineSearch.DestTo.select();
		return false;
		}


		if(datevalidation()==false)
		{
			
		return false;
		}
		
				
return true;
}
//-----------------------------end of fltLeftSearch.aspx ------------------



function FlightHotelSearch()  //return for flthtlsearch.aspx 
{


		if(datevalidation()==false)
		{
		return false;
		}

		var adValue,twValue,doValue,siValue,triValue,total
		adValue=new Number(document.OnlineSearch.Adult.value)
		twValue=new Number(document.OnlineSearch.twnRoom.value)
		doValue=new Number(document.OnlineSearch.dblRoom.value)
		siValue=new Number(document.OnlineSearch.sngRoom.value)
		triValue=new Number(document.OnlineSearch.tplRoom.value)
	
		twValue=twValue*2
		doValue=doValue*2
		triValue=triValue*3
		total=(twValue+doValue+siValue+triValue)
		if(total!=adValue)
		{
		alert("Invalid Room Selection")
		document.OnlineSearch.sngRoom.focus();
		return false;
		}

		var sI
		sI=document.OnlineSearch.Destination.selectedIndex
		if(sI==0)
		{
		alert("Please choose a destination")
		document.OnlineSearch.Destination.focus()
		return false;
		}

		if(dateDiff()==false)
		{
		return false;
		}

}


function hotelSearch() //for hotel search
{
		if(datevalidation()==false)
		{
		return false;
		}
		
		var sI
		sI=document.OnlineSearch.Destination.selectedIndex
		if(sI==0)
		{
		alert("Please choose a destination")
		document.OnlineSearch.Destination.focus()
		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;
		}

}

// end of hotel search

//travel




// endstravel


//----------validation for htlsummary.asp page------------------------------------

function readcondition()
{
	if(!document.ThisForm.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 CheckConfirmation()
{
var answer;

answer = confirm("We are now ready to process your booking and charge your card. \n \n  All booking details must be correct before you proceed, as YOU WILL NOT BE GIVEN A FURTHER OPPORTUNITY TO CHANGE THEM. To go back to the form and check these details, press CANCEL. \n \n To proceed with the booking and charge your card, press OK. \n \n Validating your payment details can take up to 60 seconds. Please do not click the BOOK NOW, REFRESH, BACK, or STOP buttons until the next page is displayed.")

if (answer !=0) 
{ 
return true;
} 
else
{
return false;
}

}

function validateHtlccinfo()
{

	

	//if(checkrequired(ThisForm)==false)
	if(checkrequired(document.ThisForm)==false)
	{
		return false;
	}		
		
//x=CheckCardNumber(ThisForm);
	x=CheckCardNumber(document.ThisForm);
	if(x==false)
	{
		return false;
	}
	
if(CheckConfirmation()==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()
{
	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.agree.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.");
}


/*************************************************************************\
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 (document.getElementById("requiredCountry").value!="UK")
    {
   
        if ((((tempobj.type=="text"||tempobj.type=="textarea") && tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s" && tempobj.selectedIndex==0))&& tempobj.name=="requiredpcode")
         {
       
               
         }
         else if(((tempobj.type=="text"||tempobj.type=="textarea") && tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s" && tempobj.selectedIndex==0))
         {
            pass=false;
	        break;
         }
    }
    else
    {
    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 ensure that all fields are correctly 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.all.item("IFrameSelectCountryInner").src=""
window.parent.document.all.item("selectCountry").style.visibility="hidden";
}


function showContinent()
{
window.document.all.item("selectCountry").style.visibility="visible";
}

function goBack()
{
document.all.item("IFrameSelectCountryInner").src=""
window.parent.document.all.item("selectCountry").style.visibility="hidden";
window.parent.document.all.item("selectContinent").style.visibility="visible";
}
function passValueflthtl(vCode,vDestName)
{

window.parent.window.parent.window.document.all.item("DestinationText").value=vDestName
window.parent.window.parent.window.document.all.item("Destination").value=vCode
window.parent.window.parent.window.document.all.item("selectCountry").style.visibility="hidden";
}



function setConLayer()
{
window.parent.document.all.item("IFrameSelect").width="267"
window.parent.document.all.item("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) + 1);
		if(Dptdate<=D)
		{
		alert("We are unable to process any bookings made within 24 hours of departure.  If you would like to travel within 24 hours, \n please contact our sales team on  0871 666 0050");
		document.OnlineSearch.dptDate.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.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

		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;
		}
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 Selet 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.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("RetMonYr").options[l+1].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("RetMonYr").options[l].selected=true;
					return false;
					}
				}
				else if(dDpt<=28)
				{
					document.all.item("RetDate").options[mRet-1].selected=true;
					l=document.OnlineSearch.DptMonYr.selectedIndex
						document.all.item("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.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("RetMonYr").options[l+1].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("RetMonYr").options[l].selected=true;
					return false;
					}
				}
				else if(dDpt<29)
				{
					document.all.item("RetDate").options[mRet-1].selected=true;
					l=document.OnlineSearch.DptMonYr.selectedIndex
					document.all.item("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.all.item("RetDate").options[mRet-1].selected=true;
							document.all.item("RetMonYr").options[l+1].selected=true;
							return false;
							}
							else if(l==10)
							{
							document.all.item("RetDate").options[mRet-1].selected=true;
							document.all.item("RetMonYr").options[l].selected=true;
							return false;
							}
					} //end of Dtp > than 30
					
					else if(dDpt<=28)
					{
						document.all.item("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.all.item("RetDate").options[mRet-1].selected=true;
							document.all.item("RetMonYr").options[l+1].selected=true;
							return false;
							}
							else if(l==10)
							{
							document.all.item("RetDate").options[mRet-1].selected=true;
							document.all.item("RetMonYr").options[l].selected=true;
							return false;
							}
					} //end of Dtp > than 30
					
					else if(dDpt<28)
					{
						document.all.item("RetDate").options[mRet-1].selected=true;
						l=document.OnlineSearch.DptMonYr.selectedIndex
						document.all.item("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.all.item("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.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("RetMonYr").options[l+1].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("RetMonYr").options[l].selected=true;
					return false;
					}
				} // end of if dDpt >=30
				
			else if(dDpt<30)
				{
					document.all.item("RetDate").options[mRet-1].selected=true;
					var I,l
					I=document.OnlineSearch.DptMonYr.length
					l=document.OnlineSearch.DptMonYr.selectedIndex
					
					if(l<10)
					{
					document.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("RetMonYr").options[l].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("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.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("RetMonYr").options[l+1].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("RetMonYr").options[l].selected=true;
					return false;
					}
			}
			else if(dDpt<30)
			{
				document.all.item("RetDate").options[mRet-1].selected=true;
				var I,l
				I=document.OnlineSearch.DptMonYr.length
				l=document.OnlineSearch.DptMonYr.selectedIndex
					if(l<10)
					{
					document.all.item("RetDate").options[dDpt].selected=true;						
					document.all.item("RetDate").options[dDpt].selected=true;						
					document.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("RetMonYr").options[l].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("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.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("RetMonYr").options[l+1].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.all.item("RetDate").options[mRet-1].selected=true;
					document.all.item("RetMonYr").options[l].selected=true;
					return false;
					}
   			 } //end of Dtp > than 29
					
			else if(dDpt<=28)
			{
				document.all.item("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.all.item("RetDate").options[2].selected=true;
					document.all.item("RetMonYr").options[l+1].selected=true;
					return false;
					}
					else if(l==10)
					{
					document.all.item("RetDate").options[2].selected=true;
					document.all.item("RetMonYr").options[l].selected=true;
					return false;
					}
				} //end of Dtp >= than 28
					
			else if(dDpt<=27)
				{
					document.all.item("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.all.item("RetDate").options[1].selected=true;						
								document.all.item("RetMonYr").options[l+1].selected=true;
								return false;
								}
								else if(l==10)
								{
								document.all.item("RetDate").options[mRet-1].selected=true;
								document.all.item("RetMonYr").options[l].selected=true;
								return false;
								}
						}// end of dDpt==26
						if(l<10)
						{
						document.all.item("RetDate").options[dDpt].selected=true;						
						document.all.item("RetDate").options[dDpt].selected=true;						
						document.all.item("RetDate").options[mRet-1].selected=true;
						document.all.item("RetMonYr").options[l].selected=true;
						return false;
						}
							
						else if(l==10)
						{
						document.all.item("RetDate").options[mRet-1].selected=true;
						document.all.item("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.all.item("IFrameCalander").src="calender.htm"
		resizeCaller1();
		window.document.all.item("calander").style.visibility="visible";
		window.document.all.item("calType").value=Fr
	}
	else
	{
		window.document.all.item("calander").style.visibility="visible";
		resizeCaller1();
		window.document.all.item("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-----------------------------------------------------

function ShowHideLayerLeft(x,Fr)
{
	
	if(firstCallLeft==1)
	{
		alert("it is page of PAXINFORMATION.JS")
		window.document.all.item("IFrameCalander").src="calender.htm"
		resizeCaller1();
		window.document.all.item("calander").style.visibility="visible";
		window.document.all.item("calType").value=Fr
	}
	else
	{
		window.document.all.item("calander").style.visibility="visible";
		resizeCaller1();
		window.document.all.item("calType").value=Fr
	}
firstCallLeft=0;
}


//-------------- end showing and hiding of calender on home page validation-----------------------------------------------------


function resetTabs() //where all tabs are to be set as deactivated
{
window.parent.document.home.src="images/top_home1.jpg"
window.parent.document.map.src="images/top_map2.jpg"
window.parent.document.travel.src="images/top_mytravelguide1.jpg"
window.parent.document.company.src="images/top_ourcompany1.jpg"
window.parent.document.contact.src="images/top_contactus1.jpg"
}

function setHomeTab()  //for search page
{
window.parent.document.home.src="images/top_home2.jpg"
}
//-----------------------------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.all.item("selectContinent").style.visibility="hidden";
window.parent.window.parent.window.document.all.item("selectCountry").style.visibility="visible";
window.parent.window.parent.window.document.all.item("IFrameSelectCountry").src="country.aspx?CN="+dd+""
window.parent.window.parent.window.document.all.item("IFrameSelectCountry").height=340
}

function passValue(ff)
{

window.parent.window.parent.window.document.all.item("DestTo").value=ff

window.parent.window.parent.window.document.all.item("selectCountry").style.visibility="hidden";
}

function CloseWind()
{

window.parent.document.all.item("selectContinent").style.visibility="hidden";
}

function setConLayer()
{
window.parent.document.all.item("IFrameSelect").width="267"
window.parent.document.all.item("IFrameSelect").height="133"
window.parent.document.all.item("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 datevalidationfltSearch(){

	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 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"
}



//---------------end of headder inner------------------------------------
function ChangeDay()
{
	var gDeptDate= new Date(document.OnlineSearch.DptMonYr.value.substring(2,7), document.OnlineSearch.DptMonYr.value.substring(0,2), document.OnlineSearch.dptDate.value);
	var dValue=gDeptDate.getDay();
	var dayName
if(dValue=="0")
dayName="Sun"
else if(dValue=="1")
dayName="Mon"
else if(dValue=="2")
dayName="Tue"
else if(dValue=="3")
dayName="Wed"
else if(dValue=="4")
dayName="Thu"
else if(dValue=="5")
dayName="Fri"
else if(dValue=="6")
dayName="Sat"

	document.all.item("dayMonth").value=" "+dayName
	ChangeDayRet();
}

function ChangeDayRet()
{
	var gDeptDate= new Date(document.OnlineSearch.RetMonYr.value.substring(2,7), document.OnlineSearch.RetMonYr.value.substring(0,2), document.OnlineSearch.retDate.value);
	var dValue=gDeptDate.getDay();
	var dayName
	if(dValue=="0")
	dayName="Sun"
	else if(dValue=="1")
	dayName="Mon"
	else if(dValue=="2")
	dayName="Tue"
	else if(dValue=="3")
	dayName="Wed"
	else if(dValue=="4")
	dayName="Thu"
	else if(dValue=="5")
	dayName="Fri"
	else if(dValue=="6")
	dayName="Sat"

	document.all.item("dayMonthRet").value=" "+dayName
window.parent.scroll(0,0);
}

/*function checkExpiryDate()
	{
	var fromMonth;
	var fromYear;
	var toMonth;
	var toYear;
	fromMonth=document.getElementById("issumon").value;
	if()
	fromYear=document.getElementById("ISSYear").value;
	toMonth=document.getElementById("ExpMon").value;
	toYear=document.getElementById("ExpYear").value;
	}
	*/
	

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"
}




/* THis is new code for card validation suman code for credit car validation */
function monthNames(ll)
{
	if(ll.toLowerCase()=="jan" || ll.toLowerCase()=="feb" ||ll.toLowerCase()=="mar" || ll.toLowerCase()=="apr" || ll.toLowerCase()=="may" || ll.toLowerCase()=="jun" || ll.toLowerCase()=="jul" || ll.toLowerCase()=="aug" || ll.toLowerCase()=="sep" || ll.toLowerCase()=="oct" || ll.toLowerCase()=="nov" || ll.toLowerCase()=="dec")
	{
		return true;
	}
	else if (ll=="")
        {
        return true;
        }
	else
	{
		return false;
	}
}
function monthValue(val)
	{
		var monthval=val.toLowerCase()
	if(monthval=="jan"){return 0;}
	else if(monthval=="feb"){return 1;}
	else if(monthval=="mar"){return 2;}
	else if(monthval=="apr"){return 3;}
	else if(monthval=="may"){return 4;}
	else if(monthval=="jun"){return 5;}
	else if(monthval=="jul"){return 6;}
	else if(monthval=="aug"){return 7;}
	else if(monthval=="sep"){return 8;}
	else if(monthval=="oct"){return 9;}
	else if(monthval=="nov"){return 10;}
	else if(monthval=="dec"){return 11;}
	}
function cardValidation(form)
{
	var currYear=new Date().getFullYear();
		
	if(form.ExpMon.value.length!=3)
		{
			alert("Please enter expiry Month\'s name properly")
			form.ExpMon.focus();
			return false;
		}
	if(monthNames(form.ExpMon.value)==false)
		{
			alert("Please enter expiry Month\'s name properly")
			form.ExpMon.focus();
			return false;
		}
		
		if(monthNames(form.issumon.value)==false)
		{
			alert("Please enter Valid Month\'s name properly")
			form.issumon.focus();
			return false;
		}
	if(form.ExpYear.value.length!=4)
		{
			alert("Please enter  expiry year\'s name properly")
			form.ExpYear.focus();
			return false;
		}
		
		
	if(parseInt(form.ExpYear.value)>=2100)
		{
			alert("Invalid expiry year.")
			form.ExpYear.focus();
			return false;
		}
	if(form.ISSYear.value!="")
		{
		if(parseInt(form.ExpYear.value)<=parseInt(form.ISSYear.value))
			{
				alert("Invalid issue year or expiry year.")
				form.ExpYear.focus();
				return false;
			}
		}
		if(parseInt(form.ExpYear.value)==new Date().getFullYear() && parseInt(monthValue(form.ExpMon.value))<parseInt(new Date().getMonth()))
		{
			alert("Card expiry year or expiry month is invalid")
			form.ExpYear.focus();
			return false;
		}

	if(parseInt(form.ExpYear.value)<new Date().getFullYear())
		{
			alert("Card expiry year is invalid")
			form.ExpYear.focus();
			return false;
		}
	
}
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.CardNumber.value.length < 14  || form.CardNumber.value.length > 19 )
	{
	    alert("Please enter a valid 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("CVV No. should at least be three digit. ");
		form.CVVNo.focus();
		return false;
		}
		else if (form.CVVNo.value.length > 2)
		{
		 var cardtype1 = form.CardType.selectedIndex;
        		 var  newSel = form.CardType.options[cardtype1].value;
         if(newSel=="AmExCard")
            {
            }
         else
            {
                if(form.CVVNo.value.length > 3 )
                {
                   alert("Please enter a valid CVV Number.");
                  form.CVVNo.value="";
		          form.CVVNo.focus();
		           return false;
		
                }
            }
       }
   
		
		
		
	
if(cardValidation(form)==false)
	{
		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;
}



//pawan changes for  insurance
function funchkpre2()
{
if(document.ThisForm.chkpre2.checked)
	{
	document.ThisForm.chkpre2.value="yes";


	}
	else
	{
	document.ThisForm.chkpre2.value="no";

	}
}

function funPremium()
	{
		


document.getElementById("tot_amt").innerHTML =parseFloat(document.getElementById("totalPrice").value).toFixed(2);
/* parseFloat('<%=Format(val(request("totalPrice")),"#,###.00")%>').toFixed(2);*/
//ins
//document.getElementById("Total").innerHTML = parseFloat('<%=Format(val(request("totalPrice")),"#,###.00")%>').toFixed(2);
		document.getElementById("totalamt").value=parseFloat(document.getElementById("totalPrice").value).toFixed(2);

		if(document.ThisForm.chkpre.checked)
		{
			var totval = parseFloat(document.getElementById("totalPrice").value).toFixed(2);//parseFloat('<%=Format(val(request("totalPrice")),"#,###.00")%>');

			var prem=parseFloat(document.getElementById("ins").value);

			if (document.getElementById("ins").value=="N/A")
				{
				document.getElementById("tot_amt").value = parseFloat(totval).toFixed(2);
//document.getElementById("Total").innerHTML = totval.toFixed(2);
				document.getElementById("totalamt").value=parseFloat(totval).toFixed(2);
				}
			else
				{
						document.getElementById("tot_amt").innerHTML = (parseFloat(totval)+prem).toFixed(2);
						document.getElementById("totalamt").value=(parseFloat(totval)+prem).toFixed(2);
						//var finalAmt=document.getElementById("finamt").innerHTML;
						//finalAmt=(parseFloat(finalAmt)+parseFloat(prem));
						//document.getElementById("finamt").innerHTML=finalAmt.toFixed(2);
					
				}



		}
	}


var y="";
  function AddIns()
	{
	if(y=="")
		{
		y=document.getElementById("tdIns").innerHTML;		
		}
	
		 if(document.ThisForm.chkpre.checked)
		{

		document.getElementById("tdIns").innerHTML=y;
		//alert(document.getElementById("tdIns").innerHTML);
		}
		else
		{
		y=document.getElementById("tdIns").innerHTML
		document.getElementById("tdIns").innerHTML="";
	//document.ThisForm.chkpre.checked=false;
		}
  }
  
  
   var ins="";
  function AddIns2()
	{
	if(ins=="")
		{
		ins=document.getElementById("tdIns2").innerHTML;
			
		}
	
		 if(document.ThisForm.chkpre2.checked)
		{

		document.getElementById("tdIns2").innerHTML=ins;
		//alert(document.getElementById("tdIns").innerHTML);
		}
		else
		{
		ins=document.getElementById("tdIns2").innerHTML
		document.getElementById("tdIns2").innerHTML="";
		}
  }
 
  var ins_new="";
  function AddIns_new()
	{
	if(ins_new=="")
		{
		ins_new=document.getElementById("tdins_new").innerHTML;
			
		}
	
		 if(document.ThisForm.insurance.checked)
		{

		document.getElementById("tdins_new").innerHTML=ins_new;
		//alert(document.getElementById("tdIns").innerHTML);
		}
		else
		{
document.getElementById("chkpre").checked=false;		
		ins_new=document.getElementById("tdins_new").innerHTML



//document.ThisForm.chkpre.checked=false;
		document.getElementById("tdins_new").innerHTML="";
		
		}
  }
var trans="";
  function func_transfer()
	{
	if(trans=="")
		{
		trans=document.getElementById("transfer").innerHTML;
			
		}
	
		 if(document.ThisForm.chktransfer.checked)
		{

		document.getElementById("transfer").innerHTML=trans;
		//alert(document.getElementById("tdIns").innerHTML);
		}
		else
		{
		trans=document.getElementById("transfer").innerHTML
		document.getElementById("transfer").innerHTML="";
		}
  }
  
  
  
  function AddPremium()
{
if(document.ThisForm.chkpre.checked)
	{
	document.ThisForm.chkpre.value="yes";

	}
	else
		{
		document.ThisForm.chkpre.value="no";

		}
}


function Discount()
	{
		if(document.ThisForm.txtDisc.value=="")
				{
				document.getElementById("Disc").value=0;
				}
			else
				{
				document.getElementById("Disc").value=document.ThisForm.txtDisc.value;
				}
		}
		


function changeMonth(month)
{
	  
	if (month.toUpperCase() =="JAN")
	{
		return 1;
	}
	else if (month.toUpperCase() =="FEB")
	{
		return 2;
	}
	else if (month.toUpperCase() =="MAR")
	{
		return 3;
	}
	else if (month.toUpperCase() =="APR")
	{
		return 4;
	}
	else if (month.toUpperCase() =="MAY")
	{
		return 5;
	}
	else if (month.toUpperCase() =="JUN")
	{
		return 6;
	}
	else if (month.toUpperCase() =="JUL")
	{
		return 7;
	}
	else if (month.toUpperCase() =="AUG")
	{
		return 8;
	}
	else if (month.toUpperCase() =="SEP")
	{
		return 9;
	}
	else if (month.toUpperCase() =="OCT")
	{
		return 10;
	}
	else if (month.toUpperCase() =="NOV")
	{
		return 11;
	}
	else if (month.toUpperCase() =="DEC")
	{
		return 12;
	}
}
function checkfields(event,in_id,validation_type) 
{
	
	var key = null;
	if (window.event) 
	{
		//ie
		key = window.event.keyCode;
	}
	 else if (event.which)
	 {
		//Mozilla,Safari
		key = event.which;
	 }

	if (key != null) 
	{
		if(validation_type=='string_data')
		{
		
			if ((key  > 64 && key  < 91) || (key  > 96 && key  < 123)) 
			{
			event.returnValue = true; 
			} 
			else 
		{
			event.returnValue = false;
			document.getElementById(in_id).value="";
		}
			
		}
		if(validation_type=='num_data')
		{
		
			if (key >= 48 && key <= 57)	 
			{
			event.returnValue = true; 
			} 
			else 
		{
			document.getElementById(in_id).value="";
			event.returnValue = false;
		}
			
		}
		

	}
}

function LowerCase(Textboxid)
{
var txtval=Textboxid
var abc
abc=document.getElementById(txtval).value.toLowerCase()
document.getElementById(txtval).value=document.getElementById(txtval).value.toLowerCase()
}

function checkValidation(formId)
{

if(formId.elements["requiredName"].value.length<3)
    {
    alert("Enter Name carefully");
    formId.elements["requiredName"].focus();
    return false;
    }
    
if(formId.elements["requiredMail"].value.length<3)
    {
    alert("Enter Email Address carefully");
     formId.elements["requiredMail"].focus();
    return false;
    }


if(emailCheck(formId.elements["requiredMail"].value)!=true)
    {
    
        alert("Enter Email Address carefully");
         formId.elements["requiredMail"].focus();
        return false;
	}
	
if(formId.elements["requiredSubject"].value.length<3)
    {
        alert("Enter subject of mail  carefully");
        formId.elements["requiredSubject"].focus();
        return false;
    }

if(formId.elements["requiredComment"].value.length<10)
    {
        alert("Length of message at least 10 characters.");
        formId.elements["requiredComment"].focus();
        return false;
    }

}

function sendSubScript()
{
if(emailCheck(document.getElementById("reqMail").value)!=true)
    {
        document.getElementById("reqMail").focus();
    }
	else
	{
		sendMail(document.getElementById("reqMail").value);
	}

}



function sendMail(emailID)
{
xHttp=GetXmlHttpObject();
if (xHttp==null) 
{
alert("Your browser does not support Ajax");
return;
}
var address="subscript.aspx";
address=address+"?requiredMail="+emailID;
xHttp.onreadystatechange=function()
{
  if (xHttp.readyState==4)
    {     
    if (xHttp.status==200)
        {   
        if(xHttp.responseText.toUpperCase()=="TRUE")
             {            
            document.getElementById("result").style.visibility="visible";           
            }          
        }
    }
};

xHttp.open("GET",address,true);
xHttp.send(null); 
}


function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
xmlHttp=new XMLHttpRequest();
}

catch (e)
{

try
{
xmlHttp=new  ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}


