
function checkform() {
	msg = "";

	// contact details
	if (!get_radio_value("know_sa")) msg = msg + "- How well do you know South Africa?\n";
	if (document.frm.fname.value == "")  msg = msg + "- Your first name\n";
	if (document.frm.lname.value == "")  msg = msg + "- Your last name\n";
	if (!emailcheck(document.frm.email.value) || !emailcheck(document.frm.email2.value)) msg = msg + "- A valid email address\n";
	if (document.frm.email.value != document.frm.email2.value) msg = msg + "- The email addresses entered do not match\n";
	if (document.frm.tel.value == "")  msg = msg + "- Your telephone number\n";

	if (!get_radio_value("enq_or_booking")) msg = msg + "- Booking or only an enquiry?\n";

	// this check is where the page gets redirected to avoid going via the payment gateway
	if (get_radio_value("enq_or_booking") == "Enquiry Only - no payment details submitted") document.frm.action = "tour-bookings-Enquiry.php";
	if (get_radio_value("enq_or_booking") == "Book & Pay Now" && (document.frm.Ecom_Payment_Card_Name.value == "" || document.frm.Ecom_Payment_Card_Type.value == "0" || document.frm.Ecom_Payment_Card_Number.value == "" || isNaN(document.frm.Ecom_Payment_Card_Number.value) || document.frm.Ecom_Payment_Card_ExpDate_Month.value == "" || isNaN(document.frm.Ecom_Payment_Card_ExpDate_Month.value) || document.frm.Ecom_Payment_Card_ExpDate_Year.value == "" || isNaN(document.frm.Ecom_Payment_Card_ExpDate_Year.value) || document.frm.Ecom_Payment_Card_Verification.value == "" || isNaN(document.frm.Ecom_Payment_Card_Verification.value))) msg = msg + "- Credit card details\n";
	// display the form check

document.frm.Ecom_BillTo_Postal_Name_First.value = document.frm.fname.value;
document.frm.Ecom_BillTo_Postal_Name_Last.value = document.frm.lname.value;
document.frm.Ecom_BillTo_Online_Email.value = document.frm.email.value;
document.frm.Ecom_BillTo_Telecom_Phone_Number.value = document.frm.tel.value;

	frm.Lite_Order_LineItems_Amount_1.value= frm.Lite_Order_Amount.value
	frm.Lite_Order_LineItems_Product_1.value = frm.Ecom_ConsumerOrderID.value;

	if (msg!="")
		{
		alert ("Please complete the following:\r\n\r\n"+msg);
		return false;
		}
}


function checkform_aff1() {
	msg = "";

	// contact details
	if (document.frm.name.value == "")  msg = msg + "- Your first name\n";
	if (document.frm.lname.value == "")  msg = msg + "- Your last name\n";
	if (!emailcheck(document.frm.email.value) || !emailcheck(document.frm.email2.value)) msg = msg + "- A valid email address\n";
	if (document.frm.email.value != document.frm.email2.value) msg = msg + "- The email addresses entered do not match\n";
	if (document.frm.tel.value == "")  msg = msg + "- Your telephone number\n";
	if (!get_radio_value("know_sa")) msg = msg + "- How well do you know South Africa?\n";

//	if (get_radio_value("enq_or_booking") == "Book & Pay Now" && (document.frm.Ecom_Payment_Card_Name.value == "" || document.frm.Ecom_Payment_Card_Type.value == "0" || document.frm.Ecom_Payment_Card_Number.value == "" || isNaN(document.frm.Ecom_Payment_Card_Number.value) || document.frm.Ecom_Payment_Card_ExpDate_Month.value == "" || isNaN(document.frm.Ecom_Payment_Card_ExpDate_Month.value) || document.frm.Ecom_Payment_Card_ExpDate_Year.value == "" || isNaN(document.frm.Ecom_Payment_Card_ExpDate_Year.value) || document.frm.Ecom_Payment_Card_Verification.value == "" || isNaN(document.frm.Ecom_Payment_Card_Verification.value))) msg = msg + "- Credit card details\n";
	// display the form check

//document.frm.Ecom_BillTo_Postal_Name_First.value = document.frm.fname.value;
//document.frm.Ecom_BillTo_Postal_Name_Last.value = document.frm.lname.value;
//document.frm.Ecom_BillTo_Online_Email.value = document.frm.email.value;
//document.frm.Ecom_BillTo_Telecom_Phone_Number.value = document.frm.tel.value;

//	frm.Lite_Order_LineItems_Amount_1.value= frm.Lite_Order_Amount.value
//	frm.Lite_Order_LineItems_Product_1.value = frm.Ecom_ConsumerOrderID.value;

	if (msg!="")
		{
		alert ("Please complete the following:\r\n\r\n"+msg);
		return false;
		}
}
function checkform_aff2() {
	msg = "";

	if (document.frm.Ecom_Payment_Card_Name.value == "" || document.frm.Ecom_Payment_Card_Type.value == "0" || document.frm.Ecom_Payment_Card_Number.value == "" || isNaN(document.frm.Ecom_Payment_Card_Number.value) || document.frm.Ecom_Payment_Card_ExpDate_Month.value == "" || isNaN(document.frm.Ecom_Payment_Card_ExpDate_Month.value) || document.frm.Ecom_Payment_Card_ExpDate_Year.value == "" || isNaN(document.frm.Ecom_Payment_Card_ExpDate_Year.value) || document.frm.Ecom_Payment_Card_Verification.value == "" || isNaN(document.frm.Ecom_Payment_Card_Verification.value)) msg = msg + "- Credit card details\n";

	// display the form check

//	frm.Lite_Order_LineItems_Amount_1.value= frm.Lite_Order_Amount.value
//	frm.Lite_Order_LineItems_Product_1.value = frm.Ecom_ConsumerOrderID.value;

	if (msg!="")
		{
		alert ("Please complete the following:\r\n\r\n"+msg);
		return false;
		}
}

function checkcontactus() {
	//alert("this me message");
	msg = "";

	// contact details
	if (document.contactform.name.value == "")  msg = msg + "- your NAME\n";
	if (document.contactform.mail.value == "")  msg = msg + "- your EMAIL\n";
	if (document.contactform.message.value == "")  msg = msg + "- the ENQUIRY\n";
	if (!emailcheck(document.contactform.mail.value)) msg = msg + "- A VALID email address\n";

	// display the form check	
	if (msg!="")
		{
		alert ("Oops, you forgot to fill in these details: \r\n\r\n"+msg);
		return false;
		}
}