// JavaScript Document
function updateTravellingAs() {
	
	numChildren = document.getElementById("strChildren").value + document.getElementById("strChildrenEducation").value;
	//strAdults, strAdults_61_65, strAdults_66_69 strAdults_70_74

	//numAdults = document.getElementById("strAdults").value + document.getElementById("strAdults_65_69").value;
	numAdults = document.getElementById("strAdults").value;
	if ( document.getElementById("strAdults_65_69") ) {
		numAdults = numAdults + document.getElementById("strAdults_65_69").value;
	}
	
	if (numChildren	== 0) {
		if (numAdults == 2) {
			//document.getElementById("frmCouple").checked = true;
			document.getElementById("frmIndividual").checked = true;
		} else {
			document.getElementById("frmIndividual").checked = true;
		}		
	} else {
		document.getElementById("frmFamily").checked = true;
	}
	//checkTravellers()
}

function checkTravellers() {
	// check the number of travellers depending for 'travelling as' 
	numChildren = document.getElementById("strChildren").value + document.getElementById("strChildrenEducation").value;
	//strAdults, strAdults_61_65, strAdults_66_69 strAdults_70_74
	
	//numAdults = document.getElementById("strAdults").value + document.getElementById("strAdults_65_69").value;	
	numAdults = document.getElementById("strAdults").value;
	if ( document.getElementById("strAdults_65_69") ) {
		numAdults = numAdults + document.getElementById("strAdults_65_69").value;
	}
	
	individuals = document.getElementById("frmIndividual")
	if (individuals.checked == true ) {		
		if (numChildren != 0) {
			alertAndFocus(individuals, "If you are taking children please select Family")	
			return false;
		}
		if (numAdults == 2) {
			//alertAndFocus(individuals, "If there are only two people travelling please select Couple.")
			//return false;
		}
	}	
	couple = document.getElementById("frmCouple")
	if ( couple.checked == true) {
		if ( (numChildren ==0 )&&(numAdults == 2) ){
		} else {
			alertAndFocus(couple, "To qualify as a couple only two travellers with no children is acceptable")	
			return false;
		}
	}		
	family = document.getElementById("frmFamily")
	if ( family.checked == true ) {
		if ( (numChildren == 0 )||(numAdults == 0) ) {
			alertAndFocus(family, "To qualify as a family a minimum of one adult and one child must be selected.")	
			return false;
		} else {
			if (numAdults > 2) {
				alertAndFocus(family, "Two adults is the maximum number of adults for a family.")
				return false;
			}
		}
		
	}
	return true;
}
function valStep1(){
	if (document.getElementById("strEligibilty") ) {
		if ( isEmpty(document.getElementById("strEligibilty"), "", "Please enter the name of your employer.")) {
			return false;
		}
	}
	return true;
}