	var msg = new Array();
	msg[0]="%n may not be empty.";
	msg[1]="%n1 and %n2 should not match.";
	msg[2]="%n1 and %n2 should match.";
	msg[10]="%n exceeds max length of %s characters.";
	msg[11]="%n may not be shorter than %s characters." ;
	msg[12]="%n may not contain spaces in it.";
	msg[13]="%n may only contain alphanumeric characters.";
	msg[14]="%n may only contain alphabetical characters. No special symbols are allowed.";
	msg[20]="%n may be numeric only.";
	msg[21]="%n must be a positive integer.";
	msg[50]="There is no year 0 in the Julian System.";
	msg[51]="The dates 5 through 14 October 1582 do not exist in the Gregorian Calendar system.";
	msg[52]="%n is an invalid date.";
	msg[53]="Invalid Day-of-Month.";
	msg[54]="Invalid Month";
	msg[55]="Invalid Year";
	msg[57]="%i is in the future.";
	msg[60]="%n has not been checked.";
	msg[70]="Invalid Credit Card Expiry date.";
	msg[71]="The credit card number does not match the type of credit card used.";
	msg[72]="The credit card number is invalid.";
	msg[73]="The CVV number is invalid.";
	msg[80]="Invalid Email address.";
	msg[81]="This Email address is missing a hostname.";
	msg[86]="Invalid ID number or Date of Birth.";
	msg[87]="Invalid ID number or Gender.";
	msg[88]="Invalid ID number.";

function goValidateInput(frm, buttonToDisable) {

//---get tempLocaleCookie
	var localeSetting=getCookie('templocaleSetting');
	if (localeSetting == null) {
		setCookie ('templocaleSetting','en_za', now,'','','','1');
		localeSetting=getCookie('templocaleSetting');
	} 
			
	var userSetting=expandCookieValues (localeSetting,'_');
	if (!(userSetting[0])) {
		userSetting[0]='en'
		userSetting[1]='za'
		
	}
	
	var group_name = 		document.postForm.group_name.value;
	var company = 			document.postForm.company.value;
	var requestors_name = 	document.postForm.requestors_name.value;
	var requestors_email_address=document.postForm.requestors_email_address.value;
	var telephone_number = 	document.postForm.telephone_number.value;
	var fax_number =		document.postForm.fax_number.value;
	var mobile_number =		document.postForm.mobile_number.value;
	var group_size =		document.postForm.group_size.options[document.postForm.group_size.selectedIndex].value;
	
	var group_type =		new String(getSelectedRadioValue(document.postForm.group_type));
	var adults =			document.postForm.adults.value;
	var children =			document.postForm.children.value;
	var infants =			document.postForm.infants.value;
	var class_travel =		document.postForm.class_travel.options[document.postForm.class_travel.selectedIndex].value;
	
	if (!checkEmptyObj(document.postForm.group_name, 'The Group Name is Mandatory.')) return false;
	if (!isAlphaNumeric(document.postForm.group_name.value)) {alert ('The Group Name has invalid Characters.'); return false;}	
	if (!checkEmptyObj(document.postForm.company, 'The Company is Mandatory.')) return false;
	if (!isAlphaNumeric(document.postForm.company.value)) {alert ('The Company has invalid Characters.'); return false;}
	if (!checkEmptyObj(document.postForm.requestors_name, 'The Requestor\'s Name is Mandatory.')) return false;
	if (!isAlpha(document.postForm.requestors_name.value)) {alert ('The Requestor\'s Name has invalid Characters.'); return false;}	
	if (!checkEmptyObj(document.postForm.requestors_email_address, 'The Requestor\'s E-Mail Address is Mandatory.')) return false;	
	if (!checkEmailObj(document.postForm.requestors_email_address, 'The Email Address is Invalid.')) return false;
	if (!checkTelephone(document.postForm.telephone_number)) return false;
	if ((group_type==null)||(group_type=='')) {
		alert ('Group type has not been checked.');	
		return false;
	}
	if ((adults=='')&&(children='')&&(infants='')) {
		alert ('At least one of the Passengers types have to be completed');
		return false;
	}

	var depYear1=document.postForm.depYear1.options[document.postForm.depYear1.selectedIndex].value;
	var depMonth1=document.postForm.depMonth1.options[document.postForm.depMonth1.selectedIndex].value;
	var depDay1=document.postForm.depDay1.options[document.postForm.depDay1.selectedIndex].value;
	
	var depYear2=document.postForm.depYear2.options[document.postForm.depYear2.selectedIndex].value;
	var depMonth2=document.postForm.depMonth2.options[document.postForm.depMonth2.selectedIndex].value;
	var depDay2=document.postForm.depDay2.options[document.postForm.depDay2.selectedIndex].value;
	
	var userDep1=document.postForm.depCity1.options[document.postForm.depCity1.selectedIndex].value;
	var userDep2=document.postForm.depCity2.options[document.postForm.depCity2.selectedIndex].value;
	var userDest1=document.postForm.destCity1.options[document.postForm.destCity1.selectedIndex].value;
	var userDest2=document.postForm.destCity2.options[document.postForm.destCity2.selectedIndex].value;

	if ((userDep1==0)||(userDest1==0)) {
		alert ('Please select a Departure for Destination for Flight One');
		return false;
	}
	
	if (userDep1==userDest1) {
		alert ('Sorry, both the Departure and Destination points for Flight One are the same');
		return false;
		}
	
	if ((userDep2==0)||(userDest2==0)) {
		alert ('Please select a Departure for Destination for Flight Two');
		return false;
	}
		
	if (userDep2==userDest2) {
		alert ('Sorry, both the Departure and Destination points for Flight Two are the same');
		return false;
	}
		
	if (document.postForm.enableFlights3.checked) {
		var depYear3=document.postForm.depYear3.options[document.postForm.depYear3.selectedIndex].value;
		var depMonth3=document.postForm.depMonth3.options[document.postForm.depMonth3.selectedIndex].value;
		var depDay3=document.postForm.depDay3.options[document.postForm.depDay3.selectedIndex].value;
		var userDep3=document.postForm.depCity3.options[document.postForm.depCity3.selectedIndex].value;
		var userDest3=document.postForm.destCity3.options[document.postForm.destCity3.selectedIndex].value;
		
		if ((userDep3==0)||(userDest3==0)) {
			alert ('Please select a Departure for Destination for Flight Three');
			return false;
		}
		
		if (userDep3==userDest3) {
			alert ('Sorry, both the Departure and Destination points for Flight Three are the same');
			return false;
		}
	} 
	
	if (document.postForm.enableFlights4.checked) {
		var depYear4=document.postForm.depYear4.options[document.postForm.depYear4.selectedIndex].value;
		var depMonth4=document.postForm.depMonth4.options[document.postForm.depMonth4.selectedIndex].value;
		var depDay4=document.postForm.depDay4.options[document.postForm.depDay4.selectedIndex].value;
		var userDep4=document.postForm.depCity4.options[document.postForm.depCity4.selectedIndex].value;
		var userDest4=document.postForm.destCity4.options[document.postForm.destCity4.selectedIndex].value;
		
		if ((userDep4==0)||(userDest4==0)) {
			alert ('Please select a Departure for Destination for Flight Four');
			return false
		}
		
		if (userDep4==userDest4) {
			alert ('Sorry, both the Departure and Destination points for Flight Four are the same');
			return false;
		}
	}
	
	if (document.postForm.enableFlights5.checked) {
		var depYear5=document.postForm.depYear5.options[document.postForm.depYear5.selectedIndex].value;
		var depMonth5=document.postForm.depMonth5.options[document.postForm.depMonth5.selectedIndex].value;
		var depDay5=document.postForm.depDay5.options[document.postForm.depDay5.selectedIndex].value;
		var userDep5=document.postForm.depCity5.options[document.postForm.depCity5.selectedIndex].value;
		var userDest5=document.postForm.destCity5.options[document.postForm.destCity5.selectedIndex].value;
		
		if ((userDep5==0)||(userDest5==0)) {
			alert ('Please select a Departure for Destination for Flight Five');
			return false;
		}
		
		if (userDep5==userDest5) {
			alert ('Sorry, both the Departure and Destination points for Flight Five are the same');
			return false;
		}
	}
	
	if (document.postForm.enableFlights6.checked) {
		var depYear6=document.postForm.depYear6.options[document.postForm.depYear6.selectedIndex].value;
		var depMonth6=document.postForm.depMonth6.options[document.postForm.depMonth6.selectedIndex].value;
		var depDay6=document.postForm.depDay6.options[document.postForm.depDay6.selectedIndex].value;
		var userDep6=document.postForm.depCity6.options[document.postForm.depCity6.selectedIndex].value;
		var userDest6=document.postForm.destCity6.options[document.postForm.destCity6.selectedIndex].value;
		
		if ((userDep6==0)||(userDest6==0)) {
			alert ('Please select a Departure for Destination for Flight Six');
			return false;
		}
		
		if (userDep6==userDest6) {
			alert ('Sorry, both the Departure and Destination points for Flight Six are the same');
			return false;
		}
	}
	
	document.postForm.CURRENT_DATE.disabled=true;
	switch (userSetting[1]) 
	{
		case 'us' :
			document.postForm.action="mailto:" + requestors_email_address + "?cc=groupsusa@flysaa.com&Subject=Group Booking for " + requestors_name;
			break;
		case 'fr' :
			document.postForm.action="mailto:" + requestors_email_address + "?cc=saa.france@aviareps.com&Subject=Group Booking for " + requestors_name;
			break;	
		default :
			document.postForm.action="mailto:" + requestors_email_address + "?cc=GroupSales@flysaa.com&Subject=Group Booking for " + requestors_name;
			break;
	}			
	document.postForm.submit();
	window.location=('/book_a_trip/za_resgroupsearch_complete.html');
} 