			function textChange(object)
			{


				document.getElementById(object).className="date";
			}
			
			function focusout(object)
			{


				if(document.getElementById(object).value=="")
				{
					document.getElementById(object).value="dd/mm/yyyy"
					document.getElementById(object).className="datetext";
				}
			}
			
			
			function VerifyControls()
			{
				var tempControl; 
				var tempCheckBox;
								
				depdd = document.getElementById('ddlDepCity');
				if(document.getElementById('ddlDepCity').value == "Seperator")
				{
					alert("Please Select a Valid Departing City");
					return false;
				}
								
				tempControl = document.getElementById("_txtArivingCity");
				if(tempControl != null)
				{
					if(tempControl.value == "")
					{
						alert("Please Enter the Arriving Airport");
						//arguments.IsValid = false;
						//return;
						return false;
					}
					else
					{
						if((!isNaN(tempControl.value))||((trim(tempControl.value)).length < 3))
						{
							alert("Please Enter Valid Arriving Airport");
							//arguments.IsValid = false;
							//return;
							return false;
						}
					}
				}
		
				if((document.mainForm._ddArivingCity != null)&&(document.mainForm._ddArivingCity.value == ""))
				{
					alert("Please Select a Arriving Airport");
					//arguments.IsValid = false;
					//return;
					return false;
				}
				
				if((document.mainForm.ddlDepCity != null)&&(document.mainForm._txtArivingCity != null)&&(document.mainForm.ddlDepCity.value == document.mainForm._txtArivingCity.value))
				{
					alert("Departing Airport and Arriving Airport Canot be the same");
					//arguments.IsValid = false;
					//return;
					return false;
				}
				
				tempCheckBox = document.getElementById("_chkReturnDeparture");
				tempControl =  document.getElementById("_txtReturnDeparture");
				if((tempCheckBox != null)&&(tempCheckBox.checked)&&(tempControl != null))
				{
					if(tempControl.value == "")
					{
						alert("Please Enter Return From Airport Code")
						//arguments.IsValid = false;
						//return;
						return false;
					}
					else
					{
						if((!isNaN(tempControl.value))||((trim(tempControl.value)).length < 3))
						{
							alert("Please Enter Valid Return From Airport Code");
							//arguments.IsValid = false;
							//return;
							return false;
						}
					}
				}
				
				tempCheckBox = document.getElementById("_chkReturnDestination");
				tempControl =  document.getElementById("_txtReturnDestination");
				if((tempCheckBox != null)&&(tempCheckBox.checked)&&(tempControl != null))
				{
					if(tempControl.value == "")
					{
						alert("Please Enter Return To Airport Code")
						//arguments.IsValid = false;
						//return;
						return false;
					}
					if((!isNaN(tempControl.value))||((trim(tempControl.value)).length < 3))
					{
						alert("Please Enter Valid Return To Airport Code");
						//arguments.IsValid = false;
						//return;
						return false;
					}
				}
				
				if(((document.getElementById("_chkReturnDeparture")).checked)&&((document.getElementById("_chkReturnDestination")).checked))
				{
					if(((document.getElementById("_txtReturnDeparture")).value)==((document.getElementById("_txtReturnDestination")).value))
					{
						alert("Return From Airport Code and Return To Airportn Code Canot be the same");
						//arguments.IsValid = false;
						//return;
						return false;
					}
				}
				
				tempControl =  document.getElementById("txtDepartDate");
				if(tempControl != null)
				{
					if((tempControl.value == "")||(tempControl.value == "dd/mm/yyyy"))
					{
						alert("Please Enter the Departure Date");
						//arguments.IsValid = false;
						//return;
						return false;
					}
					else
					{
						if(!isDate(tempControl.value,"Departure Date"))
						{
							//arguments.IsValid = false;
							//return;
							return false;
						}
						else
						{
							if(!validateDepartureDate(tempControl.value))
							{
								alert("Departure date has to be greater than Current Date");
								//arguments.IsValid = false;
								//return;
								return false;
							}
						}
					}
				}
				
				tempControl =  document.getElementById("txtReturnDate");
				var tempRdb = document.getElementById("_rdbReturn");
				if((tempControl != null)&&(tempRdb != null)&&(tempRdb.checked))
				{
					if((tempControl.value == "")||(tempControl.value == "dd/mm/yyyy"))
					{
						alert("Please Enter the Return Date");
						//arguments.IsValid = false;
						//return;
						return false;
					}
					else
					{
						if(!isDate(tempControl.value,"Return Date"))
						{
							//arguments.IsValid = false;
							//return;
							return false;
						}
						else
						{
							if(!validateReturnDates(tempControl.value,document.getElementById("txtDepartDate").value))
							{
								//arguments.IsValid = false;
								//return;
								return false;
							}
						}
					}
				}
				
				var lintAdult = Number(document.getElementById("ddlAdults").value);
				var lintInfants = Number(document.getElementById("ddlInfantSeat").value);
				
				if(lintAdult < lintInfants)
				{
					alert("No of Adults should be greater than or equal to no of Infants");
					//arguments.IsValid = false;
					//return;
					return false;
				}
			}
			
			
			
			
			
			
			function validateReturnDates(arrivalDate,DepartureDate)
			{
				var sd1 = arrivalDate.split("/");
				var sd2 = DepartureDate.split("/");
				
				var y = new Date(sd1[2] ,sd1[1] -1 ,sd1[0] );
				var x = new Date(sd2[2] ,sd2[1] -1 ,sd2[0] );

				var difference = Date.UTC(y.getYear(),y.getMonth(),y.getDate(),0,0,0) - Date.UTC(x.getYear(),x.getMonth(),x.getDate(),0,0,0);
				var nights = difference/1000/60/60/24;
				if( nights < 0 )
				{
					alert("Return date has to be greater than Departure date");
					return false;
				}else{
					return true;
				}
			}
			
			
			
			
			function OnReturnDepature()
			{
				if(document.getElementById("_chkReturnDeparture") != null)
				{
					var tempControl;
					if(document.getElementById("_chkReturnDeparture").checked)
					{
						tempControl =  document.getElementById("_txtReturnDeparture");
						if(tempControl != null)
						{
							tempControl.disabled = false;
						}
						
						tempControl =  document.getElementById("_lnkDepature");
						if(tempControl != null)
						{
							tempControl.style.display = 'inline';
						}
					}
					else
					{
						tempControl =  document.getElementById("_txtReturnDeparture");
						if(tempControl != null)
						{
							tempControl.value = "";
							tempControl.disabled = true;
						}
						
						tempControl =  document.getElementById("_lnkDepature");
						if(tempControl != null)
						{
							tempControl.style.display = 'none';
						}
					}
				}
			}
			
			
			
			
			
			function OnReturnDestination()
			{
				if(document.getElementById("_chkReturnDestination") != null)
				{
					var tempControl;
					if(document.getElementById("_chkReturnDestination").checked)
					{
						tempControl =  document.getElementById("_txtReturnDestination");
						if(tempControl != null)
						{
							tempControl.disabled = false;
						}
						
						tempControl =  document.getElementById("_lnkReturn");
						if(tempControl != null)
						{
							tempControl.style.display = 'inline';
						}
					}
					else
					{
						tempControl =  document.getElementById("_txtReturnDestination");
						if(tempControl != null)
						{
							tempControl.value = "";
							tempControl.disabled = true;
						}
						
						tempControl =  document.getElementById("_lnkReturn");
						if(tempControl != null)
						{
							tempControl.style.display = 'none';
						}
					}
				}
			}
			
			function SetReturn(isReturnChecked)
			{
				if(isReturnChecked)
				{
					tempControl = document.getElementById("_chkReturnDeparture");
					if(tempControl != null)
					{
						tempControl.disabled = false;
						if(tempControl.checked)
						{
							tempControl =  document.getElementById("_txtReturnDeparture");
							if(tempControl != null)
							{
								tempControl.disabled = false;
							}
							
							tempControl =  document.getElementById("_lnkDepature");
							if(tempControl != null)
							{
								tempControl.style.display = 'inline';
							}
						}
					}
					
					tempControl = document.getElementById("_chkReturnDestination");
					if(tempControl != null)
					{
						tempControl.disabled = false;
						if(tempControl.checked)
						{
							tempControl =  document.getElementById("_txtReturnDestination");
							if(tempControl != null)
							{
								tempControl.disabled = false;
							}
							
							tempControl =  document.getElementById("_lnkReturn");
							if(tempControl != null)
							{
								tempControl.style.display = 'inline';
							}
						}
					}
				}
				else
				{
					tempControl = document.getElementById("_chkReturnDeparture");
					if(tempControl != null)
					{
						tempControl.checked = false;
						tempControl.disabled = true;
					}
					
					tempControl =  document.getElementById("_txtReturnDeparture");
					if(tempControl != null)
					{
						tempControl.disabled = true;
						tempControl.value = "";
					}
					
					tempControl =  document.getElementById("_lnkDepature");
					if(tempControl != null)
					{
						tempControl.style.display = 'none';
					}
					
					tempControl = document.getElementById("_chkReturnDestination");
					if(tempControl != null)
					{
						tempControl.checked = false;
						tempControl.disabled = true;
					}
					
					tempControl =  document.getElementById("_txtReturnDestination");
					if(tempControl != null)
					{
						tempControl.disabled = true;
						tempControl.value = "";
					}
					
					tempControl =  document.getElementById("_lnkReturn");
					if(tempControl != null)
					{
						tempControl.style.display = 'none';
					}
				}
			}
			
			function OnReturnClick()
			{
				var tempControl = document.getElementById("_chkReturn");
			
				//var tempHD = document.getElementById("_hdCheckReturn");
				//tempHD.value = tempControl.checked;
				if(tempControl != null)
				{
					//if(tempHD.value == 'true')
					//{
						tempControl.value = tempControl.checked;
						SetReturn(tempControl.checked);
					//}
					//else
					//{
						//SetReturn(false);
					//}
				}
			}
			
			function SetInitialSettings()
			{
				var tempControl = document.getElementById("_chkReturn");
				var d = tempControl.value;
			
				//var tempHD = document.getElementById("_hdCheckReturn");
				//tempHD.value = tempControl.checked;
				if(tempControl != null)
				{
					//if(tempControl.CustomValue == 'true')
					//{
						SetReturn(tempControl.checked);
					//}
					//else
					//{
						//SetReturn(false);
					//}
				}
			}
			
			function callCalendar(conf_name,target_field,ref_field,default_date,hoder_id,dx,dy,mode)
			{
				//debugger;
				xcModPath="script";
				xcWindowTemplate="/script/xc2_template.html";
				xcDateFormat ='dd/mm/yyyy';
				setRange("conf",daysAfter(3),"");
				
				//setting the start date
				var strDate = document.getElementById('txtDepartDate').value;
				if(strDate != 0 && target_field.id != 'txtDepartDate')
				{
					setRange("conf",strDate,"");
				}

				showCalendar("conf",target_field,ref_field,default_date,hoder_id,dx,dy,mode);
	 		}
			//xcDateFormat ='dd/mm/yyyy';
			//setRange("conf",daysAfter(0),"");
			function popUp(text, textBoxNo) {			
				txtBox = text;
				textBoxId = textBoxNo;
				URL = "../FindCity.aspx";
				win = open(URL,'', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=420,height=570,left = 340,top = 237');
			}
			function goToOffer(baseAPC,destinationAPC,airLinecode,startDate,endDate,basecity,destination,currency,amount)
				{
			//	goToOffer(base,destination,airLinecode,startDate,endDate)
				
				poupwin=window.open('FlightOffers.aspx?BaseCityAPC='+baseAPC+'&DestinationAPC='+destinationAPC+'&AirLineCode='+airLinecode+'&StartDate='+startDate+'&EndDate='+endDate+'&BaseCity='+basecity+'&Destination='+destination+'&Currency='+currency+'&Amount='+amount , 'TopOffer', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=525,height=600,left=120,top=80');
				//window.open('Gate247Offer.aspx');
				
				}
				
			function setDateFrom()
			{
				var datefrom1 = document.mainForm.setDate.value.split("/");
				document.mainForm.txtDepartDate.value = datefrom1[1] + "/" + datefrom1[0] + "/" + datefrom1[2];
			}

			function Today()
			{
				var dd = new Date();
				return((dd.getMonth()+1) + "/" + dd.getDate() + "/" + dd.getFullYear());
			}
		
			function showDateCal1()
			{
				var controlStr ="AppendOrReplace=Replace;AppendChar=';';CloseOnSelect=Yes;ReturnData=Date;Title=Calendar;InlineX=500;InlineY=270;CurrentDate=Today;SelectAfter=Today;SelectBefore=\"\";AllowWeekends=Yes;Resizable=No;CallFunction=setDateFrom();PopupX=200;PopupY=220;Nav=Yes;SmartNav=Yes;Fix=Yes;";show_calendar('mainForm.setDate',null,null, null,null, controlStr);
			}

			function setDateTo()
			{
				var dateto = document.mainForm.setDate.value.split("/");
				document.mainForm.txtReturnDate.value = dateto[1] + "/" + dateto[0] +  "/" + dateto[2];
			}

			function showDateCal2()
			{
				var controlStr ="AppendOrReplace=Replace;AppendChar=';';CloseOnSelect=Yes;ReturnData=Date;Title=Calendar;InlineX=500;InlineY=270;CurrentDate=Today;SelectAfter=Today;SelectBefore=\"\";AllowWeekends=Yes;Resizable=No;CallFunction=setDateTo();PopupX=200;PopupY=220;Nav=Yes;SmartNav=Yes;Fix=Yes;";show_calendar('mainForm.setDate',null,null, null,null, controlStr);
			}
			
			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
			}
			
						
			function validate()
			{
				//if((document.mainForm._txtDepartureCity != null)&&(document.mainForm._txtDepartureCity.value == ""))
				//{
				//	alert("Please Enter the Departing Airport");
				//	return false;
				//}
				
				if((document.mainForm._ddDepartureAirport != null)&&(document.mainForm._ddDepartureAirport.value == ""))
				{
					alert("Please Select a Departing Airport");
					return false;
				}
				else
				{
					if((document.mainForm._ddDepartureAirport != null)&&(document.mainForm._ddDepartureAirport.value == "Seperator"))
					{
						alert("Please Select a Valid Departing Airport");
						return false;
					}
				}
				
				if((document.mainForm._txtArivingCity != null)&&(document.mainForm._txtArivingCity.value == ""))
				{
					alert("Please Enter the Arriving Airport");
					return false;
				}
				
				if((document.mainForm._ddArivingCity != null)&&(document.mainForm._ddArivingCity.value == ""))
				{
					alert("Please Select a Arriving Airport");
					return false;
				}
				
				if((document.mainForm.ddlDepCity != null)&&(document.mainForm._txtArivingCity != null)&&(document.mainForm.ddlDepCity.value == document.mainForm._txtArivingCity.value))
				{
					alert("Departing Airport and Arriving Airport Canot be the same");
					return false;
				}
				
				if(document.mainForm.txtDepartDate.value=="")// || document.mainForm.txtReturnDate.value=="")
				{
					alert("Please Enter the Departure Date");
					return false;
				}else{
					isDate(document.mainForm.txtDepartDate.value, 'DepatureDate');
					if (!isGraterThanToday('txtDepartDate'))
					{
						alert('Departure Date has to be grater than Current Date');
						return false;
					}
									
				}
				
				if ((document.mainForm.ddlTicketType.selectedIndex == 1) && (document.mainForm.txtReturnDate.value==""))
				{
					alert("Please Enter Retrun Date or Select One way Ticket");
					return false;
				}
				
			
				if ((document.mainForm.ddlTicketType.selectedIndex == 1) && (document.mainForm.txtReturnDate.value != ""))
				{
					if(!isDate(document.mainForm.txtReturnDate.value,'ReturnDate'))
					{
						return false
					}
					if(!isGraterThanToday('txtReturnDate'))
					{
						alert('Arrival Date has to be grater than Current Date');
						return false;
					}
				}
				
				
				//triming
				var str = document.mainForm.txtDepartDate.value;
				document.mainForm.txtDepartDate.value =trim(str);
				var str = document.mainForm.txtReturnDate.value;
				document.mainForm.txtReturnDate.value =trim(str);
				
				var sd1 = document.mainForm.txtDepartDate.value.split("/");
				var sd2 = document.mainForm.txtReturnDate.value.split("/");
					
				var x = new Date(sd1[2] ,sd1[1] -1 ,sd1[0] );
				var y = new Date(sd2[2] ,sd2[1] -1 ,sd2[0] );

				var difference = Date.UTC(y.getYear(),y.getMonth(),y.getDate(),0,0,0) - Date.UTC(x.getYear(),x.getMonth(),x.getDate(),0,0,0);
				var nights = difference/1000/60/60/24;
				if( nights < 0)
				{
					alert("Return date has to be grater than Departure date");
					return false;
				}else{
					return true;
				}
			}
			
			//On Text Change
			function setText(txtBoxName)
			{
				//debugger;
				var letter = new String(document.getElementById(txtBoxName).value);
				letter =trim(letter.toString());
				document.getElementById(txtBoxName).value =letter;
			}
			
			function validateDepartureDate(departureDateValue)
			{	
				departureDateValue =trim(departureDateValue);
				var sd1 = Today().split("/");
				var sd2 = departureDateValue.split("/");
				
				var x = new Date(sd1[2] ,sd1[0] -1 ,sd1[1] );
				var y = new Date(sd2[2] ,sd2[1] -1 ,sd2[0] );

				var difference = Date.UTC(y.getYear(),y.getMonth(),y.getDate(),0,0,0) - Date.UTC(x.getYear(),x.getMonth(),x.getDate(),0,0,0);
				var nights = difference/1000/60/60/24;
				if( nights < 0)
				{
					return false;
				}else{
					return true;
				}
			}
			
			function trim(inputString)
			{
				//debugger;
				// 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 checkDate(txtBoxName, fieldName)
			{
				//debugger;
				var dtStr =document.getElementById(txtBoxName).value;
				document.getElementById(txtBoxName).value =trim(dtStr);
				dtStr =trim(dtStr);
				if((fieldName =='ReturnDate') && (document.mainForm.ddlTicketType.selectedIndex != 1))
				{
					document.mainForm.txtReturnDate.value = "";
				}
				
				if(!isDate(dtStr.toString(), fieldName))
				{
					return false;
				}else
				{
					if(!isGraterThanToday(txtBoxName)){
						alert(fieldName+' is less than Today');
						return false;
					}
				}
				
			}
			
			
		function validateDepartureDate(departureDateValue)
		{	
			departureDateValue =trim(departureDateValue);
			var sd1 = Today().split("/");
			var sd2 = departureDateValue.split("/");
			
			var x = new Date(sd1[2] ,sd1[0] -1 ,sd1[1] );
			var y = new Date(sd2[2] ,sd2[1] -1 ,sd2[0] );

			var difference = Date.UTC(y.getYear(),y.getMonth(),y.getDate(),0,0,0) - Date.UTC(x.getYear(),x.getMonth(),x.getDate(),0,0,0);
			var nights = difference/1000/60/60/24;
			if( nights < 0)
			{
				return false;
			}else{
				return true;
			}
		}
			
			function isGraterThanToday(txtBoxName)
			{
				
				var td = Today();
				var sd1 = td.split("/");
				var sd2 = document.getElementById(txtBoxName).value.split("/");
					
				var x = new Date(sd1[2] ,sd1[0] -1 ,sd1[1] );
				var y = new Date(sd2[2] ,sd2[1] -1 ,sd2[0] );

				var difference = Date.UTC(y.getYear(),y.getMonth(),y.getDate(),0,0,0) - Date.UTC(x.getYear(),x.getMonth(),x.getDate(),0,0,0);
				var nights = difference/1000/60/60/24;
				if( nights < 0)
				{
					//alert("End date has to be grater than Start date");
					return false;
				}
				return true;
			}
			
			//----------------------  Date Validation ----------------------------------------------------------------
			/**
			* DHTML date validation script for dd/mm/yyyy. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
			*/
			// Declaring valid date character, minimum year and maximum year
			var dtCh= "/";
			var minYear=1900;
			var maxYear=2100;

			function isInteger(s)
			{
				var i;
				for (i = 0; i < s.length; i++){   
					// Check that current character is number.
					var c = s.charAt(i);
					if (((c < "0") || (c > "9"))) return false;
				}
				// All characters are numbers.
				return true;
			}

			function stripCharsInBag(s, bag)
			{		
				var i;
				var returnString = "";
				// Search through string's characters one by one.
				// If character is not in bag, append to returnString.
				for (i = 0; i < s.length; i++){   
					var c = s.charAt(i);
					if (bag.indexOf(c) == -1) returnString += c;
				}
				return returnString;
			}

			function daysInFebruary (year)
			{
				// February has 29 days in any year evenly divisible by four,
				// EXCEPT for centurial years which are not also divisible by 400.
				return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
			}
			function DaysArray(n)
			{
				for (var i = 1; i <= n; i++)
				{
					this[i] = 31
					if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
					if (i==2) {this[i] = 29}
				}
			return this
			}
			
			
			
			function isDate(dtStr, fieldName){
				var temp =new String(dtStr);
				dtStr=temp.substring(0,10);
				temp=temp.substring(10);
				/*
				if (temp.lenght!=0)
				{
					if (temp!= " 00:00:00")
					{
						alert("Ilegal Charaters in "+fieldName);
					}
				}*/
				var daysInMonth = DaysArray(12)
				var pos1=dtStr.indexOf(dtCh)
				var pos2=dtStr.indexOf(dtCh,pos1+1)
				var strDay=dtStr.substring(0,pos1)
				var strMonth=dtStr.substring(pos1+1,pos2)
				var strYear=dtStr.substring(pos2+1)
				strYr=strYear
				if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
				if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
				for (var i = 1; i <= 3; i++) {
					if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
				}
				month=parseInt(strMonth)
				day=parseInt(strDay)
				year=parseInt(strYr)
				if (pos1==-1 || pos2==-1){
					alert("The date format should be : dd/mm/yyyy in "+fieldName )
					return false
				}
				if (strMonth.length<1 || month<1 || month>12){
					alert("Please enter a valid month for "+fieldName)
					return false
				}
				if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
					alert("Please enter a valid day for "+fieldName)
					return false
				}
				if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
					alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear+" for "+fieldName)
					return false
				}
				if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false)
				{
					alert("Please enter a valid date for "+fieldName)
					return false
				}
			return true
			}
						
			function setSignInDate(conf_name,target_field,ref_field,default_date,hoder_id,dx,dy,mode,target_feild)
			{
				
				//xcModPath="script";
				xcModPath = "../../JS";
				xcWindowTemplate="/script/xc2_template.html";
				xcDateFormat ='dd/mm/yyyy';
				setRange("conf",daysAfter(3),"");
				
				//showCustomCalendar("conf",target_field,ref_field,default_date,hoder_id,dx,dy,mode,target_feild);
				//showCustomCalendar("conf",target_field,ref_field,default_date,hoder_id,dx,dy,mode,target_feild);
				showCalendar("conf",target_field,ref_field,default_date,hoder_id,dx,dy,mode);
				target_field.className="date";
				ref_field.className="date";
			}
						
						
			function bopoPopup() {
			
				var theURL = 	'http://www.directflights.com.au/Bopo/bopoPopup2.html';
				var width  = 370;
				var height = 420;
				
				newWindow = window.open(theURL,'newWindow','toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width='+width+',height='+height);
			
			}						