	// JavaScript Document

		
	var MAX_FLIGHT_LEGS = 6;

	var fltContrLegNo = 1;
	var intMaxAdults = 9;
	var intMaxChild	 = 8;
	//var strDDFirstValue = "-- Choose --";
	var strDDFirstValue = strHDPleaseSelect;


	/**Date related variables*/
	var strSeleDDay = "";
	var strSeleRDay = "";
	var strCurrentDate = "";

	var dtC = new Date();
	var dtCM = dtC.getMonth() + 1;
	var dtCD = dtC.getDate();
	var strSysDate  = DateToString(dtC); 		// should come from the server
	var dtSysDate	= StringToDate(strSysDate);
	var hdnTab 	= "MULTIPOINT";

	var hdnMode			= "";
	var hdnData			= "";
	var hdnChar			= "";
	var hdnFrom			= "";
	var hdnFromText		= "";
	var hdnTo			= "";
	var strAjaxSpan		= "";

	var strSelectedCityFrom1 = "";
	var strSelectedCityFrom2 = "";
	var strSelectedCityFrom3 = "";
	var strSelectedCityFrom4 = "";
	var strSelectedCityFrom5 = "";
	var strSelectedCityFrom6 = "";
	var strSelectedCityTo1 = "";
	var strSelectedCityTo2 = "";
	var strSelectedCityTo3 = "";
	var strSelectedCityTo4 = "";
	var strSelectedCityTo5 = "";
	var strSelectedCityTo6 = "";
	var strNoRecordIATACode = "999";
	var strFromMethod = "";
	var strToMethod = "";
	var strPostURL		= "../../../qribe-web";
	var strActiveLeg = "";
	var objAjaxTimer = null;

	var strFrom2 = "";
	var strTo2 = "";
	var strFrom3 = "";
	var strTo3 = "";
	var strFrom4 = "";
	var strTo4 = "";
	var strFrom5 = "";
	var strTo5 = "";
	var strFrom6 = "";
	var strTo6 = "";

	var objCal = new Calendar("spnCalendar");
	objCal.ID = 1
	objCal.align = "left";
	objCal.top = 0 ;
	objCal.left = 0 ;
	objCal.imgPath = strImagePath;
	objCal.imgPathNav = strImagePath;
	objCal.disableUpto = strSysDate
	objCal.disableFrom = addMonths(11, strSysDate);
	objCal.onClick = "setSrchDate";
	objCal.buildCalendar();


	strSeleDDay = strSysDate;

	var objFromSD1 = new searchDropDown("spnFromStation1");
	objFromSD1.displayWidth = "175px";
	objFromSD1.width = "175px";
	
	objFromSD1.dataArray = arrFSFromCity;
	objFromSD1.imgPath = strImagePath;
	objFromSD1.onKeyUp = "getFromStations1";
	objFromSD1.onChange = "getFromStations_onChange_one1";
	objFromSD1.onFocus = "initializeErrMsg;setFromDefaultText1";
	objFromSD1.arrowClick = "showFromCityList1"
	objFromSD1.onClick = "pageClose";
	objFromSD1.onBlur = "FromStation_onBlur1"
	objFromSD1.defaultValue = strHDOrigin;
	objFromSD1.listBoxClassName = "clsSelect";

	var objToSD1 = new searchDropDown("spnToStation1");
	objToSD1.displayWidth = "175px";
	objToSD1.width = "175px";
	objToSD1.dataArray = arrFSToCity;
	objToSD1.imgPath = strImagePath;
	objToSD1.onKeyUp = "getToStations1";
	objToSD1.onChange = "getToStations_onChange1";
	objToSD1.arrowClick = "showToCityList1"
	objToSD1.onClick = "pageClose";
	objToSD1.onFocus = "setToDefaultText1";
	objToSD1.onBlur = "ToStation_onBlur1"
	objToSD1.defaultValue = strHDDestination;	
	objToSD1.listBoxClassName = "clsSelect";

	var objFromSD2 = new searchDropDown("spnFromStation2");
	objFromSD2.displayWidth = "175px";
	objFromSD2.width = "175px";
	
	objFromSD2.dataArray = arrFSFromCity;
	objFromSD2.imgPath = strImagePath;
	objFromSD2.onKeyUp = "getFromStations2";
	objFromSD2.onChange = "getFromStations_onChange_one2";
	objFromSD2.onFocus = "initializeErrMsg;setFromDefaultText2";
	objFromSD2.arrowClick = "showFromCityList2"
	objFromSD2.onClick = "pageClose";
	objFromSD2.onBlur = "FromStation_onBlur2"
	objFromSD2.defaultValue = strHDOrigin;
	objFromSD2.listBoxClassName = "clsSelect";

	var objToSD2 = new searchDropDown("spnToStation2");
	objToSD2.displayWidth = "175px";
	objToSD2.width = "175px";
	objToSD2.dataArray = arrFSToCity;
	objToSD2.imgPath = strImagePath;
	objToSD2.onKeyUp = "getToStations2";
	objToSD2.onChange = "getToStations_onChange2";
	objToSD2.arrowClick = "showToCityList2"
	objToSD2.onClick = "pageClose";
	objToSD2.onFocus = "setToDefaultText2";
	objToSD2.onBlur = "ToStation_onBlur2"
	objToSD2.defaultValue = strHDDestination;	
	objToSD2.listBoxClassName = "clsSelect";
	
	var objFromSD3 = new searchDropDown("spnFromStation3");
	objFromSD3.displayWidth = "175px";
	objFromSD3.width = "175px";
	
	objFromSD3.dataArray = arrFSFromCity;
	objFromSD3.imgPath = strImagePath;
	objFromSD3.onKeyUp = "getFromStations3";
	objFromSD3.onChange = "getFromStations_onChange_one3";
	objFromSD3.onFocus = "initializeErrMsg;setFromDefaultText3";
	objFromSD3.arrowClick = "showFromCityList3"
	objFromSD3.onClick = "pageClose";
	objFromSD3.onBlur = "FromStation_onBlur3"
	objFromSD3.defaultValue = strHDOrigin;
	objFromSD3.listBoxClassName = "clsSelect";

	var objToSD3 = new searchDropDown("spnToStation3");
	objToSD3.displayWidth = "175px";
	objToSD3.width = "175px";
	objToSD3.dataArray = arrFSToCity;
	objToSD3.imgPath = strImagePath;
	objToSD3.onKeyUp = "getToStations3";
	objToSD3.onChange = "getToStations_onChange3";
	objToSD3.arrowClick = "showToCityList3"
	objToSD3.onClick = "pageClose";
	objToSD3.onFocus = "setToDefaultText3";
	objToSD3.onBlur = "ToStation_onBlur3"
	objToSD3.defaultValue = strHDDestination;	
	objToSD3.listBoxClassName = "clsSelect";

	var objFromSD4 = new searchDropDown("spnFromStation4");
	objFromSD4.displayWidth = "175px";
	objFromSD4.width = "175px";
	
	objFromSD4.dataArray = arrFSFromCity;
	objFromSD4.imgPath = strImagePath;
	objFromSD4.onKeyUp = "getFromStations4";
	objFromSD4.onChange = "getFromStations_onChange_one4";
	objFromSD4.onFocus = "initializeErrMsg;setFromDefaultText4";
	objFromSD4.arrowClick = "showFromCityList4"
	objFromSD4.onClick = "pageClose";
	objFromSD4.onBlur = "FromStation_onBlur4"
	objFromSD4.defaultValue = strHDOrigin;
	objFromSD4.listBoxClassName = "clsSelect";

	var objToSD4 = new searchDropDown("spnToStation4");
	objToSD4.displayWidth = "175px";
	objToSD4.width = "175px";
	objToSD4.dataArray = arrFSToCity;
	objToSD4.imgPath = strImagePath;
	objToSD4.onKeyUp = "getToStations4";
	objToSD4.onChange = "getToStations_onChange4";
	objToSD4.arrowClick = "showToCityList4"
	objToSD4.onClick = "pageClose";
	objToSD4.onFocus = "setToDefaultText4";
	objToSD4.onBlur = "ToStation_onBlur4"
	objToSD4.defaultValue = strHDDestination;	
	objToSD4.listBoxClassName = "clsSelect";

	var objFromSD5 = new searchDropDown("spnFromStation5");
	objFromSD5.displayWidth = "175px";
	objFromSD5.width = "175px";
	
	objFromSD5.dataArray = arrFSFromCity;
	objFromSD5.imgPath = strImagePath;
	objFromSD5.onKeyUp = "getFromStations5";
	objFromSD5.onChange = "getFromStations_onChange_one5";
	objFromSD5.onFocus = "initializeErrMsg;setFromDefaultText5";
	objFromSD5.arrowClick = "showFromCityList5"
	objFromSD5.onClick = "pageClose";
	objFromSD5.onBlur = "FromStation_onBlur5"
	objFromSD5.defaultValue = strHDOrigin;
	objFromSD5.listBoxClassName = "clsSelect";

	var objToSD5 = new searchDropDown("spnToStation5");
	objToSD5.displayWidth = "175px";
	objToSD5.width = "175px";
	objToSD5.dataArray = arrFSToCity;
	objToSD5.imgPath = strImagePath;
	objToSD5.onKeyUp = "getToStations5";
	objToSD5.onChange = "getToStations_onChange5";
	objToSD5.arrowClick = "showToCityList5"
	objToSD5.onClick = "pageClose";
	objToSD5.onFocus = "setToDefaultText5";
	objToSD5.onBlur = "ToStation_onBlur5"
	objToSD5.defaultValue = strHDDestination;	
	objToSD5.listBoxClassName = "clsSelect";


	var objFromSD6 = new searchDropDown("spnFromStation6");
	objFromSD6.displayWidth = "175px";
	objFromSD6.width = "175px";
	
	objFromSD6.dataArray = arrFSFromCity;
	objFromSD6.imgPath = strImagePath;
	objFromSD6.onKeyUp = "getFromStations6";
	objFromSD6.onChange = "getFromStations_onChange_one6";
	objFromSD6.onFocus = "initializeErrMsg;setFromDefaultText6";
	objFromSD6.arrowClick = "showFromCityList6"
	objFromSD6.onClick = "pageClose";
	objFromSD6.onBlur = "FromStation_onBlur6"
	objFromSD6.defaultValue = strHDOrigin;
	objFromSD6.listBoxClassName = "clsSelect";

	var objToSD6 = new searchDropDown("spnToStation6");
	objToSD6.displayWidth = "175px";
	objToSD6.width = "175px";
	objToSD6.dataArray = arrFSToCity;
	objToSD6.imgPath = strImagePath;
	objToSD6.onKeyUp = "getToStations6";
	objToSD6.onChange = "getToStations_onChange6";
	objToSD6.arrowClick = "showToCityList6"
	objToSD6.onClick = "pageClose";
	objToSD6.onFocus = "setToDefaultText6";
	objToSD6.onBlur = "ToStation_onBlur6"
	objToSD6.defaultValue = strHDDestination;	
	objToSD6.listBoxClassName = "clsSelect";

	objToSD6.displaySearchDropDown();


	function addRow(){
		if(fltContrLegNo <=MAX_FLIGHT_LEGS ){
			setDisplay("spnFltLeg" +fltContrLegNo ,true); 
			buildYearDropDown("selYrDept" + fltContrLegNo,1);
			if (fltContrLegNo ==MAX_FLIGHT_LEGS)
			{
				Disable("btnAdd", true);
			}
			setNextDate(fltContrLegNo-1);
			displayFltSrchDay("0",fltContrLegNo); 		
			fltContrLegNo++;	
			resizeCity1("F", 0,arrFSFromCity);
			resizeCity1("T", 0,arrFSToCity);	
			resizeCity2("F", 0,arrFSFromCity);
			resizeCity2("T", 0,arrFSToCity);	
			resizeCity3("F", 0,arrFSFromCity);
			resizeCity3("T", 0,arrFSToCity);	
			resizeCity4("F", 0,arrFSFromCity);
			resizeCity4("T", 0,arrFSToCity);	
			resizeCity5("F", 0,arrFSFromCity);
			resizeCity5("T", 0,arrFSToCity);
			resizeCity6("F", 0,arrFSFromCity);
			resizeCity6("T", 0,arrFSToCity);	
		}else{
			Disable("btnRemove", false);
			Disable("btnAdd", false);
		}
		Disable("btnRemove", false);
	}

	function removeRow(){
		if (fltContrLegNo ==2){
			return false;
		}
		if (fltContrLegNo ==3){
			Disable("btnRemove", true);
		}
		fltContrLegNo--;
		setDisplay("spnFltLeg" +fltContrLegNo ,false); 
		Disable("btnAdd", false);
	}
	
	function pgBtnClick(intID){
		switch (intID){		
			case  0 :
				loadSearchPage();	
				break;
			case 1 :				
				if(validate()){	
				
					buildFlightSrchInfo();
					submitFltSearch();
				}
				break;
		}
	}

	function buildFlightSrchInfo(){
		var hdnData = "MUTLISEARCH ^";
		hdnData += getValue("selAdults") + " ^";
		hdnData += getValue("selChild") + " ^";
		hdnData += getValue("selInfants") + " ^";
		hdnData += getText("selClass") + " ^";
		hdnData += getValue("selClass")+ " ^|";
		
		for (var i = 0 ; i < fltContrLegNo - 1 ; i++){
			if (i==0){
				hdnData += objFromSD1.value + " ^";
				hdnData += objToSD1.value + " ^";
			}else if (i==1){
				hdnData += objFromSD2.value + " ^";
				hdnData += objToSD2.value + " ^";
			}else if (i==2){
				hdnData += objFromSD3.value + " ^";
				hdnData += objToSD3.value + " ^";
			}else if (i==3){
				hdnData += objFromSD4.value + " ^";
				hdnData += objToSD4.value + " ^";
			}else if (i==4){
				hdnData += objFromSD5.value + " ^";
				hdnData += objToSD5.value + " ^";
			}else if (i==5){
				hdnData += objFromSD5.value + " ^";
				hdnData += objToSD5.value + " ^";
			}
			hdnData += getValue("selDtDept"+ (i+1)) + " ^";
			hdnData += getValue("selYrDept"+ (i+1)) + " ^";
			hdnData += getValue("selAnyRetu"+ (i+1)) + " ^";
			if (i==0){
				hdnData += objFromSD1.text + " ^";
				hdnData += objToSD1.text + " ^|";
			}else if (i==1){
				hdnData += objFromSD2.text + " ^";
				hdnData += objToSD2.text + " ^|";
			}else if (i==2){
				hdnData += objFromSD3.text + " ^";
				hdnData += objToSD3.text + " ^|";
			}else if (i==3){
				hdnData += objFromSD4.text + " ^";
				hdnData += objToSD4.text + " ^|";
			}else if (i==4){
				hdnData += objFromSD5.text + " ^";
				hdnData += objToSD5.text + " ^|";
			}else if (i==5){
				hdnData += objFromSD5.text + " ^";
				hdnData += objToSD5.text + " ^|";
			}
		}
		
		setField("hdnMode", "MUTLISEARCH");
		setField("hdnData", hdnData);
		setField("hdnTimeStamp", objTopFrm.arrParams[32]);
	}

	function submitFltSearch(){
		var objForm = getFieldByID("frmDummy");
		var strNonSecureURL = trim(arrParams[26]);
		if (objTopFrm.strSysURLType != ""){
			strNonSecureURL = trim(arrParams[33]);
		}	
		objForm.action = strNonSecureURL + "showIBE.do?L=" + strCurrLang;
		objFromSD1.initializeControl();
		objToSD1.initializeControl();
		objFromSD2.initializeControl();
		objToSD2.initializeControl();
		objFromSD3.initializeControl();
		objToSD3.initializeControl();
		objFromSD4.initializeControl();
		objToSD4.initializeControl();
		objFromSD5.initializeControl();
		objToSD5.initializeControl();
		objFromSD6.initializeControl();
		objToSD6.initializeControl();
		objForm.method = "post";
		objForm.submit();
	}

	function showCal(strID, objEvent, legNo){
			var x = null;
			var y = null;
			if (browser.isIE) {
				x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
				y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
			}else{
				x = objEvent.clientX + window.scrollX;
				y = objEvent.clientY + window.scrollY;
			}	
			
			c = getAnchorPosition('selDtDept1');
			if (strPGLanguage == "ar"){
				x=c.x ;
			}else{
				x=c.x + 80  //987;
			}
			if (y==0){
				if (legNo==1){
					y= c.y + 20; //270;
				}else if (legNo==2){
					y=c.y + 50; //295;
				}else if (legNo==3){
					y=c.y + 85; //330;
				}else if (legNo==4){
					y=c.y + 120 ;//375;
				}else if (legNo==5){
					y=c.y + 160; //410;
				}else if (legNo==6){
					y=c.y + 195//450;
				}
			}

			objCal.left = x - 170;
			objCal.top = y + 10;
			objCal.ID = strID;		
			var blnShowCal = true;
					
			if (getValue("selDtDept"+ legNo) + "/" + getValue("selYrDept"+ legNo) !="/")
			{
				objCal.currentDate = getValue("selDtDept"+ legNo) + "/" + getValue("selYrDept"+ legNo);
			}
			
			if (blnShowCal){objCal.showCalendar(objEvent);}	
	}

	function setSrchDate(strDate,legNo){
		
		var arrStrValue = strDate.split("/");
			
		setField("selYrDept"+ legNo , arrStrValue[1] + "/" + arrStrValue[2]);
		selYrDeptOnChange(legNo);
		setField("selDtDept"+ legNo, arrStrValue[0]);	
		selDtDeptOnChange(legNo);
	}

	function FillCalenderDay(objDName, strValue, strDValue){
	
		var objdrop = getFieldByID(objDName)
		var strCD	= strSysDate
		var strDMonth = Number(strSysDate.substr(3,2));
		var strDYear = Number(strSysDate.substr(6,4));
		
		var strMonth = Number(strValue.substr(0,2));
		var strYear = Number(strValue.substr(3,4));
		
		var strDays = getDaysInMonth(strMonth, strYear);
		var strDay = ""
		var strStartDate = 1;
		if ((strDMonth == strMonth) && (strYear == strDYear)){
			strStartDate = Number(strSysDate.substr(0,2))
		}
		
		objdrop.length = 1;
		for (var i = strStartDate; i <= strDays ; i ++){
			strDay = i 
			if (strDay < 10){
				strDay = "0" + strDay
			}
			objdrop.length = objdrop.length + 1
			objdrop.options[objdrop.length -1].text =  strDay;
			objdrop.options[objdrop.length -1].value =  strDay;
		}

		if (strDay != "" && Number(strDay) <= getDaysInMonth(strMonth, strYear) )
		{
			setField(objDName, strDValue) ;
		}
	}

	/*
	* Fill DropDown List Box
	*/
	function fillFromCity(strName){
		

		var arrTempArrCity = new Array();
		for (var i = 0 ; i < arrCity.length ; i++){
			var strTempStation = aCnt[arrCity[i][0]].split("^");
			arrTempArrCity[i] = new Array(strTempStation[0], strTempStation[1]);
		}

		var objLB = new listBox();
		objLB.dataArray = arrTempArrCity ; //arrCity ; //arrDepCity;
		objLB.valueIndex = "0";
		objLB.textIndex = "1";
		objLB.blnFirstEmpty = true;
		objLB.firstTextValue = strDDFirstValue;
		objLB.id = strName;
		objLB.fillListBox();
	}

	function buildYearDropDown(strName, intYears){

		var dtDepDate	= addDays(dtSysDate, 0);
		var intMonth	= dtDepDate.getMonth();
		var intYear		= dtDepDate.getFullYear();
		var arrMonths	= new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
		
		var objDrop		= getFieldByID(strName);
		var strValue    = "";
		var intMonths	= 12 * intYears
		for (var i = 0 ; i < intMonths; i++){
			
			if ((intMonth + 1) < 10){
				strValue = "0" + (intMonth + 1);
			}else{
				strValue = (intMonth + 1);
			}
			
			objDrop.length =  objDrop.length + 1
			objDrop.options[objDrop.length - 1].text = arrMonths[intMonth] + " " + intYear;
			objDrop.options[objDrop.length - 1].value = strValue + "/" + intYear;
			intEndMonth = strValue;
			intEndYear  = intYear;
			intMonth++
			
			if (intMonth > 11){
				intMonth = 0 ;
				intYear++;
			}
		}
	}

	function fillAdultChild(){

		var arrAdults = new Array();
		var arrChild  = new Array();
		arrChild[0] = new Array();
		arrChild[0][0] = "0";
		
		var intAdultsStart = 0;
		/*
		if (blnAdultReq == "N"){
			intAdultsStart = 0;
		}
		*/
		intAdultsStart = 0;
			
		for (var i = 0 ; i <= intMaxAdults ; i++){
			
			arrAdults[i - intAdultsStart] = new Array();
			arrAdults[i - intAdultsStart][0] = i;

			if (i <= intMaxChild){
				arrChild[i ] = new Array();
				arrChild[i][0] = i;
			}
		}
		var objLB = new listBox();
		objLB.dataArray = arrAdults; 
		objLB.textIndex = "0";
		objLB.id = "selAdults";
		objLB.fillListBox();
		setField("selAdults", "1");
		
		objLB = new listBox();
		objLB.dataArray = arrChild; 
		objLB.textIndex = "0";
		objLB.id = "selChild";
		objLB.fillListBox();
		selAdults_onChange();
	}

	function selFromOnChange(strFrom, strTo){
		var strValue = getValue(strFrom);
		arrArrive.length = 0 ; 
		for (var i = 0 ; i < arrCity.length ; i++){
			var strTempDStation = aCnt[arrCity[i][0]].split("^");
			if (strTempDStation[0] == strValue){
				var strRoutes = arrCity[i][1].split(",");
				for (var x = 0 ; x < strRoutes.length ; x++){
					var strTempStation = aCnt[strRoutes[x]].split("^");
					arrArrive[x] = new Array(strTempStation[0], strTempStation[1]);					
				}
				break;
			}
		}

			
		var objLB = new listBox();
		objLB = new listBox();
		objLB.dataArray = arrArrive; 
		objLB.valueIndex = "0";
		objLB.textIndex = "1";
		objLB.blnFirstEmpty = true;
		objLB.firstTextValue = strDDFirstValue;
		objLB.id = strTo;
		objLB.fillListBox();
	}
	function selYrDeptOnChange(i){
		FillCalenderDay("selDtDept" +i, getValue("selYrDept"+i),getValue("selDtDept"+i));
		displayFltSrchDay("0",i);
	}

	function selAdults_onChange(){
		var arrInfants = new Array();
		var intAdults = Number(getValue("selAdults") )// + Number(getValue("selChild"));
		var strCInfants = getValue("selInfants");
		for (var i = 0 ; i <= intAdults ; i++){
			arrInfants[i] = new Array();
			arrInfants[i][0] = i;
		}
		var objLB = new listBox();
		objLB.dataArray = arrInfants; 
		objLB.textIndex = "0";
		objLB.id = "selInfants";
		objLB.fillListBox();
		
		setField("selInfants",  strCInfants);
	}

	function selDtDeptOnChange(i){
		displayFltSrchDay("0",i);	
	}

	function displayFltSrchDay(strID,i){
		switch (strID){
			case "0" :
				if (getValue("selDtDept"+i) != "" && getValue("selYrDept"+i) != "" ){
					DivWrite("spnDepDay" +i,  getWDay(getValue("selDtDept"+i) + "/" + getValue("selYrDept"+i)));								 
				}else{
					DivWrite("spnDepDay" +i,  "");	
				}			
				break;		
		}	
	}

	/*
	* Initialise Day And MonthYear Fields
	*/
	function initializeSrch(i){
		
		var strStartDate		= DateToString(addDays(StringToDate(strSysDate), Number(arrParams[1])));
		var arrSysDate = strStartDate.split("/");	
		

		setField("selYrDept" + i, arrSysDate[1] + "/" + arrSysDate[2]);
		selYrDeptOnChange(i);
		setField("selDtDept" + i, arrSysDate[0]);
		//setField("selFrom" + i, arrParams[4]);
		//selFromOnChange("selFrom" + i , "selTo" + i);
	}

	/*
	* Fill Current Day And MonthYear Fields
	*/
	function setNextDate(i)
	{	
		strCurrentDate = getValue("selDtDept"+i) + "/" + getValue("selYrDept"+i);	
		var strSysDateDef 	= DateToString(addDays(StringToDate(strCurrentDate), 1));	
		var arrSysDateDef = strSysDateDef.split("/");
		setField("selYrDept" + (i+1), arrSysDateDef[1] + "/" + arrSysDateDef[2]);
		selYrDeptOnChange(i+1);
		setField("selDtDept" + (i+1), arrSysDateDef[0]);
		//setField("selFrom" + (i+1), arrParams[4]);
		//selFromOnChange("selFrom" + (i+1) , "selTo" + (i+1));
	}
	
	function showFromCityList1(){
		strActiveLeg = 1;
		c = getAnchorPosition('selDtDept1');
		strCConvertURL = "showCityList.do?hdnMode=GETMPFROMFULLSEARCH";
		var objSpan = getFieldByID("spnAjaxSearch");
		objSpan.style.top	= c.y + 14 + "px";
		if (browser.isIE){
			objSpan.style.top	= c.y + 18 + "px";	
		}else {
			if (navigator.userAgent.indexOf("Safari") != -1){
				objSpan.style.top = c.y + 18 + "px"; 		
			}
		}
		
		if (document.body.clientWidth <1000){
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 20 + "px"; 
				if (browser.isIE){			
					objSpan.style.left = c.x - 33 + "px"; 
				}
			}else {
				objSpan.style.left = c.x - 585 + "px"; 
				if (browser.isIE){			
					objSpan.style.left = c.x - 563 + "px"; 
				}
			}
		}else {
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 20 + "px";	
				if (browser.isIE){	
					objSpan.style.left = c.x - 33 + "px"; 
				}
			}else {
				objSpan.style.left = c.x - 585 + "px";	
				if (browser.isIE){	
					objSpan.style.left = c.x - 562 + "px"; 
				}
			}
		}
		strAjaxSpan = "F";
		setDisplay("spnAjaxSearch", true);
		hdnMode="GETMPFROMFULLSEARCH"; 
		hdnFrom = objFromSD1.value;
		hdnTo = "";
		hdnTab 	= "MULTIPOINT";
		if (navigator.userAgent.indexOf("Safari") != -1){
			if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
			objAjaxTimer = setTimeout("popupPageLate(hdnMode , hdnFrom , hdnFromText,hdnTo,hdnTab)", 600);
		}else{
			frames["frmAjaxSearch"].callCityList(hdnMode , hdnFrom , hdnFromText, hdnTo,hdnTab);
		}	
	}

	function showFromCityList2(){
		strActiveLeg = 2;
		c = getAnchorPosition('selDtDept2');
		strCConvertURL = "showCityList.do?hdnMode=GETMPFROMFULLSEARCH";
		var objSpan = getFieldByID("spnAjaxSearch");
		objSpan.style.top	= c.y + 14 + "px";
		if (browser.isIE){
			objSpan.style.top	= c.y + 18 + "px";	
		}else {
			if (navigator.userAgent.indexOf("Safari") != -1){
				objSpan.style.top = c.y + 18 + "px"; 		
			}
		}
		
		if (document.body.clientWidth <1000){
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 20 + "px"; 
				if (browser.isIE){			
					objSpan.style.left = c.x - 33 + "px"; 
				}
			}else {
				objSpan.style.left = c.x - 585 + "px"; 
				if (browser.isIE){			
					objSpan.style.left = c.x - 563 + "px"; 
				}
			}
		}else {
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 20 + "px";	
				if (browser.isIE){	
					objSpan.style.left = c.x - 33 + "px"; 
				}
			}else {
				objSpan.style.left = c.x - 585 + "px";	
				if (browser.isIE){	
					objSpan.style.left = c.x - 562 + "px"; 
				}
			}
		}
		strAjaxSpan = "F";
		setDisplay("spnAjaxSearch", true);
		hdnMode="GETMPFROMFULLSEARCH"; 
		hdnFrom = objFromSD2.value;
		hdnTo = "";
		hdnTab 	= "MULTIPOINT";
		if (navigator.userAgent.indexOf("Safari") != -1){
			if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
			objAjaxTimer = setTimeout("popupPageLate(hdnMode , hdnFrom , hdnFromText,hdnTo,hdnTab)", 600);
		}else{
			frames["frmAjaxSearch"].callCityList(hdnMode , hdnFrom , hdnFromText, hdnTo,hdnTab);
		}	
	}

	function showFromCityList3(){
		strActiveLeg = 3;
		c = getAnchorPosition('selDtDept3');
		strCConvertURL = "showCityList.do?hdnMode=GETMPFROMFULLSEARCH";
		var objSpan = getFieldByID("spnAjaxSearch");
		objSpan.style.top	= c.y + 14 + "px";
		if (browser.isIE){
			objSpan.style.top	= c.y + 18 + "px";	
		}else {
			if (navigator.userAgent.indexOf("Safari") != -1){
				objSpan.style.top = c.y + 18 + "px"; 		
			}
		}
		
		if (document.body.clientWidth <1000){
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 20 + "px"; 
				if (browser.isIE){			
					objSpan.style.left = c.x - 33 + "px"; 
				}
			}else {
				objSpan.style.left = c.x - 585 + "px"; 
				if (browser.isIE){			
					objSpan.style.left = c.x - 563 + "px"; 
				}
			}
		}else {
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 20 + "px";	
				if (browser.isIE){	
					objSpan.style.left = c.x - 33 + "px"; 
				}
			}else {
				objSpan.style.left = c.x - 585 + "px";	
				if (browser.isIE){	
					objSpan.style.left = c.x - 562 + "px"; 
				}
			}
		}
		strAjaxSpan = "F";
		setDisplay("spnAjaxSearch", true);
		hdnMode="GETMPFROMFULLSEARCH"; 
		hdnFrom = objFromSD3.value;
		hdnTo = "";
		hdnTab 	= "MULTIPOINT";
		if (navigator.userAgent.indexOf("Safari") != -1){
			if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
			objAjaxTimer = setTimeout("popupPageLate(hdnMode , hdnFrom , hdnFromText,hdnTo,hdnTab)", 600);
		}else{
			frames["frmAjaxSearch"].callCityList(hdnMode , hdnFrom , hdnFromText, hdnTo,hdnTab);
		}	
	}

	function showFromCityList4(){
		strActiveLeg = 4;
		c = getAnchorPosition('selDtDept4');
		strCConvertURL = "showCityList.do?hdnMode=GETMPFROMFULLSEARCH";
		var objSpan = getFieldByID("spnAjaxSearch");
		objSpan.style.top	= c.y + 14 + "px";
		if (browser.isIE){
			objSpan.style.top	= c.y + 18 + "px";	
		}else {
			if (navigator.userAgent.indexOf("Safari") != -1){
				objSpan.style.top = c.y + 18 + "px"; 		
			}
		}
		
		if (document.body.clientWidth <1000){
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 20 + "px"; 
				if (browser.isIE){			
					objSpan.style.left = c.x - 33 + "px"; 
				}
			}else {
				objSpan.style.left = c.x - 585 + "px"; 
				if (browser.isIE){			
					objSpan.style.left = c.x - 563 + "px"; 
				}
			}
		}else {
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 20 + "px";	
				if (browser.isIE){	
					objSpan.style.left = c.x - 33 + "px"; 
				}
			}else {
				objSpan.style.left = c.x - 585 + "px";	
				if (browser.isIE){	
					objSpan.style.left = c.x - 562 + "px"; 
				}
			}
		}
		strAjaxSpan = "F";
		setDisplay("spnAjaxSearch", true);
		hdnMode="GETMPFROMFULLSEARCH"; 
		hdnFrom = objFromSD4.value;
		hdnTo = "";
		hdnTab 	= "MULTIPOINT";
		if (navigator.userAgent.indexOf("Safari") != -1){
			if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
			objAjaxTimer = setTimeout("popupPageLate(hdnMode , hdnFrom , hdnFromText,hdnTo,hdnTab)", 600);
		}else{
			frames["frmAjaxSearch"].callCityList(hdnMode , hdnFrom , hdnFromText, hdnTo,hdnTab);
		}	
	}

	function showFromCityList5(){
		strActiveLeg = 5;
		c = getAnchorPosition('selDtDept5');
		strCConvertURL = "showCityList.do?hdnMode=GETMPFROMFULLSEARCH";
		var objSpan = getFieldByID("spnAjaxSearch");
		objSpan.style.top	= c.y + 14 + "px";
		if (browser.isIE){
			objSpan.style.top	= c.y + 18 + "px";	
		}else {
			if (navigator.userAgent.indexOf("Safari") != -1){
				objSpan.style.top = c.y + 18 + "px"; 		
			}
		}
		
		if (document.body.clientWidth <1000){
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 20 + "px"; 
				if (browser.isIE){			
					objSpan.style.left = c.x - 33 + "px"; 
				}
			}else {
				objSpan.style.left = c.x - 585 + "px"; 
				if (browser.isIE){			
					objSpan.style.left = c.x - 563 + "px"; 
				}
			}
		}else {
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 20 + "px";	
				if (browser.isIE){	
					objSpan.style.left = c.x - 33 + "px"; 
				}
			}else {
				objSpan.style.left = c.x - 585 + "px";	
				if (browser.isIE){	
					objSpan.style.left = c.x - 562 + "px"; 
				}
			}
		}
		strAjaxSpan = "F";
		setDisplay("spnAjaxSearch", true);
		hdnMode="GETMPFROMFULLSEARCH"; 
		hdnFrom = objFromSD5.value;
		hdnTo = "";
		hdnTab 	= "MULTIPOINT";
		if (navigator.userAgent.indexOf("Safari") != -1){
			if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
			objAjaxTimer = setTimeout("popupPageLate(hdnMode , hdnFrom , hdnFromText,hdnTo,hdnTab)", 600);
		}else{
			frames["frmAjaxSearch"].callCityList(hdnMode , hdnFrom , hdnFromText, hdnTo,hdnTab);
		}	
	}

	function showFromCityList6(){
		strActiveLeg = 6;
		c = getAnchorPosition('selDtDept6');
		strCConvertURL = "showCityList.do?hdnMode=GETMPFROMFULLSEARCH";
		var objSpan = getFieldByID("spnAjaxSearch");
		objSpan.style.top	= c.y + 14 + "px";
		if (browser.isIE){
			objSpan.style.top	= c.y + 18 + "px";	
		}else {
			if (navigator.userAgent.indexOf("Safari") != -1){
				objSpan.style.top = c.y + 18 + "px"; 		
			}
		}
		
		if (document.body.clientWidth <1000){
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 20 + "px"; 
				if (browser.isIE){			
					objSpan.style.left = c.x - 33 + "px"; 
				}
			}else {
				objSpan.style.left = c.x - 585 + "px"; 
				if (browser.isIE){			
					objSpan.style.left = c.x - 563 + "px"; 
				}
			}
		}else {
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 20 + "px";	
				if (browser.isIE){	
					objSpan.style.left = c.x - 33 + "px"; 
				}
			}else {
				objSpan.style.left = c.x - 585 + "px";	
				if (browser.isIE){	
					objSpan.style.left = c.x - 562 + "px"; 
				}
			}
		}
		strAjaxSpan = "F";
		setDisplay("spnAjaxSearch", true);
		hdnMode="GETMPFROMFULLSEARCH"; 
		hdnFrom = objFromSD6.value;
		hdnTo = "";
		hdnTab 	= "MULTIPOINT";
		if (navigator.userAgent.indexOf("Safari") != -1){
			if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
			objAjaxTimer = setTimeout("popupPageLate(hdnMode , hdnFrom , hdnFromText,hdnTo,hdnTab)", 600);
		}else{
			frames["frmAjaxSearch"].callCityList(hdnMode , hdnFrom , hdnFromText, hdnTo,hdnTab);
		}	
	}

	function showToCityList1(){
		strActiveLeg = 1;
		c = getAnchorPosition('selDtDept1');
		hdnFrom = objFromSD1.value;
		hdnFromText = objFromSD1.text;
		strCConvertURL = "showCityList.do?hdnMode=GETMPTOFULLSEARCH&hdnFrom="+ hdnFrom + "&hdnFromText="+ hdnFromText;
		
		var objSpan = getFieldByID("spnAjaxSearch");
		objSpan.style.top	= c.y + 14 + "px"; 
		
		if (browser.isIE){
			objSpan.style.top	= c.y + 18 + "px";	
		}else {
			if (navigator.userAgent.indexOf("Safari") != -1){
				objSpan.style.top = c.y + 18 + "px";		
			}
		}

		if (document.body.clientWidth <1000){
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 270 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 277 + "px";
				}
			}else {
				objSpan.style.left = c.x - 335 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 323 + "px";
				}
			}
		}else {
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 270 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 277 + "px";	
				}
			}else {
				objSpan.style.left = c.x - 335 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 323 + "px";	
				}
			}
		}
		strAjaxSpan = "T";
		setDisplay("spnAjaxSearch", true);
		hdnMode="GETMPTOFULLSEARCH"; 
		hdnTo = objToSD1.value;
		hdnTab = "MULTIPOINT"
		if (navigator.userAgent.indexOf("Safari") != -1){
			if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
			objAjaxTimer = setTimeout("popupPageLate(hdnMode , hdnFrom , hdnFromText,hdnTo,hdnTab)", 600);
		}else{
			frames["frmAjaxSearch"].callCityList(hdnMode , hdnFrom , hdnFromText , hdnTo,hdnTab);
		}		
	}

	function showToCityList2(){
		strActiveLeg = 2;
		c = getAnchorPosition('selDtDept2');
		hdnFrom = objFromSD2.value;
		hdnFromText = objFromSD2.text;
		strCConvertURL = "showCityList.do?hdnMode=GETMPTOFULLSEARCH&hdnFrom="+ hdnFrom + "&hdnFromText="+ hdnFromText;
		
		var objSpan = getFieldByID("spnAjaxSearch");
		objSpan.style.top	= c.y + 14 + "px"; 
		
		if (browser.isIE){
			objSpan.style.top	= c.y + 18 + "px";	
		}else {
			if (navigator.userAgent.indexOf("Safari") != -1){
				objSpan.style.top = c.y + 18 + "px";		
			}
		}

		if (document.body.clientWidth <1000){
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 270 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 277 + "px";
				}
			}else {
				objSpan.style.left = c.x - 335 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 323 + "px";
				}
			}
		}else {
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 270 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 277 + "px";	
				}
			}else {
				objSpan.style.left = c.x - 335 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 323 + "px";	
				}
			}
		}
		strAjaxSpan = "T";
		setDisplay("spnAjaxSearch", true);
		hdnMode="GETMPTOFULLSEARCH"; 
		hdnTo = objToSD2.value;
		hdnTab = "MULTIPOINT"
		if (navigator.userAgent.indexOf("Safari") != -1){
			if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
			objAjaxTimer = setTimeout("popupPageLate(hdnMode , hdnFrom , hdnFromText,hdnTo,hdnTab)", 600);
		}else{
			frames["frmAjaxSearch"].callCityList(hdnMode , hdnFrom , hdnFromText , hdnTo,hdnTab);
		}		
	}

	function showToCityList3(){
		strActiveLeg = 3;
		c = getAnchorPosition('selDtDept3');
		hdnFrom = objFromSD3.value;
		hdnFromText = objFromSD3.text;
		strCConvertURL = "showCityList.do?hdnMode=GETMPTOFULLSEARCH&hdnFrom="+ hdnFrom + "&hdnFromText="+ hdnFromText;
		
		var objSpan = getFieldByID("spnAjaxSearch");
		objSpan.style.top	= c.y + 14 + "px"; 
		
		if (browser.isIE){
			objSpan.style.top	= c.y + 18 + "px";	
		}else {
			if (navigator.userAgent.indexOf("Safari") != -1){
				objSpan.style.top = c.y + 18 + "px";		
			}
		}

		if (document.body.clientWidth <1000){
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 270 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 277 + "px";
				}
			}else {
				objSpan.style.left = c.x - 335 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 323 + "px";
				}
			}
		}else {
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 270 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 277 + "px";	
				}
			}else {
				objSpan.style.left = c.x - 335 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 323 + "px";	
				}
			}
		}
		strAjaxSpan = "T";
		setDisplay("spnAjaxSearch", true);
		hdnMode="GETMPTOFULLSEARCH"; 
		hdnTo = objToSD3.value;
		hdnTab = "MULTIPOINT"
		if (navigator.userAgent.indexOf("Safari") != -1){
			if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
			objAjaxTimer = setTimeout("popupPageLate(hdnMode , hdnFrom , hdnFromText,hdnTo,hdnTab)", 600);
		}else{
			frames["frmAjaxSearch"].callCityList(hdnMode , hdnFrom , hdnFromText , hdnTo,hdnTab);
		}		
	}

	function showToCityList4(){
		strActiveLeg = 4;
		c = getAnchorPosition('selDtDept4');
		hdnFrom = objFromSD4.value;
		hdnFromText = objFromSD4.text;
		strCConvertURL = "showCityList.do?hdnMode=GETMPTOFULLSEARCH&hdnFrom="+ hdnFrom + "&hdnFromText="+ hdnFromText;
		
		var objSpan = getFieldByID("spnAjaxSearch");
		objSpan.style.top	= c.y + 14 + "px"; 
		
		if (browser.isIE){
			objSpan.style.top	= c.y + 18 + "px";	
		}else {
			if (navigator.userAgent.indexOf("Safari") != -1){
				objSpan.style.top = c.y + 18 + "px";		
			}
		}

		if (document.body.clientWidth <1000){
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 270 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 277 + "px";
				}
			}else {
				objSpan.style.left = c.x - 335 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 323 + "px";
				}
			}
		}else {
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 270 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 277 + "px";	
				}
			}else {
				objSpan.style.left = c.x - 335 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 323 + "px";	
				}
			}
		}
		strAjaxSpan = "T";
		setDisplay("spnAjaxSearch", true);
		hdnMode="GETMPTOFULLSEARCH"; 
		hdnTo = objToSD4.value;
		hdnTab = "MULTIPOINT"
		if (navigator.userAgent.indexOf("Safari") != -1){
			if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
			objAjaxTimer = setTimeout("popupPageLate(hdnMode , hdnFrom , hdnFromText,hdnTo,hdnTab)", 600);
		}else{
			frames["frmAjaxSearch"].callCityList(hdnMode , hdnFrom , hdnFromText , hdnTo,hdnTab);
		}		
	}

	function showToCityList5(){
		strActiveLeg = 5;
		c = getAnchorPosition('selDtDept5');
		hdnFrom = objFromSD5.value;
		hdnFromText = objFromSD5.text;
		strCConvertURL = "showCityList.do?hdnMode=GETMPTOFULLSEARCH&hdnFrom="+ hdnFrom + "&hdnFromText="+ hdnFromText;
		
		var objSpan = getFieldByID("spnAjaxSearch");
		objSpan.style.top	= c.y + 14 + "px"; 
		
		if (browser.isIE){
			objSpan.style.top	= c.y + 18 + "px";	
		}else {
			if (navigator.userAgent.indexOf("Safari") != -1){
				objSpan.style.top = c.y + 18 + "px";		
			}
		}

		if (document.body.clientWidth <1000){
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 270 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 277 + "px";
				}
			}else {
				objSpan.style.left = c.x - 335 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 323 + "px";
				}
			}
		}else {
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 270 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 277 + "px";	
				}
			}else {
				objSpan.style.left = c.x - 335 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 323 + "px";	
				}
			}
		}
		strAjaxSpan = "T";
		setDisplay("spnAjaxSearch", true);
		hdnMode="GETMPTOFULLSEARCH"; 
		hdnTo = objToSD5.value;
		hdnTab = "MULTIPOINT"
		if (navigator.userAgent.indexOf("Safari") != -1){
			if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
			objAjaxTimer = setTimeout("popupPageLate(hdnMode , hdnFrom , hdnFromText,hdnTo,hdnTab)", 600);
		}else{
			frames["frmAjaxSearch"].callCityList(hdnMode , hdnFrom , hdnFromText , hdnTo,hdnTab);
		}		
	}

	function showToCityList6(){
		strActiveLeg = 6;
		c = getAnchorPosition('selDtDept6');
		hdnFrom = objFromSD6.value;
		hdnFromText = objFromSD6.text;
		strCConvertURL = "showCityList.do?hdnMode=GETMPTOFULLSEARCH&hdnFrom="+ hdnFrom + "&hdnFromText="+ hdnFromText;
		
		var objSpan = getFieldByID("spnAjaxSearch");
		objSpan.style.top	= c.y + 14 + "px"; 
		
		if (browser.isIE){
			objSpan.style.top	= c.y + 18 + "px";	
		}else {
			if (navigator.userAgent.indexOf("Safari") != -1){
				objSpan.style.top = c.y + 18 + "px";		
			}
		}

		if (document.body.clientWidth <1000){
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 270 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 277 + "px";
				}
			}else {
				objSpan.style.left = c.x - 335 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 323 + "px";
				}
			}
		}else {
			if (strPGLanguage == "ar"){
				objSpan.style.left = c.x - 270 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 277 + "px";	
				}
			}else {
				objSpan.style.left = c.x - 335 + "px";
				if (browser.isIE){			
					objSpan.style.left = c.x - 323 + "px";	
				}
			}
		}
		strAjaxSpan = "T";
		setDisplay("spnAjaxSearch", true);
		hdnMode="GETMPTOFULLSEARCH"; 
		hdnTo = objToSD6.value;
		hdnTab = "MULTIPOINT"
		if (navigator.userAgent.indexOf("Safari") != -1){
			if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
			objAjaxTimer = setTimeout("popupPageLate(hdnMode , hdnFrom , hdnFromText,hdnTo,hdnTab)", 600);
		}else{
			frames["frmAjaxSearch"].callCityList(hdnMode , hdnFrom , hdnFromText , hdnTo,hdnTab);
		}		
	}

	function popupPageLate(hdnMode , hdnFrom , hdnFromText,hdnTo,hdnTab){
		frames["frmAjaxSearch"].callCityList(hdnMode , hdnFrom , hdnFromText,hdnTo);
	}
	
	function setFlightFullSearchMP(strCity,strType){
		if (strType == "F"){
			if (strActiveLeg == "1"){
				strSelectedCityFrom1 = strCity;
			}else if (strActiveLeg == "2"){
				strSelectedCityFrom2 = strCity;
			}else if (strActiveLeg == "3"){
				strSelectedCityFrom3 = strCity;
			}else if (strActiveLeg == "4"){
				strSelectedCityFrom4 = strCity;
			}else if (strActiveLeg == "5"){
				strSelectedCityFrom5 = strCity;
			}else if (strActiveLeg == "6"){
				strSelectedCityFrom6 = strCity;
			}
			hdnMode = "GETFSFROMSTATION";
			hdnChar = strCity ;//strCity.substring(0,1);
			strFromMethod = "ALL"
			strToMethod = "";
			remoteSubmit();
		}else {
			hdnMode = "GETFSTOSTATION";	
			if (strActiveLeg == "1"){
				strSelectedCityTo1 = strCity;
				hdnFrom = objFromSD1.value;
			}else if (strActiveLeg == "2"){
				strSelectedCityTo2 = strCity;
				hdnFrom = objFromSD2.value;
			}else if (strActiveLeg == "3"){
				strSelectedCityTo3 = strCity;
				hdnFrom = objFromSD3.value;
			}else if (strActiveLeg == "4"){
				strSelectedCityTo4 = strCity;
				hdnFrom = objFromSD4.value;
			}else if (strActiveLeg == "5"){
				strSelectedCityTo5 = strCity;
				hdnFrom = objFromSD5.value;
			}else if (strActiveLeg == "6"){
				strSelectedCityTo6 = strCity;
				hdnFrom = objFromSD6.value;
			}
			hdnChar = strCity ;//strCity.substring(0,1);
			strToMethod = "ALL"
			strFromMethod = "";
			remoteSubmit();		
		}
		
	}
	
	function pageClose(){
		try{
			parent.setDisplay("spnAjaxSearch", false);
		}catch(e){}
	}

	/*
	 * Ajax Remote Submit
	 */
	function remoteSubmit(){
		hdnTab 			= "MULTIPOINT";
		makePOST(strPostURL + "/public/multipointSearch.do","hdnMode=" + hdnMode + "&hdnData="+ escape(hdnData)+ "&hdnChar="+ escape(hdnChar) + "&hdnFrom="+ escape(hdnFrom)+ "&hdnTab="+ escape(hdnTab));
	}

	/*
	 * Ajax Return Call
	 */
	function processStateChange() {
		if (httpReq.readyState == 4){
			if (httpReq.status == 200){
				strSYSError = "";
				eval(httpReq.responseText);
				if (strSYSError == ""){
					if (navigator.userAgent.indexOf("Safari") != -1){
						if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
						objAjaxTimer = setTimeout("ajaxReturnCall(true)",300);
					}else {
						ajaxReturnCall(true);
					}
				}	
				setDisplay("spnAjaxSearch", false);
			}
		}
	}

	/*
	 * after Ajax Reuturn 
	 */
	function ajaxReturnCall(blnSuccess){
		if (strActiveLeg == "1"){
			if (hdnMode == "GETFSFROMSTATION")
			{		
				objFromSD1.dataArray = arrFSFromCity;
				objFromSD1.refrehListData();	
				resizeCity1("F", arrFSFromCity.length,arrFSFromCity);
				if (strFromMethod == "ALL"){
					objFromSD1.value = strSelectedCityFrom1;																	
					objFromSD1.refrehValue();
					getFromStations_onChange1();
					strFromMethod = "";
				} else if (strFromMethod == "ONE"){
					objFromSD1.value = strSelectedCityFrom1;																	
					objFromSD1.refrehValue();
					
					if (strSelectedCityTo1 != ""){
						getToStations_onChange1();
					}else {
						getFromStations_onChange1();
					}				
					strFromMethod = "";
				} else {
					hdnMode = "GETFSTOSTATION";		
					if (arrFSFromCity.length == 1){
						if (hdnChar == arrFSFromCity[0][1]){
							objFromSD1.value = arrFSFromCity[0][0];
							objFromSD1.refrehValue();
						}else {
							hdnFrom = objFromSD1.value;
							objToSD1.defaultValue = strHDDestination;
							objToSD1.resetDefaultValue();
							remoteSubmit();
						}
					}

				}		
			}else if (hdnMode == "GETFSTOSTATION"){
				objToSD1.dataArray = arrFSToCity;
				objToSD1.refrehListData();
				resizeCity1("T", arrFSToCity.length,arrFSToCity);
				if (strToMethod == "ALL"){
					objToSD1.value = strSelectedCityTo1;																	
					objToSD1.refrehValue();
					strToMethod = "";			
				} else if (strToMethod == "ONE"){
					objToSD1.value = strSelectedCityTo1;																	
					objToSD1.refrehValue();
					strToMethod = "";
				}else {
					if (arrFSToCity.length == 1){
						if (hdnChar == arrFSToCity[0][1]){
							objToSD1.value = arrFSToCity[0][0];
							objToSD1.refrehValue();
						}
					}
				}  		

			}
		}else if (strActiveLeg == "2"){
			if (hdnMode == "GETFSFROMSTATION")
			{
				objFromSD2.dataArray = arrFSFromCity;
				objFromSD2.refrehListData();	
				resizeCity2("F", arrFSFromCity.length,arrFSFromCity);
				if (strFromMethod == "ALL"){
					objFromSD2.value = strSelectedCityFrom2;																	
					objFromSD2.refrehValue();
					getFromStations_onChange2();
					strFromMethod = "";
				} else if (strFromMethod == "ONE"){
					objFromSD2.value = strSelectedCityFrom2;																	
					objFromSD2.refrehValue();
					
					if (strSelectedCityTo2 != ""){
						getToStations_onChange2();
					}else {
						getFromStations_onChange2();
					}				
					strFromMethod = "";
				} else {
					hdnMode = "GETFSTOSTATION";	
					if (arrFSFromCity.length == 1){
						if (hdnChar == arrFSFromCity[0][1]){
							objFromSD2.value = arrFSFromCity[0][0];
							objFromSD2.refrehValue();
						}else {
							hdnFrom = objFromSD2.value;
							objToSD2.defaultValue = strHDDestination;
							objToSD2.resetDefaultValue();
							remoteSubmit();
						}
					}
				}		
			}else if (hdnMode == "GETFSTOSTATION"){
				objToSD2.dataArray = arrFSToCity;
				objToSD2.refrehListData();
				resizeCity2("T", arrFSToCity.length,arrFSToCity);
				if (strToMethod == "ALL"){
					objToSD2.value = strSelectedCityTo2;																	
					objToSD2.refrehValue();
					strToMethod = "";			
				} else if (strToMethod == "ONE"){
					objToSD2.value = strSelectedCityTo2;																	
					objToSD2.refrehValue();
					strToMethod = "";
				} else {
					if (arrFSToCity.length == 1){
						if (hdnChar == arrFSToCity[0][1]){
							objToSD2.value = arrFSToCity[0][0];
							objToSD2.refrehValue();
						}
					}
				}  		

			}
		}else if (strActiveLeg == "3"){
			if (hdnMode == "GETFSFROMSTATION")
			{
				objFromSD3.dataArray = arrFSFromCity;
				objFromSD3.refrehListData();	
				resizeCity3("F", arrFSFromCity.length,arrFSFromCity);
				if (strFromMethod == "ALL"){
					objFromSD3.value = strSelectedCityFrom3;																	
					objFromSD3.refrehValue();
					getFromStations_onChange3();
					strFromMethod = "";
				} else if (strFromMethod == "ONE"){
					objFromSD3.value = strSelectedCityFrom3;																	
					objFromSD3.refrehValue();
					
					if (strSelectedCityTo3 != ""){
						getToStations_onChange3();
					}else {
						getFromStations_onChange3();
					}				
					strFromMethod = "";
				} else {
					hdnMode = "GETFSTOSTATION";	
					if (arrFSFromCity.length == 1){
						if (hdnChar == arrFSFromCity[0][1]){
							objFromSD3.value = arrFSFromCity[0][0];
							objFromSD3.refrehValue();
						}else {
							hdnFrom = objFromSD3.value;
							objToSD3.defaultValue = strHDDestination;
							objToSD3.resetDefaultValue();
							remoteSubmit();
						}
					}
				}		
			}else if (hdnMode == "GETFSTOSTATION"){
				objToSD3.dataArray = arrFSToCity;
				objToSD3.refrehListData();
				resizeCity3("T", arrFSToCity.length,arrFSToCity);
				if (strToMethod == "ALL"){
					objToSD3.value = strSelectedCityTo3;																	
					objToSD3.refrehValue();
					strToMethod = "";			
				} else if (strToMethod == "ONE"){
					objToSD3.value = strSelectedCityTo3;																	
					objToSD3.refrehValue();
					strToMethod = "";
				}else {
					if (arrFSToCity.length == 1){
						if (hdnChar == arrFSToCity[0][1]){
							objToSD3.value = arrFSToCity[0][0];
							objToSD3.refrehValue();
						}
					}
				}  		

			}
		}else if (strActiveLeg == "4"){
			if (hdnMode == "GETFSFROMSTATION")
			{
				objFromSD4.dataArray = arrFSFromCity;
				objFromSD4.refrehListData();	
				resizeCity4("F", arrFSFromCity.length,arrFSFromCity);
				if (strFromMethod == "ALL"){
					objFromSD4.value = strSelectedCityFrom4;																	
					objFromSD4.refrehValue();
					getFromStations_onChange4();
					strFromMethod = "";
				} else if (strFromMethod == "ONE"){
					objFromSD4.value = strSelectedCityFrom4;																	
					objFromSD4.refrehValue();
					
					if (strSelectedCityTo4 != ""){
						getToStations_onChange4();
					}else {
						getFromStations_onChange4();
					}				
					strFromMethod = "";
				} else {
					hdnMode = "GETFSTOSTATION";	
					if (arrFSFromCity.length == 1){
						if (hdnChar == arrFSFromCity[0][1]){
							objFromSD4.value = arrFSFromCity[0][0];
							objFromSD4.refrehValue();
						}else {
							hdnFrom = objFromSD4.value;
							objToSD4.defaultValue = strHDDestination;
							objToSD4.resetDefaultValue();
							remoteSubmit();
						}
					}
				}		
			}else if (hdnMode == "GETFSTOSTATION"){
				objToSD4.dataArray = arrFSToCity;
				objToSD4.refrehListData();
				resizeCity4("T", arrFSToCity.length,arrFSToCity);
				if (strToMethod == "ALL"){
					objToSD4.value = strSelectedCityTo4;																	
					objToSD4.refrehValue();
					strToMethod = "";			
				} else if (strToMethod == "ONE"){
					objToSD4.value = strSelectedCityTo4;																	
					objToSD4.refrehValue();
					strToMethod = "";
				}else {
					if (arrFSToCity.length == 1){
						if (hdnChar == arrFSToCity[0][1]){
							objToSD4.value = arrFSToCity[0][0];
							objToSD4.refrehValue();
						}
					}
				}  		

			}
		}else if (strActiveLeg == "5"){
			if (hdnMode == "GETFSFROMSTATION")
			{
				objFromSD5.dataArray = arrFSFromCity;
				objFromSD5.refrehListData();	
				resizeCity5("F", arrFSFromCity.length,arrFSFromCity);
				if (strFromMethod == "ALL"){
					objFromSD5.value = strSelectedCityFrom5;																	
					objFromSD5.refrehValue();
					getFromStations_onChange5();
					strFromMethod = "";
				} else if (strFromMethod == "ONE"){
					objFromSD5.value = strSelectedCityFrom5;																	
					objFromSD5.refrehValue();
					
					if (strSelectedCityTo5 != ""){
						getToStations_onChange5();
					}else {
						getFromStations_onChange5();
					}				
					strFromMethod = "";
				} else {
					hdnMode = "GETFSTOSTATION";	
					if (arrFSFromCity.length == 1){
						if (hdnChar == arrFSFromCity[0][1]){
							objFromSD5.value = arrFSFromCity[0][0];
							objFromSD5.refrehValue();
						}else {
							hdnFrom = objFromSD5.value;
							objToSD5.defaultValue = strHDDestination;
							objToSD5.resetDefaultValue();
							remoteSubmit();
						}
					}
				}		
			}else if (hdnMode == "GETFSTOSTATION"){
				objToSD5.dataArray = arrFSToCity;
				objToSD5.refrehListData();
				resizeCity5("T", arrFSToCity.length,arrFSToCity);
				if (strToMethod == "ALL"){
					objToSD5.value = strSelectedCityTo5;																	
					objToSD5.refrehValue();
					strToMethod = "";			
				} else if (strToMethod == "ONE"){
					objToSD5.value = strSelectedCityTo5;																	
					objToSD5.refrehValue();
					strToMethod = "";
				}else {
					if (arrFSToCity.length == 1){
						if (hdnChar == arrFSToCity[0][1]){
							objToSD5.value = arrFSToCity[0][0];
							objToSD5.refrehValue();
						}
					}
				}  		

			}
		}else if (strActiveLeg == "6"){
			if (hdnMode == "GETFSFROMSTATION")
			{
				objFromSD6.dataArray = arrFSFromCity;
				objFromSD6.refrehListData();	
				resizeCity6("F", arrFSFromCity.length,arrFSFromCity);
				if (strFromMethod == "ALL"){
					objFromSD6.value = strSelectedCityFrom6;																	
					objFromSD6.refrehValue();
					getFromStations_onChange6();
					strFromMethod = "";
				} else if (strFromMethod == "ONE"){
					objFromSD6.value = strSelectedCityFrom6;																	
					objFromSD6.refrehValue();
					
					if (strSelectedCityTo6 != ""){
						getToStations_onChange6();
					}else {
						getFromStations_onChange6();
					}				
					strFromMethod = "";
				} else {
					hdnMode = "GETFSTOSTATION";	
					if (arrFSFromCity.length == 1){
						if (hdnChar == arrFSFromCity[0][1]){
							objFromSD6.value = arrFSFromCity[0][0];
							objFromSD6.refrehValue();
						}else {
							hdnFrom = objFromSD6.value;
							objToSD6.defaultValue = strHDDestination;
							objToSD6.resetDefaultValue();
							remoteSubmit();
						}
					}
				}		
			}else if (hdnMode == "GETFSTOSTATION"){
				objToSD6.dataArray = arrFSToCity;
				objToSD6.refrehListData();
				resizeCity6("T", arrFSToCity.length,arrFSToCity);
				if (strToMethod == "ALL"){
					objToSD6.value = strSelectedCityTo6;																	
					objToSD6.refrehValue();
					strToMethod = "";			
				} else if (strToMethod == "ONE"){
					objToSD6.value = strSelectedCityTo6;																	
					objToSD6.refrehValue();
					strToMethod = "";
				}else {
					if (arrFSToCity.length == 1){
						if (hdnChar == arrFSToCity[0][1]){
							objToSD6.value = arrFSToCity[0][0];
							objToSD6.refrehValue();
						}
					}
				} 		

			}
		}
		
	}

	function getFromStations1(strvalue){
		if (objFromSD1.lastKeyUp != 9 && objFromSD1.lastKeyDown != 9 && objFromSD1.lastKeyDown != 40 && objFromSD1.lastKeyUp != 40){
			strActiveLeg = "1";
			strSelectedCityTo1 = "";
			if (strvalue.length > 0){
				hdnChar = strvalue;		
			}else {
				hdnChar = "###";		
			}
			hdnMode = "GETFSFROMSTATION";	
			remoteSubmit();	
		}
	}

	function getFromStations2(strvalue){
		if (objFromSD2.lastKeyUp != 9 && objFromSD2.lastKeyDown != 9 && objFromSD2.lastKeyDown != 40 && objFromSD2.lastKeyUp != 40){
			strActiveLeg = "2";
			strSelectedCityTo2 = "";
			if (strvalue.length > 0){
				hdnChar = strvalue;		
			}else {
				hdnChar = "###";		
			}
			hdnMode = "GETFSFROMSTATION";	
			remoteSubmit();	
		}
	}

	function getFromStations3(strvalue){
		if (objFromSD3.lastKeyUp != 9 && objFromSD3.lastKeyDown != 9 && objFromSD3.lastKeyDown != 40 && objFromSD3.lastKeyUp != 40){
			strActiveLeg = "3";
			strSelectedCityTo3 = "";
			if (strvalue.length > 0){
				hdnChar = strvalue;		
			}else {
				hdnChar = "###";		
			}
			hdnMode = "GETFSFROMSTATION";	
			remoteSubmit();	
		}
	}

	function getFromStations4(strvalue){
		if (objFromSD4.lastKeyUp != 9 && objFromSD4.lastKeyDown != 9 && objFromSD4.lastKeyDown != 40 && objFromSD4.lastKeyUp != 40){
			strActiveLeg = "4";
			strSelectedCityTo4 = "";
			if (strvalue.length > 0){
				hdnChar = strvalue;		
			}else {
				hdnChar = "###";		
			}
			hdnMode = "GETFSFROMSTATION";	
			remoteSubmit();	
		}
	}

	function getFromStations5(strvalue){
		if (objFromSD5.lastKeyUp != 9 && objFromSD5.lastKeyDown != 9 && objFromSD5.lastKeyDown != 40 && objFromSD5.lastKeyUp != 40){
			strActiveLeg = "5";
			strSelectedCityTo5 = "";
			if (strvalue.length > 0){
				hdnChar = strvalue;		
			}else {
				hdnChar = "###";		
			}
			hdnMode = "GETFSFROMSTATION";	
			remoteSubmit();	
		}
	}

	function getFromStations6(strvalue){
		if (objFromSD6.lastKeyUp != 9 && objFromSD6.lastKeyDown != 9 && objFromSD6.lastKeyDown != 40 && objFromSD6.lastKeyUp != 40){
			strActiveLeg = "6";
			strSelectedCityTo6 = "";
			if (strvalue.length > 0){
				hdnChar = strvalue;		
			}else {
				hdnChar = "###";		
			}
			hdnMode = "GETFSFROMSTATION";	
			remoteSubmit();	
		}
	}

	function getToStations1(strvalue){
		if (objToSD1.lastKeyUp != 9 && objToSD1.lastKeyDown != 9 && objToSD1.lastKeyDown != 40 && objToSD1.lastKeyUp != 40){
			strActiveLeg = "1"
			strErrLiTag = "";
			strErrMsg = "";
			if(objFromSD1.defaultValue != strHDOrigin){
				if (objFromSD1.value == strNoRecordIATACode || objFromSD1.value == "" ){
					strErrMsg += buildError(arrErr["003"], arrControls[0][1]);	
					alert(strErrMsg);
					return;
				}
			}
			if (strvalue.length > 0){	
				hdnChar = strvalue;		
			}else {
				hdnChar =  "";
			}
			hdnMode = "GETFSTOSTATION";	
			hdnFrom = objFromSD1.value;
			remoteSubmit();
		}
	}

	function getToStations2(strvalue){
		if (objToSD2.lastKeyUp != 9 && objToSD2.lastKeyDown != 9 && objToSD2.lastKeyDown != 40 && objToSD2.lastKeyUp != 40){
			strActiveLeg = "2"
			strErrLiTag = "";
			strErrMsg = "";
			if(objFromSD2.defaultValue != strHDOrigin){
				if (objFromSD2.value == strNoRecordIATACode || objFromSD2.value == "" ){
					strErrMsg += buildError(arrErr["003"], arrControls[0][1]);	
					alert(strErrMsg);
					return;
				}
			}
			if (strvalue.length > 0){	
				hdnChar = strvalue;		
			}else {
				hdnChar =  "";
			}
			hdnMode = "GETFSTOSTATION";	
			hdnFrom = objFromSD2.value;
			remoteSubmit();	
		}
	}

	function getToStations3(strvalue){
		if (objToSD3.lastKeyUp != 9 && objToSD3.lastKeyDown != 9 && objToSD3.lastKeyDown != 40 && objToSD3.lastKeyUp != 40){
			strActiveLeg = "3"
			strErrLiTag = "";
			strErrMsg = "";
			if(objFromSD3.defaultValue != strHDOrigin){
				if (objFromSD3.value == strNoRecordIATACode || objFromSD3.value == "" ){
					strErrMsg += buildError(arrErr["003"], arrControls[0][1]);	
					alert(strErrMsg);
					return;
				}
			}
			if (strvalue.length > 0){	
				hdnChar = strvalue;		
			}else {
				hdnChar =  "";
			}
			hdnMode = "GETFSTOSTATION";	
			hdnFrom = objFromSD3.value;
			remoteSubmit();	
		}
	}

	function getToStations4(strvalue){
		if (objToSD4.lastKeyUp != 9 && objToSD4.lastKeyDown != 9 && objToSD4.lastKeyDown != 40 && objToSD4.lastKeyUp != 40){
			strActiveLeg = "4"
			strErrLiTag = "";
			strErrMsg = "";
			if(objFromSD4.defaultValue != strHDOrigin){
				if (objFromSD4.value == strNoRecordIATACode || objFromSD4.value == "" ){
					strErrMsg += buildError(arrErr["003"], arrControls[0][1]);	
					alert(strErrMsg);
					return;
				}
			}
			if (strvalue.length > 0){	
				hdnChar = strvalue;		
			}else {
				hdnChar =  "";
			}
			hdnMode = "GETFSTOSTATION";	
			hdnFrom = objFromSD4.value;
			remoteSubmit();	
		}
	}

	function getToStations5(strvalue){
		if (objToSD5.lastKeyUp != 9 && objToSD5.lastKeyDown != 9 && objToSD5.lastKeyDown != 40 && objToSD5.lastKeyUp != 40){
			strActiveLeg = "5"
			strErrLiTag = "";
			strErrMsg = "";
			if(objFromSD5.defaultValue != strHDOrigin){
				if (objFromSD5.value == strNoRecordIATACode || objFromSD5.value == "" ){
					strErrMsg += buildError(arrErr["003"], arrControls[0][1]);	
					alert(strErrMsg);
					return;
				}
			}
			if (strvalue.length > 0){	
				hdnChar = strvalue;		
			}else {
				hdnChar =  "";
			}
			hdnMode = "GETFSTOSTATION";	
			hdnFrom = objFromSD5.value;
			remoteSubmit();	
		}
	}

	function getToStations6(strvalue){
		if (objToSD6.lastKeyUp != 9 && objToSD6.lastKeyDown != 9 && objToSD6.lastKeyDown != 40 && objToSD6.lastKeyUp != 40){
			strActiveLeg = "6"
			strErrLiTag = "";
			strErrMsg = "";
			if(objFromSD6.defaultValue != strHDOrigin){
				if (objFromSD6.value == strNoRecordIATACode || objFromSD6.value == "" ){
					strErrMsg += buildError(arrErr["003"], arrControls[0][1]);	
					alert(strErrMsg);
					return;
				}
			}
			if (strvalue.length > 0){	
				hdnChar = strvalue;		
			}else {
				hdnChar =  "";
			}
			hdnMode = "GETFSTOSTATION";	
			hdnFrom = objFromSD6.value;
			remoteSubmit();	
		}
	}


	function getFromStations_onChange_one1(){
	
		strActiveLeg = "1"
		strSelectedCityTo1 = "";
		hdnMode = "GETFSFROMSTATION";
		strSelectedCityFrom1 = objFromSD1.value;
		hdnChar = objFromSD1.text ;//strCity.substring(0,1);
		strFromMethod = "ONE"
		remoteSubmit();		
	}

	function getFromStations_onChange_one2(){
	
		strActiveLeg = "2"
		strSelectedCityTo2 = "";
		hdnMode = "GETFSFROMSTATION";
		strSelectedCityFrom2 = objFromSD2.value;
		hdnChar = objFromSD2.text ;//strCity.substring(0,1);
		strFromMethod = "ONE"
		remoteSubmit();		
	}

	function getFromStations_onChange_one3(){
	
		strActiveLeg = "3"
		strSelectedCityTo3 = "";
		hdnMode = "GETFSFROMSTATION";
		strSelectedCityFrom3 = objFromSD3.value;
		hdnChar = objFromSD3.text ;//strCity.substring(0,1);
		strFromMethod = "ONE"
		remoteSubmit();		
	}

	function getFromStations_onChange_one4(){
	
		strActiveLeg = "4"
		strSelectedCityTo4 = "";
		hdnMode = "GETFSFROMSTATION";
		strSelectedCityFrom4 = objFromSD4.value;
		hdnChar = objFromSD4.text ;//strCity.substring(0,1);
		strFromMethod = "ONE"
		remoteSubmit();		
	}

	function getFromStations_onChange_one5(){
	
		strActiveLeg = "5"
		strSelectedCityTo5 = "";
		hdnMode = "GETFSFROMSTATION";
		strSelectedCityFrom5 = objFromSD5.value;
		hdnChar = objFromSD5.text ;//strCity.substring(0,1);
		strFromMethod = "ONE"
		remoteSubmit();		
	}

	function getFromStations_onChange_one6(){
	
		strActiveLeg = "6"
		strSelectedCityTo6 = "";
		hdnMode = "GETFSFROMSTATION";
		strSelectedCityFrom6 = objFromSD6.value;
		hdnChar = objFromSD6.text ;//strCity.substring(0,1);
		strFromMethod = "ONE"
		remoteSubmit();		
	}

	function getFromStations_onChange1(){
		strActiveLeg = "1"
		hdnMode = "GETFSTOSTATION";
		hdnChar = "";
		hdnFrom = objFromSD1.value;
		objToSD1.defaultValue = strHDDestination;
		objToSD1.resetDefaultValue();
		remoteSubmit();		
	}

	function getFromStations_onChange2(){
		strActiveLeg = "2"
		hdnMode = "GETFSTOSTATION";
		hdnChar = "";
		hdnFrom = objFromSD2.value;
		objToSD2.defaultValue = strHDDestination;
		objToSD2.resetDefaultValue();
		remoteSubmit();		
	}

	function getFromStations_onChange3(){
		strActiveLeg = "3"
		hdnMode = "GETFSTOSTATION";
		hdnChar = "";
		hdnFrom = objFromSD3.value;
		objToSD3.defaultValue = strHDDestination;
		objToSD3.resetDefaultValue();
		remoteSubmit();		
	}

	function getFromStations_onChange4(){
		strActiveLeg = "4"
		hdnMode = "GETFSTOSTATION";
		hdnChar = "";
		hdnFrom = objFromSD4.value;
		objToSD4.defaultValue = strHDDestination;
		objToSD4.resetDefaultValue();
		remoteSubmit();		
	}

	function getFromStations_onChange5(){
		strActiveLeg = "5"
		hdnMode = "GETFSTOSTATION";
		hdnChar = "";
		hdnFrom = objFromSD5.value;
		objToSD5.defaultValue = strHDDestination;
		objToSD5.resetDefaultValue();
		remoteSubmit();		
	}

	function getFromStations_onChange6(){
		strActiveLeg = "6"
		hdnMode = "GETFSTOSTATION";
		hdnChar = "";
		hdnFrom = objFromSD6.value;
		objToSD6.defaultValue = strHDDestination;
		objToSD6.resetDefaultValue();
		remoteSubmit();		
	}

	function getToStations_onChange1(){
		strActiveLeg = "1"
		hdnChar = strSelectedCityTo1;
		hdnFrom = objFromSD1.value;
		if (objToSD1.value != ""){
			strSelectedCityTo1 = objToSD1.value;
			hdnChar = objToSD1.text ;//strCity.substring(0,1);
		}		
		hdnMode = "GETFSTOSTATION";
		strToMethod = "ONE"
		remoteSubmit();
	}

	function getToStations_onChange2(){
		strActiveLeg = "2"
		hdnChar = strSelectedCityTo2;
		hdnFrom = objFromSD2.value;
		if (objToSD2.value != ""){
			strSelectedCityTo2 = objToSD2.value;
			hdnChar = objToSD2.text ;//strCity.substring(0,1);
		}		
		hdnMode = "GETFSTOSTATION";
		strToMethod = "ONE"
		remoteSubmit();
	}

	function getToStations_onChange3(){
		strActiveLeg = "3"
		hdnFrom = objFromSD3.value;
		hdnChar = strSelectedCityTo3;
		if (objToSD3.value != ""){
			strSelectedCityTo3 = objToSD3.value;
			hdnChar = objToSD3.text ;//strCity.substring(0,1);
		}		
		hdnMode = "GETFSTOSTATION";
		strToMethod = "ONE"
		remoteSubmit();
	}

	function getToStations_onChange4(){
		strActiveLeg = "4"
		hdnFrom = objFromSD4.value;
		hdnChar = strSelectedCityTo4;
		if (objToSD4.value != ""){
			strSelectedCityTo4 = objToSD4.value;
			hdnChar = objToSD4.text ;//strCity.substring(0,1);
		}		
		hdnMode = "GETFSTOSTATION";
		strToMethod = "ONE"
		remoteSubmit();
	}

	function getToStations_onChange5(){
		strActiveLeg = "5"
		hdnFrom = objFromSD5.value;
		hdnChar = strSelectedCityTo5;
		if (objToSD5.value != ""){
			strSelectedCityTo5 = objToSD5.value;
			hdnChar = objToSD5.text ;//strCity.substring(0,1);
		}		
		hdnMode = "GETFSTOSTATION";
		strToMethod = "ONE"
		remoteSubmit();
	}

	function getToStations_onChange6(){
		strActiveLeg = "6"
		hdnFrom = objFromSD6.value;
		hdnChar = strSelectedCityTo6;
		if (objToSD6.value != ""){
			strSelectedCityTo6 = objToSD6.value;
			hdnChar = objToSD6.text ;//strCity.substring(0,1);
		}		
		hdnMode = "GETFSTOSTATION";
		strToMethod = "ONE"
		remoteSubmit();
	}

	function setFromDefaultText1(){	
		if (objFromSD1.defaultValue  == strHDOrigin && objFromSD1.value == ""){
			objFromSD1.defaultValue = "";
			objFromSD1.resetDefaultValue();
		}
		//CloseChildWindow();
		setDisplay("spnAjaxSearch", false);
		//resizeCity1("F", arrFSFromCity.length,arrFSFromCity);
		
	}

	function setFromDefaultText2(){	
		if (objFromSD2.defaultValue  == strHDOrigin && objFromSD2.value == ""){
			objFromSD2.defaultValue = "";
			objFromSD2.resetDefaultValue();
		}
		CloseChildWindow();
	}

	function setFromDefaultText3(){	
		if (objFromSD3.defaultValue  == strHDOrigin && objFromSD3.value == ""){
			objFromSD3.defaultValue = "";
			objFromSD3.resetDefaultValue();
		}
		CloseChildWindow();
	}

	function setFromDefaultText4(){	
		if (objFromSD4.defaultValue  == strHDOrigin && objFromSD4.value == ""){
			objFromSD4.defaultValue = "";
			objFromSD4.resetDefaultValue();
		}
		CloseChildWindow();
	}

	function setFromDefaultText5(){	
		if (objFromSD5.defaultValue  == strHDOrigin && objFromSD5.value == ""){
			objFromSD5.defaultValue = "";
			objFromSD5.resetDefaultValue();
		}
		CloseChildWindow();
	}

	function setFromDefaultText6(){	
		if (objFromSD6.defaultValue  == strHDOrigin && objFromSD6.value == ""){
			objFromSD6.defaultValue = "";
			objFromSD6.resetDefaultValue();
		}
		CloseChildWindow();
	}

	function setToDefaultText1(){
		if (objToSD1.defaultValue == strHDDestination && objToSD1.value == ""){
			objToSD1.defaultValue = "";
			objToSD1.resetDefaultValue();
		}
		CloseChildWindow();
		//resizeCity1("T", arrFSToCity.length,arrFSToCity);
	}

	function setToDefaultText2(){
		if (objToSD2.defaultValue == strHDDestination && objToSD2.value == ""){
			objToSD2.defaultValue = "";
			objToSD2.resetDefaultValue();
		}
		CloseChildWindow();
	}

	function setToDefaultText3(){
		if (objToSD3.defaultValue == strHDDestination && objToSD3.value == ""){
			objToSD3.defaultValue = "";
			objToSD3.resetDefaultValue();
		}
		CloseChildWindow();
	}
	
	function setToDefaultText4(){
		if (objToSD4.defaultValue == strHDDestination && objToSD4.value == ""){
			objToSD4.defaultValue = "";
			objToSD4.resetDefaultValue();
		}
		CloseChildWindow();
	}

	function setToDefaultText5(){
		if (objToSD5.defaultValue == strHDDestination && objToSD5.value == ""){
			objToSD5.defaultValue = "";
			objToSD5.resetDefaultValue();
		}
		CloseChildWindow();
	}
	
	function setToDefaultText6(){
		if (objToSD6.defaultValue == strHDDestination && objToSD6.value == ""){
			objToSD6.defaultValue = "";
			objToSD6.resetDefaultValue();
		}
		CloseChildWindow();
	}

	function FromStation_onBlur1(){	
		if ((hdnChar == "" || hdnChar ==  "###") && (objFromSD1.value == "")){		
			objFromSD1.defaultValue = strHDOrigin;
			objFromSD1.resetDefaultValue();
		}
	}

	function FromStation_onBlur2(){	
		if ((hdnChar == "" || hdnChar ==  "###") && (objFromSD2.value == "")){		
			objFromSD2.defaultValue = strHDOrigin;
			objFromSD2.resetDefaultValue();
		}
	}

	function FromStation_onBlur3(){	
		if ((hdnChar == "" || hdnChar ==  "###") && (objFromSD3.value == "")){		
			objFromSD3.defaultValue = strHDOrigin;
			objFromSD3.resetDefaultValue();
		}
	}

	function FromStation_onBlur4(){	
		if ((hdnChar == "" || hdnChar ==  "###") && (objFromSD4.value == "")){		
			objFromSD4.defaultValue = strHDOrigin;
			objFromSD4.resetDefaultValue();
		}
	}

	function FromStation_onBlur5(){	
		if ((hdnChar == "" || hdnChar ==  "###") && (objFromSD5.value == "")){		
			objFromSD5.defaultValue = strHDOrigin;
			objFromSD5.resetDefaultValue();
		}
	}

	function FromStation_onBlur6(){	
		if ((hdnChar == "" || hdnChar ==  "###") && (objFromSD6.value == "")){		
			objFromSD6.defaultValue = strHDOrigin;
			objFromSD6.resetDefaultValue();
		}
	}

	function ToStation_onBlur1(){
		if ((hdnChar == "" || hdnChar ==  "###") && (objToSD1.value == "")) {
			objToSD1.defaultValue = strHDDestination;
			objToSD1.resetDefaultValue();
		}
	}

	function ToStation_onBlur2(){
		if ((hdnChar == "" || hdnChar ==  "###") && (objToSD2.value == "")) {
			objToSD2.defaultValue = strHDDestination;
			objToSD2.resetDefaultValue();
		}
	}

	function ToStation_onBlur3(){
		if ((hdnChar == "" || hdnChar ==  "###") && (objToSD3.value == "")) {
			objToSD3.defaultValue = strHDDestination;
			objToSD3.resetDefaultValue();
		}
	}
	
	function ToStation_onBlur4(){
		if ((hdnChar == "" || hdnChar ==  "###") && (objToSD4.value == "")) {
			objToSD4.defaultValue = strHDDestination;
			objToSD4.resetDefaultValue();
		}
	}

	function ToStation_onBlur5(){
		if ((hdnChar == "" || hdnChar ==  "###") && (objToSD5.value == "")) {
			objToSD5.defaultValue = strHDDestination;
			objToSD5.resetDefaultValue();
		}
	}

	function ToStation_onBlur6(){
		if ((hdnChar == "" || hdnChar ==  "###") && (objToSD6.value == "")) {
			objToSD6.defaultValue = strHDDestination;
			objToSD6.resetDefaultValue();
		}
	}

	function getFromStations_onChange_ReturnCall1(xx,yy){
		
		strActiveLeg = "1"
		objFromSD1.value = xx;																	
		objFromSD1.refrehValue();
		strToMethod = "ONE"
		strSelectedCityFrom1 = objFromSD1.value;
		strSelectedCityTo1 = yy;
		hdnMode = "GETFSFROMSTATION";
		hdnChar = objFromSD1.value ;
		strFromMethod = "ONE"
		remoteSubmit();
	}

	function getFromStations_onChange_ReturnCall2(xx,yy){
		
		strActiveLeg = "2"
		objFromSD2.value = xx;																	
		objFromSD2.refrehValue();
		strToMethod = "ONE"
		strSelectedCityFrom2 = objFromSD2.value;
		strSelectedCityTo2 = yy;
		hdnMode = "GETFSFROMSTATION";
		hdnChar = objFromSD2.value ;
		strFromMethod = "ONE"
		remoteSubmit();
	}

	function getFromStations_onChange_ReturnCall3(xx,yy){
		
		strActiveLeg = "3"
		objFromSD3.value = xx;																	
		objFromSD3.refrehValue();
		strToMethod = "ONE"
		strSelectedCityFrom3 = objFromSD3.value;
		strSelectedCityTo3 = yy;
		hdnMode = "GETFSFROMSTATION";
		hdnChar = objFromSD3.value ;
		strFromMethod = "ONE"
		remoteSubmit();
	}

	function getFromStations_onChange_ReturnCall4(xx,yy){
		
		strActiveLeg = "4"
		objFromSD4.value = xx;																	
		objFromSD4.refrehValue();
		strToMethod = "ONE"
		strSelectedCityFrom4 = objFromSD4.value;
		strSelectedCityTo4 = yy;
		hdnMode = "GETFSFROMSTATION";
		hdnChar = objFromSD4.value ;
		strFromMethod = "ONE"
		remoteSubmit();
	}

	function getFromStations_onChange_ReturnCall5(xx,yy){
		
		strActiveLeg = "5"
		objFromSD5.value = xx;																	
		objFromSD5.refrehValue();
		strToMethod = "ONE"
		strSelectedCityFrom5 = objFromSD5.value;
		strSelectedCityTo5 = yy;
		hdnMode = "GETFSFROMSTATION";
		hdnChar = objFromSD5.value ;
		strFromMethod = "ONE"
		remoteSubmit();
	}

	function getFromStations_onChange_ReturnCall6(xx,yy){
		
		strActiveLeg = "6"
		objFromSD6.value = xx;																	
		objFromSD6.refrehValue();
		strToMethod = "ONE"
		strSelectedCityFrom6 = objFromSD6.value;
		strSelectedCityTo6 = yy;
		hdnMode = "GETFSFROMSTATION";
		hdnChar = objFromSD6.value ;
		strFromMethod = "ONE"
		remoteSubmit();
	}

	function onLoad(){
		
		var arrSearchInfo = strSrchData.split(" ^");
		var arrSrchLegData = strSrchData.split("|");
		resizeCity1("F", 0,arrFSFromCity);
		resizeCity1("T", 0,arrFSToCity);	
		if (strInvalidPurchasedDate != ""){
				var arrInvalidPurchasedDate = strInvalidPurchasedDate.split("^")
				arrInvalidPurchasedDate[0] = arrInvalidPurchasedDate[0].replace("#1",arrInvalidPurchasedDate[1]);
				arrInvalidPurchasedDate[0] = arrInvalidPurchasedDate[0].replace("#2",arrInvalidPurchasedDate[2]);			
				arrWarn[0] = arrInvalidPurchasedDate[0];
				showWarnMsg(arrWarn);
		}
		
		//buildFlightContrals(fltContrLegNo);	
		//fillFromCity("selFrom" + fltContrLegNo);
		buildYearDropDown("selYrDept" + fltContrLegNo , 1); //  'selYrDept" + fltContrLegNo + "'	
		initializeSrch(fltContrLegNo);
		displayFltSrchDay("0",fltContrLegNo);
		fltContrLegNo++;
		fillAdultChild();
		setField("selClass", arrParams[12]);	
		//setFocus("selFrom1");
		arrParams[30] = strHomeURL;
		
		Disable("btnRemove", true);
		setLastPageLoaded();
		setDisplay("spnPgHelp", false);
		
		if (strPgLang == "ar"){
			setStyleClass("btnAdd", "ButtonLarge buttonLeftLarge");
		}
		buildPageNavigation(1, false, false);
		switch(arrSearchInfo[0]){
			case "MUTLISEARCH" :
				setField("selAdults",arrSearchInfo[1]);
				selAdults_onChange();
				setField("selChild",arrSearchInfo[2]);
				setField("selInfants",arrSearchInfo[3]);
				setField("selClass",arrSearchInfo[5]);			
				
				for (var x=1 ; x<arrSrchLegData.length-1 ; x++ )
				{
					var arrSrchCurrLegData = arrSrchLegData[x].split(" ^");
					if (x==1){
						getFromStations_onChange_ReturnCall1(arrSrchCurrLegData[0],arrSrchCurrLegData[1]);
					}else if (x==2){
						if (objAjaxTimer != null){clearTimeout(objAjaxTimer)}
						strFrom2 = arrSrchCurrLegData[0];
						strTo2 = arrSrchCurrLegData[1];
						objAjaxTimer = setTimeout("getFromStations_onChange_ReturnCall2(strFrom2,strTo2)",650);
					}else if (x==3){
						strFrom3 = arrSrchCurrLegData[0];
						strTo3 = arrSrchCurrLegData[1];
						objAjaxTimer = setTimeout("getFromStations_onChange_ReturnCall3(strFrom3,strTo3)",1900);
					}else if (x==4){
						strFrom4 = arrSrchCurrLegData[0];
						strTo4 = arrSrchCurrLegData[1];
						objAjaxTimer = setTimeout("getFromStations_onChange_ReturnCall4(strFrom4,strTo4)",2500);
					}else if (x==5){
						strFrom5 = arrSrchCurrLegData[0];
						strTo5 = arrSrchCurrLegData[1];
						objAjaxTimer = setTimeout("getFromStations_onChange_ReturnCall5(strFrom5,strTo5)",3000);
					}else if (x==6){
						strFrom6 = arrSrchCurrLegData[0];
						strTo6 = arrSrchCurrLegData[1];
						objAjaxTimer = setTimeout("getFromStations_onChange_ReturnCall6(strFrom6,strTo6)",3500);
					}
					setField("selYrDept" + x,arrSrchCurrLegData[3]);
					selYrDeptOnChange(x);
					setField("selDtDept" + x,arrSrchCurrLegData[2]);
					setField("selAnyRetu" + x,arrSrchCurrLegData[4]);
					addRow();
				}
				
				if (arrSrchLegData.length>1)
				{
					removeRow();
				}
				break;
		}		
		sesTOutRedirectStart();
	}
	
	function resizeCity1(strType,intCount,arrArray){
		var intDefaultHeight = 16;
		if (browser.isIE){	
			intDefaultHeight = 20;
		}
		if (intCount < 7){
			if (strType == "F"){
				objFromSD1.height = intDefaultHeight *  intCount + "px" ;	
				if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] != ""){
					objFromSD1.listBoxClassName = strErrClass;
				}else if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] == ""){
					objFromSD1.height = "0px";
				}else if (intCount == 0){
					objFromSD1.height = "0px";
				}else{
					objFromSD1.listBoxClassName = "clsSelect";
				}
				objFromSD1.reSize();
			}else {
				objToSD1.height = intDefaultHeight *  intCount + "px" ;
				if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] != ""){
					objToSD1.listBoxClassName = strErrClass;
				}else if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] == ""){
					objToSD1.height = "0px";
				}else if (intCount == 0){
					objToSD1.height = "0px";
				}else{
					objToSD1.listBoxClassName = "clsSelect";
				}
				objToSD1.reSize();
			}
		}else {
			if (strType == "F"){
				objFromSD1.listBoxClassName = "clsSelect";
				objFromSD1.height = "100px" ;
				objFromSD1.reSize();
			}else {
				objToSD1.listBoxClassName = "clsSelect";
				objToSD1.height = "100px" ;
				objToSD1.reSize();
			}
		}		
	}
	
	function resizeCity2(strType,intCount,arrArray){
		var intDefaultHeight = 16;
		if (browser.isIE){	
			intDefaultHeight = 20;
		}
		if (intCount < 7){
			if (strType == "F"){
				objFromSD2.height = intDefaultHeight *  intCount + "px" ;	
				if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] != ""){
					objFromSD2.listBoxClassName = strErrClass;
				}else if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] == ""){
					objFromSD2.height = "0px";
				}else if (intCount == 0){
					objFromSD2.height = "0px";
				}else{
					objFromSD2.listBoxClassName = "clsSelect";
				}
				objFromSD2.reSize();
			}else {
				objToSD2.height = intDefaultHeight *  intCount + "px" ;
				if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] != ""){
					objToSD2.listBoxClassName = strErrClass;
				}else if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] == ""){
					objToSD2.height = "0px";
				}else if (intCount == 0){
					objToSD2.height = "0px";
				}else{
					objToSD2.listBoxClassName = "clsSelect";
				}
				objToSD2.reSize();
			}
		}else {
			if (strType == "F"){
				objFromSD2.listBoxClassName = "clsSelect";
				objFromSD2.height = "100px" ;
				objFromSD2.reSize();
			}else {
				objToSD2.listBoxClassName = "clsSelect";
				objToSD2.height = "100px" ;
				objToSD2.reSize();
			}
		}
	}
	
	function resizeCity3(strType,intCount,arrArray){
		var intDefaultHeight = 16;
		if (browser.isIE){	
			intDefaultHeight = 20;
		}
		if (intCount < 7){
			if (strType == "F"){
				objFromSD3.height = intDefaultHeight *  intCount + "px" ;	
				if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] != ""){
					objFromSD3.listBoxClassName = strErrClass;
				}else if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] == ""){
					objFromSD3.height = "0px";
				}else if (intCount == 0){
					objFromSD3.height = "0px";
				}else if (intCount == 0){
					objFromSD3.height = "0px";
				}else{
					objFromSD3.listBoxClassName = "clsSelect";
				}
				objFromSD3.reSize();
			}else {
				objToSD3.height = intDefaultHeight *  intCount + "px" ;
				if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] != ""){
					objToSD3.listBoxClassName = strErrClass;
				}else if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] == ""){
					objToSD3.height = "0px";
				}else if (intCount == 0){
					objToSD3.height = "0px";
				}else{
					objToSD3.listBoxClassName = "clsSelect";
				}
				objToSD3.reSize();
			}
		}else {
			if (strType == "F"){
				objFromSD3.listBoxClassName = "clsSelect";
				objFromSD3.height = "100px" ;
				objFromSD3.reSize();
			}else {
				objToSD3.listBoxClassName = "clsSelect";
				objToSD3.height = "100px" ;
				objToSD3.reSize();
			}
		}
	}
	
	function resizeCity4(strType,intCount,arrArray){
		var intDefaultHeight = 16;
		if (browser.isIE){	
			intDefaultHeight = 20;
		}
		if (intCount < 7){
			if (strType == "F"){
				objFromSD4.height = intDefaultHeight *  intCount + "px" ;	
				if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] != ""){
					objFromSD4.listBoxClassName = strErrClass;
				}else if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] == ""){
					objFromSD4.height = "0px";
				}else if (intCount == 0){
					objFromSD4.height = "0px";
				}else{
					objFromSD4.listBoxClassName = "clsSelect";
				}
				objFromSD4.reSize();
			}else {
				objToSD4.height = intDefaultHeight *  intCount + "px" ;
				if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] != ""){
					objToSD4.listBoxClassName = strErrClass;
				}else if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] == ""){
					objToSD4.height = "0px";
				}else if (intCount == 0){
					objToSD4.height = "0px";
				}else{
					objToSD4.listBoxClassName = "clsSelect";
				}
				objToSD4.reSize();
			}
		}else {
			if (strType == "F"){
				objFromSD4.listBoxClassName = "clsSelect";
				objFromSD4.height = "100px" ;
				objFromSD4.reSize();
			}else {
				objToSD4.listBoxClassName = "clsSelect";
				objToSD4.height = "100px" ;
				objToSD4.reSize();
			}
		}
	}
	
	function resizeCity5(strType,intCount,arrArray){
		var intDefaultHeight = 16;
		if (browser.isIE){	
			intDefaultHeight = 20;
		}
		if (intCount < 7){
			if (strType == "F"){
				objFromSD5.height = intDefaultHeight *  intCount + "px" ;	
				if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] != ""){
					objFromSD5.listBoxClassName = strErrClass;
				}else if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] == ""){
					objFromSD5.height = "0px";
				}else if (intCount == 0){
					objFromSD5.height = "0px";
				}else{
					objFromSD5.listBoxClassName = "clsSelect";
				}
				objFromSD5.reSize();
			}else {
				objToSD5.height = intDefaultHeight *  intCount + "px" ;
				if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] != ""){
					objToSD5.listBoxClassName = strErrClass;
				}else if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] == ""){
					objToSD5.height = "0px";
				}else if (intCount == 0){
					objToSD5.height = "0px";
				}else{
					objToSD5.listBoxClassName = "clsSelect";
				}
				objToSD5.reSize();
			}
		}else {
			if (strType == "F"){
				objFromSD5.listBoxClassName = "clsSelect";
				objFromSD5.height = "100px" ;
				objFromSD5.reSize();
			}else {
				objToSD5.listBoxClassName = "clsSelect";
				objToSD5.height = "100px" ;
				objToSD5.reSize();
			}
		}
	}
	
	function resizeCity6(strType,intCount,arrArray){
		var intDefaultHeight = 16;
		if (browser.isIE){	
			intDefaultHeight = 20;
		}
		if (intCount < 7){
			if (strType == "F"){
				objFromSD6.height = intDefaultHeight *  intCount + "px" ;	
				if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] != ""){
					objFromSD6.listBoxClassName = strErrClass;
				}else if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] == ""){
					objFromSD6.height = "0px";
				}else if (intCount == 0){
					objFromSD6.height = "0px";
				}else{
					objFromSD6.listBoxClassName = "clsSelect";
				}
				objFromSD6.reSize();
			}else {
				objToSD6.height = intDefaultHeight *  intCount + "px" ;
				if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] != ""){
					objToSD6.listBoxClassName = strErrClass;
				}else if (intCount == 1 && arrArray[0][0] == strNoRecordIATACode && arrArray[0][1] == ""){
					objToSD6.height = "0px";
				}else if (intCount == 0){
					objToSD6.height = "0px";
				}else{
					objToSD6.listBoxClassName = "clsSelect";
				}
				objToSD6.reSize();
			}
		}else {
			if (strType == "F"){
				objFromSD6.listBoxClassName = "clsSelect";
				objFromSD6.height = "100px" ;
				objFromSD6.reSize();
			}else {
				objToSD6.listBoxClassName = "clsSelect";
				objToSD6.height = "100px" ;
				objToSD6.reSize();
			}
		}
	}

	function resizeControls(){
		var objSpan = getFieldByID("spnAjaxSearch");
		var c = "";

		if (strActiveLeg == 1){
			c = getAnchorPosition('selDtDept1');

			if (strAjaxSpan == "F"){
				if (document.body.clientWidth <1000){
					if (strPGLanguage == "ar"){
						objSpan.style.left = c.x - 20 + "px"; 
						if (browser.isIE){			
							objSpan.style.left = c.x - 33 + "px"; 
						}
					}else {
						objSpan.style.left = c.x - 585 + "px"; 
						if (browser.isIE){			
							objSpan.style.left = c.x - 563 + "px"; 
						}
					}
				}else {
					if (strPGLanguage == "ar"){
						objSpan.style.left = c.x - 20 + "px";	
						if (browser.isIE){	
							objSpan.style.left = c.x - 33 + "px"; 
						}
					}else {
						objSpan.style.left = c.x - 585 + "px";	
						if (browser.isIE){	
							objSpan.style.left = c.x - 562 + "px"; 
						}
					}
				}
			}else {
				if (document.body.clientWidth <1000){
					if (strPGLanguage == "ar"){
						objSpan.style.left = c.x - 270 + "px";
						if (browser.isIE){			
							objSpan.style.left = c.x - 277 + "px";
						}
					}else {
						objSpan.style.left = c.x - 335 + "px";
						if (browser.isIE){			
							objSpan.style.left = c.x - 323 + "px";
						}
					}
				}else {
					if (strPGLanguage == "ar"){
						objSpan.style.left = c.x - 270 + "px";
						if (browser.isIE){			
							objSpan.style.left = c.x - 277 + "px";	
						}
					}else {
						objSpan.style.left = c.x - 335 + "px";
						if (browser.isIE){			
							objSpan.style.left = c.x - 323 + "px";	
						}
					}
				} 
			}
		}
	}

	onLoad()