var MONTH_NAMES=new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function toggle(target){
	window.onresize = null;
	
	obj=document.getElementById(target);
	
	if (obj.style.display=='inline'){
		obj.style.display='none';
	}
	else{
		obj.style.display='inline';
	}

}
function tabChange(id,action) {
	if (id=="1") {
		document.getElementById("tab1").style.display = "block";
		document.getElementById("tab2").style.display = "none";
		document.getElementById("tab3").style.display = "none";
		document.getElementById("atab1").className="selected";
		document.getElementById("atab2").className="activeTab";
		document.getElementById("atab3").className="activeTab";
		document.getElementById("activetab1").className="activeselected";
		document.getElementById("activetab2").className="tablink";
		document.getElementById("activetab3").className="tablink";
		
	}
	if (id=="2") {
		document.getElementById("tab2").style.display = "block";
		document.getElementById("tab1").style.display = "none";
		document.getElementById("tab3").style.display = "none";
		document.getElementById("atab2").className="selected";
		document.getElementById("atab1").className="activeTab";
		document.getElementById("atab3").className="activeTab";
		document.getElementById("activetab2").className="activeselected";
		document.getElementById("activetab1").className="tablink";
		document.getElementById("activetab3").className="tablink";
	}
	if (id=="3") {
		document.getElementById("tab3").style.display = "block";
		document.getElementById("tab1").style.display = "none";
		document.getElementById("tab2").style.display = "none";
		document.getElementById("atab3").className="selected";
		document.getElementById("atab1").className="activeTab";
		document.getElementById("atab2").className="activeTab";
		document.getElementById("activetab3").className="activeselected";
		document.getElementById("activetab1").className="tablink";
		document.getElementById("activetab2").className="tablink";
	}
}
function printLayout() {
	var strCode="";
	var strFilePath = getQueryString("Image");
	 
	var strFileType = strFilePath.substring(strFilePath.lastIndexOf(".")+1, strFilePath.length);
	if (strFileType=="gif" || strFileType=="jpg" || strFileType=="jpeg") {
		strCode = "<img src='" + strFilePath + "' alt=''>";
	} else if (strFileType=="mpg" || strFileType=="mpeg" || strFileType=="wmv" || strFileType=="asf") {
		strCode = composeASF(strFilePath);
		//strCode = composeASF(intWidth, intHeight, strFilePath);
	} else if (strFileType=="wma" ) {
		strCode = composeWMA(strFilePath);
	} else if (strFileType=="swf") {
		strCode = composeSWF(intWidth, intHeight, strFilePath);
	} else if (strFileType=="mov") {
		strCode = composeMOV(intWidth, intHeight, strFilePath);
	}
	document.write(strCode);
}
function getimage(input, intWidth, intHeight) {
	var strCode="";
	var strFilePath = input;
	var strFileType = strFilePath.substring(strFilePath.lastIndexOf(".")+1, strFilePath.length);
	if (strFileType=="gif" || strFileType=="jpg" || strFileType=="jpeg") {
		strCode = "<img src='" + strFilePath + "' width='" + intWidth + "' alt=''>";
	} else if (strFileType=="mpg" || strFileType=="mpeg" || strFileType=="wmv" || strFileType=="asf") {
		strCode = composeASF(strFilePath);
		//strCode = composeASF(intWidth, intHeight, strFilePath);
	} else if (strFileType=="wma" ) {
		strCode = composeWMA(strFilePath);
	} else if (strFileType=="swf") {
		strCode = composeSWF(intWidth, intHeight, strFilePath);
	} else if (strFileType=="mov") {
		strCode = composeMOV(intWidth, intHeight, strFilePath);
	} else if (strFileType=="pdf") {
		strCode = "<a href='" + strFilePath + "' target='_blank' class='blue_bold'>Click here</a> to download";
	}
	document.write(strCode);
}
function tnc() {
	document.getElementById("bodyoverlay").style.display="block";
}
function closeoverlay() {
	document.getElementById("bodyoverlay").style.display="none";
}
function openWindow(url,toolbar ,x ,y) {
	subWindow=open(url, "newwin", "left=10,screenX=0,top=10,location=0,status=yes, resizable=yes, toolbar="+toolbar+", scrollbars=yes, width="+x+", height="+y+"");
	if(subWindow.opener==null) subWindow.opener=self;
}

function winBRopen(frmurl, winame) {  
	var winleft = (screen.width - 190) / 2;
	var wintop = (screen.height - 230) / 2;
	features = 'width=190,height=230,location=0,toolbar=no,status=no,resizable=no,top='+wintop+',left='+winleft+'';
	Win = window.open(frmurl, winame, features);
	Win.window.focus();
}

function openFullscreen(frmurl, scrollbar, wd, hg) {
	if (wd==0) {
	var wd=screen.width-50;
	}
	if (hg==0) {
	var hg=screen.height-100;
	}
	winame='wininfo';
	features='scrollbars='+scrollbar+',width='+ wd +',height='+ hg +',left=0,screenX=0,top=0,screenY=0,status=0';
	window.open(frmurl,winame,features);

}
function validNum(check, err_msg){
   str=new String(check.value)
   if(isNaN(str) == true ){
      alert(err_msg)
	  check.focus();
	  return false;
   }
   if(check.value<0) {
   	alert(err_msg)
   	check.focus();
   	return false;
   }
}
function isMoney(str){
	var i;
 	if (str.length == 0)
		return false;
 	for (i=0; i<str.length; i++){
		ch = str.charAt(i);
		if ((ch < '0' || ch > '9') && (ch != '.'))
			return false;

		if (ch == '.')
			break;
	}
 	if (i == str.length)
		return true;

	for (++i; i<str.length; i++){
		ch = str.charAt(i);
		if (ch < '0' || ch > '9')
			return false;
	}
 	return true;
}
function isNumeric(val) {
	var digits="0123456789";
	for (var i=0; i < val.length; i++) {
		if (digits.indexOf(val.charAt(i))==-1) {	return false; }
	}
	return true;
}
function emptyfield(check,err_msg){
   if (check.value == ""){
      alert(err_msg);
	  check.focus();
	  return false;
   }
}
function IsInvalidInput(badChars, userInput){
	var re = new RegExp(badChars);
	if ( re.test(userInput) )
		return true;
	else
		return false;
}
function isAlphabets(check, msg) {
	var result=true;
	var val = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ';

	if (check.value == "") result=false;
	for (i=0; i<check.value.length; i++) {
		if (val.indexOf(check.value.charAt(i),0) == -1) result=false;
	}
	if(result==false) {
		alert(msg);
		check.focus();
		return false;
	}
	return
}
function isAlphanum(check, msg) {
	var result=true;
	var val = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';

	if (check.value == "") result=false;
	for (i=0; i<check.value.length; i++) {
		if (val.indexOf(check.value.charAt(i),0) == -1) result=false;
	}
	if(result==false) {
		alert(msg);
		check.focus();
		return false;
	}
	return
}
//if(isAlphanum(frm.passportno, "Passport Number is not valid, only alphabets and numbers allowed")==false) return;
/*if (IsInvalidInput("[~!#`@\"&\r\n\^\|<>%&\\\\]", frm.passportno.value) ){
	alert("Passport Number is not valid, only alphabets allowed")
	frm.passportno.focus();
	return;
}*/
//if(isAlphabets(frm.password, "Please enter Alphanumeric Password.")==false) return;
//if(isAlphanum(frm.password, "Please enter Alphanumeric Password.")==false) return;
function valid(vl,errm) // varying number of arguments
{
	var i;
	validated=true;
	// scan regular expressions
	for (i=2;i<valid.arguments.length;i++) 
	{
		var rx;
		//alert(valid.arguments[i]);
		rx=new RegExp(valid.arguments[i]);
		if ((a=rx.exec(vl))!=null && a[0].length==vl.length) {
			//alert("output:" + a[0]);
			return true;  // ok
		}
	}
	// no matches...
	alert(errm);
	validated=false;  // tell onsubmit if necessary
	return false;
}

function checkOneEmail(check, err_msg)
{
	// [\w-_]+(\.[\w-_]+)*\@+[\w-_]+(\.[\w-_]+)+
	//alert(vl);
	rv=valid(check,err_msg,"[\\w-_]+(\\.[\\w-_]+)*\\@+[\\w-_]+(\\.[\\w-_]+)+");
	return rv;
}
 
function checkBox(check,err_msg){
   var counter=0;
   for(var i=0;i<check.length;i++)
   {
     if(check[i].checked)
	 {
	   counter=counter+1;
	 }
   }
   if(counter < 1 )
   {
     alert(err_msg);
	 check[0].focus();
	 return false;
   }
}
function checkcreditcard(frm){
	
	/*for (var j=0; j<frm.cardtype.length; j++){
		if (frm.cardtype[j].checked){
	var cmk=frm.cardtype[j].value;
	      }
	}*/
	
	var cmk=frm.cardtype.value;
 	var cno = frm.cardno.value; //Card number
	var cno = cno.replace(/ /g, "");
	var flag=true

	//########## Check Visa ##########
	if(cmk=="VISA"){
	    if ((cno.length == 13 || cno.length == 16) && (cno.substring(0,1) == 4)){
		flag=true
	    }else{
		flag=false;
	    }
	}

	//########## Check Mastercard ##########
	if(cmk=="MasterCard"){
	var firstdig=cno.substring(0,1);
	var seconddig=cno.substring(1,2);
	  if ((cno.length == 16 || cno.length == 19) && (firstdig == 5) && ((seconddig >= 1) && (seconddig <= 5))){
	      flag=true
	  }else{
		flag=false;
	  }
	}

	//########## Check Diners ##########
	if(cmk=="DINERS"){
	firstdig = cno.substring(0,1);
	  seconddig = cno.substring(1,2);
	  if ((cno.length == 14 || cno.length == 17)  && (firstdig == 3) && ((seconddig == 0) || (seconddig == 6) || (seconddig == 8))){
	      flag=true
	  }else{
		flag=false;
	  }
	}

	//########## Check Amex ##########
	if(cmk=="AMEX"){
	 firstdig = cno.substring(0,1);
	  seconddig = cno.substring(1,2);
	  if (((cno.length == 15)  || (cno.length == 18)) && (firstdig == 3) && ((seconddig == 4) || (seconddig == 7))){
		flag=true
	  }else{
		flag=false;
	   }
	}
	return flag
}
function checkExpireDate(dd,dmyr,ed,emyr) { // d is text value
  	dmyrarr = dmyr.split('/');
	dDay = dd;
	dMth = dmyrarr[0];
	dYr = dmyrarr[1];
 	emyrrarr = emyr.split('/');
	eDay = ed;
	eMth = emyrrarr[0];
	eYr = emyrrarr[1];
 	d = dYr + LZ(dMth) + LZ(dDay);
    e = eYr + LZ(eMth) + LZ(eDay);
	d1 = parseInt(d)+0; //yyyymmdd
	e1 = parseInt(e)+0; //yyyymmdd
	//alert(d1);
	//alert(e1);
   	if (d1>e1) {
		return false;
	}
	return true;	
} 
function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function

function trimLeadingZero(str) {
	if (str.charAt(0) == "0")
		return trimLeadingZero(str.substr(1))
	else
		return str
}
function LZ(x) {return(x<0||x>9?"":"0")+x}
function ValidateDate(dDay, dMthYr) {
  	var d="312831303130313130313031";
	var yr;
	var sDate = parseInt(dDay.length + dMthYr.length);
	/* For invalid dates, return false */
	if (sDate.length>0 && sDate.length<8) return false;
	myrarr = dMthYr.split('/');
	dMonth = myrarr[0];
	dYear = myrarr[1];
 	// Expected inDate format: ddmmyyyy Oct 2010
	//dd = sDate.substring(0,2);
	//mm = sDate.substring(2,4);
	dd = LZ(dDay);
	mm =LZ(dMonth);
	yy = dYear;

	/* Now, convert the string yr1 into a numeric and test for leap year.
	If it is, change the end of month day string for Feb to 29  */		
	
	var isLeap = false;
	yy=yy*1;
	if (yy%400==0) isLeap = true
	else if (yy%100==0) isLeap = false
	else if (yy%4==0) isLeap = true;
	if (isLeap) d=d.substring(0,2)+"29" + d.substring(4,d.length);
	
	/* Pick the end of month day from the d string for this month. */

	pos=(mm*2)-2;
	ld=d.substring(pos,pos+2)+0;
	if (dd<1||dd>ld)
		return false;
	else if (mm<1||mm>12)
		return false;
	else if (yy<1870||yy>2050)
		return false;

	return true;		

}
function CheckDate(value,format) {
		
	if (value == null || value.length != format.length) return false;
	
	var d="312831303130313130313031";
	var yr;
	var nIndYear = format.indexOf("YYYY");
	var nIndMonth = format.indexOf("MM");
	var nIndDay = format.indexOf("DD");

	var dYear = parseInt(value.substring(nIndYear, nIndYear+4));
	var dMonth = parseInt(trimLeadingZero(value.substring(nIndMonth, nIndMonth + 2))) ;
	var dDay = parseInt(trimLeadingZero(value.substring(nIndDay, nIndDay + 2)));

	var sDate = parseInt(dDay.length + dMonth.length + dYear.length);
	
	//alert("CheckDate " + dYear + "-" + dMonth + "-" + dDay);	
	

	// Expected inDate format: ddmmyyyy
	//dd = sDate.substring(0,2);
	//mm = sDate.substring(2,4);
	dd = LZ(dDay);
	mm = LZ(dMonth);
	yy = dYear;

	/* Now, convert the string yr1 into a numeric and test for leap year.
	If it is, change the end of month day string for Feb to 29  */		
	
	var isLeap = false;
	yy=yy*1;
	if (yy%400==0) isLeap = true
	else if (yy%100==0) isLeap = false
	else if (yy%4==0) isLeap = true;
	if (isLeap) d=d.substring(0,2)+"29" + d.substring(4,d.length);
	
	/* Pick the end of month day from the d string for this month. */

	pos=(mm*2)-2;
	ld=d.substring(pos,pos+2)+0;
	if (dd<1||dd>ld)
		return false;
	else if (mm<1||mm>12)
		return false;
	else if (yy<1870||yy>2050)
		return false;

	return true;		

}
function DateDiff(strInterval, dtStart, dtEnd) {
 var dtStart = new Date(dtStart);
 if (isNaN(dtStart)) dtStart = new Date();
 var dtEnd = new Date(dtEnd);
 if (isNaN(dtEnd)) dtEnd = new Date();
 switch (strInterval) {
  case "s":return parseInt((dtEnd - dtStart) / 1000);
  case "n":return parseInt((dtEnd - dtStart) / 60000);
  case "h":return parseInt((dtEnd - dtStart) / 3600000);
  case "d":return parseInt((dtEnd - dtStart) / 86400000);
  case "w":return parseInt((dtEnd - dtStart) / (86400000 * 7));
  case "m":return (dtEnd.getMonth()+1)+((dtEnd.getFullYear()-dtStart.getFullYear())*12) - (dtStart.getMonth()+1);
  case "y":return dtEnd.getFullYear() - dtStart.getFullYear();
 }
}
function settodaydate() {
	var today=new Date()
	var year=today.getFullYear();
	var month=today.getMonth()+1;
	var day = today.getDate();
	var todaydate = year + "/" + month + "/" + day + " 00:00:00";
	return todaydate;
}
function setselectdate(dtStr) {
	depdate = dtStr;
	depdatearr = dtStr.split('-');
	var year = depdatearr[2];
	var month= depdatearr[1];
	var day  = depdatearr[0];
	var selectdate = year + "/" + month + "/" + day + " 00:00:00";
	return selectdate;
}
function setformatdate(dtStr, dtformat) {
	sdate = dtStr;
	sdatearr = dtStr.split('-');
	var year = sdatearr[2];
	var month= sdatearr[1];
	var day  = sdatearr[0];
	var setformatdate = "";
	if (dtformat == "ddmmmyyyy"){
		setformatdate = day + " " + MONTH_NAMES[month-1] + " " + year + "";
	} else if (dtformat == "dd-mm-yyyy"){
		setformatdate = day + "-" + month + "-" + year + "";
	}
	
	return setformatdate;
}
function showAge(dtStr){ 
 	var d = dtStr.split('-');
 	var today=new Date(); 
	var bday=new Date(d[2],d[1],d[0]); 
	var by=bday.getFullYear(); 
	var bm=bday.getMonth()-1; 
	var bd=bday.getDate(); 
	var age=0; var dif=bday; 
	while(dif<=today){ 
	var dif = new Date(by+age,bm,bd); 
	age++; 
	} 
	age +=-2 ; 
	return age; 
} 

function chk_promotionsformold(frm) {
	var todaydate			= settodaydate();
	var txtdepartdate		= setselectdate(trim(frm.txtdepartdate.value));
	var txtreturndate		= setselectdate(trim(frm.txtreturndate.value));
	var blackoutdate		= trim(frm.blackoutdate.value);
	var blackoutdateret		= trim(frm.blackoutdateret.value);
	var travel_depfr		= setselectdate(trim(frm.promo_depfr.value));
	var promo_datedep		= setselectdate(trim(frm.promo_datedep.value));
 	var departdateexpire	= DateDiff("d",promo_datedep,txtdepartdate);
	var travelfrom			= DateDiff("d",travel_depfr,txtdepartdate);
	var departeffdate		= "";
	var departflightno		= frm.departflightno.value;
	var departflightRet		= departflightno.split("#%");
	var departflightcnt     = departflightRet.length;
	var departeffdatestr	= departflightRet[1];
	var departeffmsgstr	    = departflightRet[2];
	if (departflightcnt > 1)  {
		 departeffdate      = setselectdate(trim(departeffdatestr));
		 departeffdatevalid	= DateDiff("d",txtdepartdate, departeffdate);
 		 if (departeffdatevalid > 1) {
			 alert(departeffmsgstr);
			 return;
		 }
	 }
 
	var returnflightno		= frm.returnflightno.value;
	var returnflightnoRet	= returnflightno.split("#%");
	var returneffdatestr	= returnflightnoRet[1];
	var returneffmsgstr	    = returnflightnoRet[2];
	if (returneffdatestr !="")  {
		 returneffdate      = setselectdate(trim(returneffdatestr));
		 returneffdatevalid	= DateDiff("d",txtreturndate, returneffdate);
 		 if (returneffdatevalid > 1) {
			 alert(returneffmsgstr);
			 return;
		 }
	}
	if (travelfrom < 0) {
		frm.txtdepartdate.focus();
		alert("Please select Departure From "+setformatdate(frm.promo_depfr.value,"ddmmmyyyy")+" onward");
		return;
	}
	if (frm.noofpax.value == 1){
		if(emptyfield(frm.familyname1,"Please  fill in (1) Family Name!")==false) return;
		if(emptyfield(frm.givenname1,"Please  fill in (1) Given Name!")==false) return;
		/*
		if(emptyfield(frm.age1,"Please  fill in (1) Age!")==false) return; 
		if (frm.age1.value != "") {
			if (!isNumeric(frm.age1.value)){
				alert("Please fill in valid (1) Age in numeric value!");
				frm.age1.focus();
				return;
			}

		}
		*/
	} else {
		if(emptyfield(frm.familyname1,"Please  fill in (1) Family Name!")==false) return;
		if(emptyfield(frm.givenname1,"Please  fill in (1) Given Name!")==false) return; 
		/*
		if(emptyfield(frm.age1,"Please  fill in (1) Age!")==false) return; 
		if (frm.age1.value != "") {
			if (!isNumeric(frm.age1.value)){
				alert("Please fill in valid (1) Age in numeric value!");
				frm.age1.focus();
				return;
			}

		}
		*/
		if (frm.noofpax.value == 2){
			//if (frm.familyname2.value!=""||frm.givenname2.value!=""||frm.age2.value!=""){
				if(emptyfield(frm.familyname2,"Please fill in (2) Family Name!")==false) return;
				if(emptyfield(frm.givenname2,"Please  fill in (2) Given Name!")==false) return; 
				/*
				if(emptyfield(frm.age2,"Please  fill in (2) Age!")==false) return; 
				if (frm.age2.value != "") {
					if (!isNumeric(frm.age2.value)){
						alert("Please fill in valid (2) Age in numeric value!");
						frm.age2.focus();
						return;
					}
				}
				*/
			//}
		}
		if (frm.noofpax.value == 3){
			if (frm.familyname3.value!=""||frm.givenname3.value!=""){
				if(emptyfield(frm.familyname3,"Please  fill in (3) Family Name!")==false) return;
				if(emptyfield(frm.givenname3,"Please  fill in (3) Given Name!")==false) return; 
				/*
				if(emptyfield(frm.age3,"Please  fill in (3) Age!")==false) return; 
				if (frm.age3.value != "") {
					if (!isNumeric(frm.age3.value)){
						alert("Please fill in valid (3) Age in numeric value!");
						frm.age3.focus();
						return;
					}
				}
				*/
			}

		}
		if (frm.noofpax.value == 4){
			if (frm.familyname4.value!=""||frm.givenname4.value!=""){
				if(emptyfield(frm.familyname4,"Please  fill in (4) Family Name!")==false) return;
				if(emptyfield(frm.givenname4,"Please  fill in (4) Given Name!")==false) return; 
				/*
				if(emptyfield(frm.age4,"Please  fill in (4) Age!")==false) return; 
				if (frm.age4.value != "") {
					if (!isNumeric(frm.age4.value)){
						alert("Please fill in valid (4) Age in numeric value!");
						frm.age4.focus();
						return;
					}
				}
				*/
			}
		}
	}
  	
	if(emptyfield(frm.noofadult,"Please fill in Number of Adult in numeric value!")==false) return;
	if(emptyfield(frm.noofchildren,"Please fill in Number of Children in numeric value!")==false) return;
	if(emptyfield(frm.noofinfant,"Please fill in Number of Infant in numeric value!")==false) return;
	if (!isNumeric(frm.noofadult.value)){
		alert("Please fill in valid Number of Adult in numeric value!");
		frm.noofadult.focus();
		return;
	}
	if (!isNumeric(frm.noofchildren.value)){
		alert("Please fill in Number of Children in numeric value!");
		frm.noofchildren.focus();
		return;
	}
 	if (!isNumeric(frm.noofinfant.value)){
		alert("Please fill in Number of Infant in numeric value!");
		frm.noofinfant.focus();
		return;
	}
	if(emptyfield(frm.fullname,"Please fill in Name!")==false) return;
	if(emptyfield(frm.contactno,"Please fill in Contact No!")==false) return;
	if(emptyfield(frm.email,"Please fill in Email (Correspondence Email Address)!")==false) return;
	if(checkOneEmail(frm.email.value,"Please fill in Valid Email (Correspondence Email Address)")==false) {
		frm.email.focus();
	   	return;
	}
	/*
	if (frm.email2.value != "") {
		if(checkOneEmail(frm.email2.value,"Please fill in Valid Email (Second Email Address, if any)")==false) {
			frm.email2.focus();
	   		return;
		}
	}
	if(emptyfield(frm.cardname,"Please fill in Name of card holder")==false) return;
	if(checkcreditcard(frm)==false) {
		alert("Please complete your credit card details and ensure your Credit Card is correct");
		frm.cardno.focus();
 		return;
	}
	
	if(emptyfield(frm.cardno,"Please fill in Credit Card")==false) return;
	if (frm.cardexpirydate.value == "" || frm.cardexpirydate2.value == "")
	{
		alert("Please fill in Expiry Date as MM/YYYY");
		frm.cardexpirydate.focus();
		return;
	}
	var now=new Date();
	var mth=now.getMonth()+1;
	var yr = now.getYear() ;
	if (frm.cardexpirydate2.value <= yr){
		if (frm.cardexpirydate.value <= mth ) {
			alert("Please ensure Expiry Date is valid")
			frm.cardexpirydate.focus();
			return;
		}
	}
	if(emptyfield(frm.cardname2,"Please fill in Name as feature in the card ")==false) return;
	*/
	//departflightno

	
	if (!CheckDate(trim(frm.txtdepartdate.value),"DD-MM-YYYY")){
		frm.txtdepartdate.focus();
 		alert ("Departure Date that you had entered is an invalid date format (DD-MM-YYYY).");
		return;
	}	
	if (!CheckDate(trim(frm.txtreturndate.value),"DD-MM-YYYY")){
		frm.txtreturndate.focus();
 		alert ("Return Date that you had entered is an invalid date format (DD-MM-YYYY).");
		return;
	}	
	
    //var my=DateDiff("d","2004/12/1 00:00:00","2004/12/5 00:00:00");
	if (departdateexpire>0){
		alert("Please select Departure Date before "+frm.promo_datedep.value+"!");
		return false;
	}
	//Blackout for Departure Date
  	var strArgs = blackoutdate.split(',');
	for (var i=0;i<strArgs.length;i++)
	{
		var sdateArr = strArgs[i].split('-');
		var year = sdateArr[2];
		var month= sdateArr[1];
		var day  = sdateArr[0];
		var strblackdate = unescape(year + "/" + month + "/" + day + " 00:00:00");
		sdate = unescape(txtdepartdate)
 		if (sdate==strblackdate) {
			if (frm.cty_errmsg1.value != ""){
				alert(frm.cty_errmsg1.value+"\nPlease re-select a different Departure Date. \nThank You.");
				return false;
			} else {
				alert("We are sorry to inform you that "+blackoutdate+" are not available.\nPlease re-select a different Departure Date. \nThank You.");
 				return false;
			}
		}
 
 	} 
 	//Blackout for Return Date
 	var strArgr = blackoutdateret.split(',');
	for (var i=0;i<strArgr.length;i++)
	{
		var sdateArs = strArgr[i].split('-');
		var year = sdateArs[2];
		var month= sdateArs[1];
		var day  = sdateArs[0];
		var strblackdateret = unescape(year + "/" + month + "/" + day + " 00:00:00");
		sdate = unescape(txtreturndate)
 		if (sdate==strblackdateret) {
			if (frm.cty_errmsg2.value != ""){
				alert(frm.cty_errmsg2.value+"\nPlease re-select a different Return Date. \nThank You.");
				return false;
			} else {
				alert("We are sorry to inform you that "+blackoutdateret+" are not available.\nPlease re-select a different Return Date. \nThank You.");
 				return false;
			}
		}
 
 	} 
	var departuredate=DateDiff("d",txtdepartdate,todaydate);
	if (departuredate>0){
		alert("Please select Current or future Departure Date!");
		return false;
	}
	var returndate=DateDiff("d",txtreturndate,todaydate);
	if (returndate>0){
		alert("Please select Current or future Return Date!");
		return false;
	}
	if (frm.promoid.value == 17){
		var blackdateret = "09-08-2011";
		var strblackdateret = unescape("2011/08/09 00:00:00");
		sretdate = unescape(txtreturndate)
 		if (sretdate==strblackdateret) {
			alert("We are sorry to inform you that "+blackdateret+" are not available.\nPlease re-select a different Return Date. \nThank You.");
 			return false;
		}
	}
	if (frm.promoid.value == 21 || frm.promoid.value == 22){
		if (frm.ctyid.value == 1){
			var blackdateret = "30-08-2011";
			var strblackdateret = unescape("2011/08/30 00:00:00");
			sretdate = unescape(txtreturndate)
			if (sretdate==strblackdateret) {
				alert("We are sorry to inform you that "+blackdateret+" are not available.\nPlease re-select a different Return Date. \nThank You.");
				return false;
			}
		}
		
	}
	var diffdate=DateDiff("d",txtreturndate,txtdepartdate);
	if (diffdate>0){
	  	alert("Invalid Date Range / Departure Date cannot be later than Return Date!");
		return false;
	}
 	frm.submit();
}
function chk_promotionsform(frm) {
	var todaydate			= settodaydate();
	var txtdepartdate		= setselectdate(trim(frm.txtdepartdate.value));
	var txtreturndate		= setselectdate(trim(frm.txtreturndate.value));
	var blackoutdate		= trim(frm.blackoutdate.value);
	var blackoutdateret		= trim(frm.blackoutdateret.value);
	var travel_depfr		= setselectdate(trim(frm.promo_depfr.value));
	var promo_datedep		= setselectdate(trim(frm.promo_datedep.value));
 	var departdateexpire	= DateDiff("d",promo_datedep,txtdepartdate);
	var travelfrom			= DateDiff("d",travel_depfr,txtdepartdate);
	var departeffdate		= "";
	var departflightno		= frm.departflightno.value;
	var departflightRet		= departflightno.split("#%");
	var departflightcnt     = departflightRet.length;
	var departeffdatestr	= departflightRet[1];
	var departeffmsgstr	    = departflightRet[2];
	if (departflightcnt > 1)  {
		 departeffdate      = setselectdate(trim(departeffdatestr));
		 departeffdatevalid	= DateDiff("d",txtdepartdate, departeffdate);
 		 if (departeffdatevalid > 1) {
			 alert(departeffmsgstr);
			 return;
		 }
	 }
 
	var returnflightno		= frm.returnflightno.value;
	var returnflightnoRet	= returnflightno.split("#%");
	var returneffdatestr	= returnflightnoRet[1];
	var returneffmsgstr	    = returnflightnoRet[2];
	if (returneffdatestr !="")  {
		 returneffdate      = setselectdate(trim(returneffdatestr));
		 returneffdatevalid	= DateDiff("d",txtreturndate, returneffdate);
 		 if (returneffdatevalid > 1) {
			 alert(returneffmsgstr);
			 return;
		 }
	}
	if (travelfrom < 0) {
		frm.txtdepartdate.focus();
		alert("Please select Departure From "+setformatdate(frm.promo_depfr.value,"ddmmmyyyy")+" onward");
		return;
	}
	if (frm.noofpax.value == 1){
		if(emptyfield(frm.familyname1,"Please  fill in (1) Family Name!")==false) return;
		if(emptyfield(frm.givenname1,"Please  fill in (1) Given Name!")==false) return;
		/*
		if(emptyfield(frm.age1,"Please  fill in (1) Age!")==false) return; 
		if (frm.age1.value != "") {
			if (!isNumeric(frm.age1.value)){
				alert("Please fill in valid (1) Age in numeric value!");
				frm.age1.focus();
				return;
			}

		}
		*/
	} else {
		if(emptyfield(frm.familyname1,"Please  fill in (1) Family Name!")==false) return;
		if(emptyfield(frm.givenname1,"Please  fill in (1) Given Name!")==false) return; 
		/*
		if(emptyfield(frm.age1,"Please  fill in (1) Age!")==false) return; 
		if (frm.age1.value != "") {
			if (!isNumeric(frm.age1.value)){
				alert("Please fill in valid (1) Age in numeric value!");
				frm.age1.focus();
				return;
			}

		}
		*/
		if (frm.noofpax.value == 2){
			//if (frm.familyname2.value!=""||frm.givenname2.value!=""||frm.age2.value!=""){
				if(emptyfield(frm.familyname2,"Please fill in (2) Family Name!")==false) return;
				if(emptyfield(frm.givenname2,"Please  fill in (2) Given Name!")==false) return; 
				/*
				if(emptyfield(frm.age2,"Please  fill in (2) Age!")==false) return; 
				if (frm.age2.value != "") {
					if (!isNumeric(frm.age2.value)){
						alert("Please fill in valid (2) Age in numeric value!");
						frm.age2.focus();
						return;
					}
				}
				*/
			//}
		}
		if (frm.noofpax.value == 3){
			if (frm.familyname3.value!=""||frm.givenname3.value!=""){
				if(emptyfield(frm.familyname3,"Please  fill in (3) Family Name!")==false) return;
				if(emptyfield(frm.givenname3,"Please  fill in (3) Given Name!")==false) return; 
				/*
				if(emptyfield(frm.age3,"Please  fill in (3) Age!")==false) return; 
				if (frm.age3.value != "") {
					if (!isNumeric(frm.age3.value)){
						alert("Please fill in valid (3) Age in numeric value!");
						frm.age3.focus();
						return;
					}
				}
				*/
			}

		}
		if (frm.noofpax.value == 4){
			if (frm.familyname4.value!=""||frm.givenname4.value!=""){
				if(emptyfield(frm.familyname4,"Please  fill in (4) Family Name!")==false) return;
				if(emptyfield(frm.givenname4,"Please  fill in (4) Given Name!")==false) return; 
				/*
				if(emptyfield(frm.age4,"Please  fill in (4) Age!")==false) return; 
				if (frm.age4.value != "") {
					if (!isNumeric(frm.age4.value)){
						alert("Please fill in valid (4) Age in numeric value!");
						frm.age4.focus();
						return;
					}
				}
				*/
			}
		}
	}
  	
	if(emptyfield(frm.noofadult,"Please fill in Number of Adult in numeric value!")==false) return;
	if(emptyfield(frm.noofchildren,"Please fill in Number of Children in numeric value!")==false) return;
	if(emptyfield(frm.noofinfant,"Please fill in Number of Infant in numeric value!")==false) return;
	if (!isNumeric(frm.noofadult.value)){
		alert("Please fill in valid Number of Adult in numeric value!");
		frm.noofadult.focus();
		return;
	}
	if (!isNumeric(frm.noofchildren.value)){
		alert("Please fill in Number of Children in numeric value!");
		frm.noofchildren.focus();
		return;
	}
	if (frm.noofchildren.value != "") {
		//if (frm.noofchildren.value > 0){
			if (frm.childdob1.value != "") {
				if (!CheckDate(trim(frm.childdob1.value),"DD-MM-YYYY")){
					frm.childdob1.focus();
					alert ("Date of birth of child 1 that you had entered is an invalid date format (DD-MM-YYYY).");
					return;
				}	
 			}
			if (frm.childdob2.value != "") {
				if (!CheckDate(trim(frm.childdob2.value),"DD-MM-YYYY")){
					frm.childdob2.focus();
					alert ("Date of birth of child 2 that you had entered is an invalid date format (DD-MM-YYYY).");
					return;
				}	
 			}
  			/*var noofchildren = frm.noofchildren.value;  
			for(i=1;i<=noofchildren;i++) {
				j = i;
				var ochilddob = "childdob" + i;
				var childdob = document.check[ochilddob].value;
			
				if (childdob == "") {
					alert("Please enter Date of birth of child " + j);
					document.check[ochilddob].focus();
					return false;
				}
				if (!CheckDate(trim(childdob),"DD-MM-YYYY")){
 					alert ("Date of birth of child " + j +" that you had entered is an invalid date format (DD-MM-YYYY).");
					document.check[ochilddob].focus();
					return false;
				}	
				txtchilddob      = setselectdate(trim(childdob));
				txtchildage      = DateDiff("y",txtchilddob,todaydate);
				
				var age = showAge(childdob);
 				if (age>11 || age <= 1){
					alert("Please select correct Date of birth of child "+ j +" from (2 - 11 years)");
					return false;
				}
				//if (txtchildage>11 && txtchildage <= 1){
				//	alert("Please select correct Date of birth of child from (2 - 11 years)"+ j +"!");
				//	return false;
				//} 
				//alert(txtchildage);
			}*/
		//}

 	}
 	if (!isNumeric(frm.noofinfant.value)){
		alert("Please fill in Number of Infant in numeric value!");
		frm.noofinfant.focus();
		return;
	}
	if(emptyfield(frm.fullname,"Please fill in Name!")==false) return;
	if(emptyfield(frm.contactno,"Please fill in Contact No!")==false) return;
	if(emptyfield(frm.email,"Please fill in Email (Correspondence Email Address)!")==false) return;
	if(checkOneEmail(frm.email.value,"Please fill in Valid Email (Correspondence Email Address)")==false) {
		frm.email.focus();
	   	return;
	}
	/*if (frm.email2.value != "") {
		if(checkOneEmail(frm.email2.value,"Please fill in Valid Email (Second Email Address, if any)")==false) {
			frm.email2.focus();
	   		return;
		}
	}
	if(emptyfield(frm.cardname,"Please fill in Name of card holder")==false) return;
	if(checkcreditcard(frm)==false) {
		alert("Please complete your credit card details and ensure your Credit Card is correct");
		frm.cardno.focus();
 		return;
	}
	
	if(emptyfield(frm.cardno,"Please fill in Credit Card")==false) return;
	if (frm.cardexpirydate.value == "" || frm.cardexpirydate2.value == "")
	{
		alert("Please fill in Expiry Date as MM/YYYY");
		frm.cardexpirydate.focus();
		return;
	}
	var now=new Date();
	var mth=now.getMonth()+1;
	var yr = now.getYear() ;
	if (frm.cardexpirydate2.value <= yr){
		if (frm.cardexpirydate.value <= mth ) {
			alert("Please ensure Expiry Date is valid")
			frm.cardexpirydate.focus();
			return;
		}
	}
	if(emptyfield(frm.cardname2,"Please fill in Name as feature in the card ")==false) return;
	*/
	//departflightno

	
	if (!CheckDate(trim(frm.txtdepartdate.value),"DD-MM-YYYY")){
		frm.txtdepartdate.focus();
 		alert ("Departure Date that you had entered is an invalid date format (DD-MM-YYYY).");
		return;
	}	
	if (!CheckDate(trim(frm.txtreturndate.value),"DD-MM-YYYY")){
		frm.txtreturndate.focus();
 		alert ("Return Date that you had entered is an invalid date format (DD-MM-YYYY).");
		return;
	}	
	
    //var my=DateDiff("d","2004/12/1 00:00:00","2004/12/5 00:00:00");
	if (departdateexpire>0){
		alert("Please select Departure Date before "+frm.promo_datedep.value+"!");
		return false;
	}
 	//Blackout for Departure Date
	if (frm.flightclass.value !='Business Class'){
 	var strArgs = blackoutdate.split(',');
	for (var i=0;i<strArgs.length;i++)
	{
		var sdateArr = strArgs[i].split('-');
		var year = sdateArr[2];
		var month= sdateArr[1];
		var day  = sdateArr[0];
		var strblackdate = unescape(year + "/" + month + "/" + day + " 00:00:00");
		sdate = unescape(txtdepartdate)
 		if (sdate==strblackdate) {
			if (frm.cty_errmsg1.value != ""){
				alert(frm.cty_errmsg1.value+"\nPlease re-select a different Departure Date. \nThank You.");
				return false;
			} else {
				alert("We are sorry to inform you that "+blackoutdate+" are not available.\nPlease re-select a different Departure Date. \nThank You.");
 				return false;
			}
		}
 
 	} 
	}
	//Blackout for Return Date
 	var strArgr = blackoutdateret.split(',');
	for (var i=0;i<strArgr.length;i++)
	{
		var sdateArs = strArgr[i].split('-');
		var year = sdateArs[2];
		var month= sdateArs[1];
		var day  = sdateArs[0];
		var strblackdateret = unescape(year + "/" + month + "/" + day + " 00:00:00");
		sdate = unescape(txtreturndate)
 		if (sdate==strblackdateret) {
			if (frm.cty_errmsg2.value != ""){
				alert(frm.cty_errmsg2.value+"\nPlease re-select a different Return Date. \nThank You.");
				return false;
			} else {
				alert("We are sorry to inform you that "+blackoutdateret+" are not available.\nPlease re-select a different Return Date. \nThank You.");
 				return false;
			}
		}
 
 	} 
	var departuredate=DateDiff("d",txtdepartdate,todaydate);
	if (departuredate>0){
		alert("Please select Current or future Departure Date!");
		return false;
	}
	var returndate=DateDiff("d",txtreturndate,todaydate);
	if (returndate>0){
		alert("Please select Current or future Return Date!");
		return false;
	}
	if (frm.promoid.value == 17){
		var blackdateret = "09-08-2011";
		var strblackdateret = unescape("2011/08/09 00:00:00");
		sretdate = unescape(txtreturndate)
 		if (sretdate==strblackdateret) {
			alert("We are sorry to inform you that "+blackdateret+" are not available.\nPlease re-select a different Return Date. \nThank You.");
 			return false;
		}
	}
 	var diffdate=DateDiff("d",txtreturndate,txtdepartdate);
	if (diffdate>0){
	  	alert("Invalid Date Range / Departure Date cannot be later than Return Date!");
		return false;
	}
 	frm.submit();
}
function chk_paymentform(frm) {
	var todaydate			= settodaydate();
	var txtdepartdate		= setselectdate(trim(frm.txtdepartdate.value));
	var departuredate		= DateDiff("d",txtdepartdate,todaydate);
	if(emptyfield(frm.bookingrefno,"Please fill in Booking Reference")==false) return;
	if(emptyfield(frm.txtname,"Please fill in Name")==false) return;
 	if(emptyfield(frm.txtemail,"Please fill in Email Address")==false) return;
	if(checkOneEmail(frm.txtemail.value,"Please fill in Valid Email Address")==false) {
		frm.txtemail.focus();
	   	return;
	}
	if(emptyfield(frm.flightno,"Please fill in Flight")==false) return;
	if (!CheckDate(trim(frm.txtdepartdate.value),"DD-MM-YYYY")){
		frm.txtdepartdate.focus();
 		alert ("Departure date that you had entered is an invalid date format (DD-MM-YYYY).");
		return;
	}	
 	//if (departuredate>0){
	//	alert("Please select Current or future Departure date");
	//	return false;
	//}
	if(emptyfield(frm.cardname,"Please fill in Name of card holder")==false) return;
	if (frm.showamex.value=="Yes"){
		if (frm.cardtype.value =="AMEX"){
			if(emptyfield(frm.DBCno,"If payment by Amex , please indicate the DBC no")==false) return;
		}
	} 
	if(checkcreditcard(frm)==false) {
		alert("Please complete your credit card details and ensure your Credit Card is correct");
		frm.cardno.focus();
 		return;
	}
	
	if(emptyfield(frm.cardno,"Please fill in Credit Card")==false) return;
	if (frm.cardexpirydate.value == "" || frm.cardexpirydate2.value == "")
	{
		alert("Please fill in Expiry Date as MM/YYYY");
		frm.cardexpirydate.focus();
		return;
	}
	var now=new Date();
	var mth=now.getMonth()+1;
	var yr = now.getYear() ;
	if (frm.cardexpirydate2.value <= yr){
		if (frm.cardexpirydate.value <= mth ) {
			alert("Please ensure Expiry Date is valid")
			frm.cardexpirydate.focus();
			return;
		}
	}
	
	frm.submit();
}
function chk_subscribe_form(frm) {
	if(emptyfield(frm.txtemail, "Please enter Email")==false) return;
	if(frm.txtemail.value!="") {
		if(checkOneEmail(frm.txtemail.value,"Please enter a valid Email!")==false) {
			frm.txtemail.focus();
			return;
		}
	}
	frm.submit();
}
function chk_corporatetravel(frm) {
	if(emptyfield(frm.corpTitle, "Please select Title")==false) return;
	if(emptyfield(frm.corpName, "Please enter at least Name")==false) return;
	//if(emptyfield(frm.corpDesignation, "Please select Designation")==false) return;
	//if(emptyfield(frm.corpEmail, "Please select Email")==false) return;
 	/*if(frm.corpEmail.value!="") {
		if(checkOneEmail(frm.corpEmail.value,"Please enter a valid Email!")==false) {
			frm.corpEmail.focus();
			return;
		}
	} 
	if (frm.corpTelArea.value != "") {
		if (!isNumeric(frm.corpTelArea.value)){
			alert("Please enter Contact Tel Area Code in numeric value!");
			frm.corpTelArea.focus();
			return;
		}
	}
	if (frm.corpTelno.value != "") {
		if (!isNumeric(frm.corpTelno.value)){
			alert("Please enter Contact Tel Number in numeric value!");
			frm.corpTelno.focus();
			return;
		}
	}
	if (frm.corpTelExt.value != "") {
		if (!isNumeric(frm.corpTelExt.value)){
			alert("Please enter Contact Tel Ext in numeric value!");
			frm.corpTelExt.focus();
			return;
		}
	}
	if (frm.corpCompanyTelArea.value != "") {
		if (!isNumeric(frm.corpCompanyTelArea.value)){
			alert("Please enter Telephone Area Code in numeric value!");
			frm.corpCompanyTelArea.focus();
			return;
		}
	}*/
	//if(isAlphanum(frm.corpRegNo, "Company Registration No is not valid, only alphabets and numbers allowed")==false) return;
 
	if (frm.corpestimateperannum.value != "") {
		if (!isMoney(frm.corpestimateperannum.value)){
			alert("Please enter Estimate Travel Volume Per Annum in numeric value");
			frm.corpestimateperannum.focus();
			return;
		}
	}
	if (frm.corpestimatelastyr.value != "") {
		if (!isMoney(frm.corpestimatelastyr.value)){
			alert("Please enter Estimate Travel spending amount for last year in numeric value");
			frm.corpestimatelastyr.focus();
			return;
		}
	}
	if (frm.corpfirstclass.value != "") {
		if (!isMoney(frm.corpfirstclass.value)){
			alert("Please enter % of First Class in numeric value");
			frm.corpfirstclass.focus();
			return;
		}
	}
	if (frm.corpfirstclasshrs.value != "") {
		if (!isMoney(frm.corpfirstclasshrs.value)){
			alert("Please enter First Class Minimum Flight Hours in numeric value");
			frm.corpfirstclasshrs.focus();
			return;
		}
	}
	if (frm.corpbusinessclass.value != "") {
		if (!isMoney(frm.corpbusinessclass.value)){
			alert("Please enter % of Business Class in numeric value");
			frm.corpbusinessclass.focus();
			return;
		}
	}
	if (frm.corpbusinessclasshrs.value != "") {
		if (!isMoney(frm.corpbusinessclasshrs.value)){
			alert("Please enter Business Class Minimum Flight Hours in numeric value");
			frm.corpbusinessclasshrs.focus();
			return;
		}
	}
	if (frm.corpeconommyclass.value != "") {
		if (!isMoney(frm.corpeconommyclass.value)){
			alert("Please enter % of Econommy Class in numeric value");
			frm.corpeconommyclass.focus();
			return;
		}
	}
	if (frm.corpeconommyclasshrs.value != "") {
		if (!isMoney(frm.corpeconommyclasshrs.value)){
			alert("Please enter Econommy Class Minimum Flight Hours in numeric value");
			frm.corpeconommyclasshrs.focus();
			return;
		}
	}
	frm.submit();
}
function blockNonNumbers(obj, e, allowDecimal, allowNegative)
{
	var key;
	var isCtrl = false;
	var keychar;
	var reg;
		
	if(window.event) {
		key = e.keyCode;
		isCtrl = window.event.ctrlKey
	}
	else if(e.which) {
		key = e.which;
		isCtrl = e.ctrlKey;
	}
	
	if (isNaN(key)) return true;
	
	keychar = String.fromCharCode(key);
 	// check for backspace or delete, or if Ctrl was pressed
	if (key == 8 || isCtrl){
		return true;
	}
 	reg = /\d/;
	var isFirstN = allowNegative ? keychar == '-' && obj.value.indexOf('-') == -1 : false;
	var isFirstD = allowDecimal ? keychar == '.' && obj.value.indexOf('.') == -1 : false;
	
	return isFirstN || isFirstD || reg.test(keychar);
}

function getXmlHttpRequest()
{
	var httpRequest = null;
	try
	{
		httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e)
	{
		try
		{
			httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e)
		{
			httpRequest = null;
		}
	}
	if (!httpRequest && typeof XMLHttpRequest != "undefined")
	{
		httpRequest = new XMLHttpRequest();
	}
	return httpRequest;
}
function showRoomType(str) { 
	xmlHttp=getXmlHttpRequest()
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request")
		return
	}
 	var url="getdata.asp"
	url=url+"?action=roomtype&hid="+str+""
	xmlHttp.open("GET",url,true)
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.send(null)
}
function stateChanged() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById("getResult").innerHTML=xmlHttp.responseText 
	} 
}

function showchilddob(str) { 
	xmlHttp=getXmlHttpRequest()
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request")
		return
	}
	var noofchildren = parseInt(document.getElementById("noofchildren").value);
	var url="getdata.asp"
	url=url+"?action=childdob&ncnt="+str+""
	xmlHttp.open("GET",url,true)
	xmlHttp.onreadystatechange=stateChanged1 
	xmlHttp.send(null)
}
function stateChanged1() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById("getchilddob").innerHTML=xmlHttp.responseText 
	} 
}
