function manageDiv()
	{
		if (!reqValAirport()) return;
		if (!reqValArrDep()) return;

		if (document.myForm.radioTrip[0].checked || document.myForm.radioTrip[1].checked)
		{
			document.all.divCorp.style.display ='none';
			document.all.divArr.style.display ='inline';
			document.all.divWeather.style.display ='none';
			document.all.img_left.height = 302;
			document.all.img_right.height = 302;
			if (document.myForm.radioTrip[1].checked)
				document.all.divArr1.style.display ='inline';
			else
				document.all.divArr1.style.display ='none';	
		}
		else
		{
			document.all.divCorp.style.display ='inline';
			document.all.divArr.style.display ='none';
			document.all.divWeather.style.display ='inline';
			document.all.img_left.height = 111;
			document.all.img_right.height = 111;
		}
		manageArrDepImg();
	}
			
	function manageArrDepImg()
	{
		if ((document.myForm.sel2.selectedIndex == 1 && document.myForm.radioTrip[1].checked)
			|| (document.myForm.sel2.selectedIndex == 2 && document.myForm.radioTrip[0].checked)) 
		// to Airport Round Trip or from Airport One Way
		{			
			document.all.imgDate1.src = "images/departing_flight_date.gif";
			document.all.imgTime1.src = "images/departing_flight.gif";
			document.all.imgLocation1.src = "images/pickup_location.gif";
			document.all.imgDate2.src = "images/arrival_flight_date.gif";
			document.all.imgTime2.src = "images/arrival_fligh_time.gif";
			document.all.imgLocation2.src = "images/dropofflocation.gif";
			
		}
		if ((document.myForm.sel2.selectedIndex == 2 && document.myForm.radioTrip[1].checked)
			|| (document.myForm.sel2.selectedIndex == 1 && document.myForm.radioTrip[0].checked)) 
		//to Airport One Way or from Airport Round Trip
		{
			document.all.imgDate1.src  = "images/arrival_flight_date.gif";
			document.all.imgTime1.src = "images/arrival_fligh_time.gif";
			document.all.imgLocation1.src = "images/dropofflocation.gif";
			document.all.imgDate2.src = "images/departing_flight_date.gif";
			document.all.imgTime2.src = "images/departing_flight.gif";
			document.all.imgLocation2.src = "images/pickup_location.gif";
		}
	}
	
	function PickupCity()
	{
		document.myForm.PICKUPCITY2.selectedIndex = document.myForm.PICKUPCITY.selectedIndex;
	}
	
	function Passengers()
	{
		document.myForm.PASSENGERS2.selectedIndex = document.myForm.PASSENGERS.selectedIndex;
	}
	
	function FlightTypeChange()
	{
		document.myForm.FLIGHTTYPE2.selectedIndex = document.myForm.FLIGHTTYPE.selectedIndex;
	}
	
	function FlightType()
	{
		var l = document.myForm.FLIGHTTYPE.options.length;
		var optn, optn2;
		if (document.myForm.sel1.selectedIndex == 2 && l == 2)
		{
			document.myForm.FLIGHTTYPE.remove(1);
			document.myForm.FLIGHTTYPE2.remove(1);
			document.myForm.FLIGHTTYPE.selectedIndex = 0;
			document.myForm.FLIGHTTYPE2.selectedIndex = 0;
		}
		if (document.myForm.sel1.selectedIndex == 1 && l < 2)
		{
			optn = document.createElement("OPTION");
			optn.text = "International";
			optn.value = "I";
			optn2 = document.createElement("OPTION");
			optn2.text = "International";
			optn2.value = "I";
			document.myForm.FLIGHTTYPE.options.add(optn);			
			document.myForm.FLIGHTTYPE2.options.add(optn2);			
		}
	}
	
	function reqValAirport()
	{
		if (document.myForm.sel1.selectedIndex == 0)
		{
			document.myForm.sel1.focus();
			alert("Please select Airport before continuing");
			myForm.radioTrip[0].checked = false;
			myForm.radioTrip[1].checked = false;
			return false;
		}
		return true;
	}
	function reqValAirport2()
	{
		if (document.myForm.sel1.selectedIndex == 0)
		{
			document.myForm.sel1.focus();
			alert("Please select Airport");
			return false;
		}
		return true;
	}
	
	function reqValArrDep()
	{	
		if (document.myForm.sel2.selectedIndex == 0)
			{
				document.myForm.sel2.focus();
				alert("Please select Departures/Arrivals before continuing");
				myForm.radioTrip[0].checked = false;
				myForm.radioTrip[1].checked = false;
				return false;
			}
			return true;
	}	
	function reqValArrDep2()
	{	
		if (document.myForm.sel2.selectedIndex == 0)
			{
				document.myForm.sel2.focus();
				alert("Please select Departures/Arrivals");
				return false;
			}
			return true;
	}	

	function reqCity()
	{	
		if (document.myForm.PICKUPCITY.selectedIndex == 0 || document.myForm.PICKUPCITY2.selectedIndex == 0)
			{
				if (document.myForm.radioTrip[0].checked && document.myForm.PICKUPCITY2.selectedIndex == 0)
				{
					alert("Please select Pickup Location");
					return false;					
				}
				else if	(document.myForm.radioTrip[1].checked)
				{			
					alert("Please select both Pickup Locations");
					return false;					
				}

			}
			return true;
	}	
	
	//Validate Form
	function checkForm()
	{
	return (reqValAirport2() &&
			reqValArrDep2() &&
			reqCity()
	);	
}
