// JavaScript Document
function getOut()
{
	var theAirport = "";
	var theday = "";
	var themonth = "";
	var theyear = "";
	var theLocation = "";
	var theResort = "";
	var bValid = true;
	
 if(document.getElementById("destination").value=='')
	{
	alert("Please select Destination");
	return false;
	}
	bValid = validatePax(document.CriteriaForm);
	
	if(bValid)
	{
		theday = document.CriteriaForm.Day[document.CriteriaForm.Day.selectedIndex].value;
		themonth = document.CriteriaForm.Month[document.CriteriaForm.Month.selectedIndex].value;
		//alert("themonth "+themonth);

		var tempArr = themonth.split("-");

		themonth = tempArr[0];
		theyear = tempArr[1];

		document.CriteriaForm.OutDepDate.value = theday+"/"+themonth+"/"+theyear;
	
		locationResort = 

document.CriteriaForm.LocationResort[document.CriteriaForm.LocationResort.selectedIndex].value;
	
		var tempArr = locationResort.split("#");
		theAirport = tempArr[0];
		if(tempArr.length > 1)
		{
			theLocation = tempArr[1];
		}
		if(tempArr.length > 2)
		{
			theResort = tempArr[2];
		}	
		
	
		document.CriteriaForm.OutArrAir.value = theAirport;
		document.CriteriaForm.RetDepAir.value = theAirport;
	
		document.CriteriaForm.AccomLocation.value = theLocation;
		document.CriteriaForm.AccomResort.value = theResort;		
	
		document.CriteriaForm.OutDepAir.value = 

document.CriteriaForm.Dep[document.CriteriaForm.Dep.selectedIndex].value;
		document.CriteriaForm.RetArrAir.value = 

document.CriteriaForm.Dep[document.CriteriaForm.Dep.selectedIndex].value;
	
		document.getElementById("AdultPax").value = document.getElementById("NumPaxAD").value
		document.getElementById("ChildPax").value = document.getElementById("NumPaxCH").value
		document.getElementById("InfantPax").value = document.getElementById("NumPaxIN").value

		document.CriteriaForm.submit();
	}
}

function changePax(alPax)
{
	var style = "";
				
	for (var i=1; i<10; i++)
	{
		if (i <= alPax) {
			style = "inline";
		} else {
			style = "none";
		}

		if(document.getElementById("pax_span" + i))
		{
			document.getElementById("pax_span" + i).style.display = style;
		}
	}
}
