// JavaScript Document

<!-- Hide from older browsers


function valButton(btn) {
    var cnt = -1;
    for (var i=btn.length-1; i > -1; i--) {
        if (btn[i].checked) {cnt = i; i = -1;}
    }
    if (cnt > -1) return btn[cnt].value;
    else return null;
}
//Check the enquiry form is filled in correctly
function CheckForm (surveySignup) { 

	//Initialise variables
	var errorMsg = "";


	//Question 1 - how often visit the site

	//Question - like most about site
	if (document.surveySignup.firstName.value == "") { 
 		errorMsg += "\n\tYour First Name.  \t\t";
	}
	
	//Question - like least about site
	if (document.surveySignup.lastName.value == "") { 
 		errorMsg += "\n\tYour Last Name. \t\t";
	}	
	
	//Check for a location
	if (document.surveySignup.organization.value == ""){
		errorMsg += "\n\tYour Organization. \t\t ";
	}
	
	//Check for a location
	if (document.surveySignup.title.value == ""){
		errorMsg += "\n\tYour Title. \t\t ";
	}
	
	//Check for a location
	if (document.surveySignup.shippingAddress.value == ""){
		errorMsg += "\n\tYour Shipping Address. \t\t ";
	}
	
	//Check for a location
	if (document.surveySignup.city.value == ""){
		errorMsg += "\n\tYour City. \t\t ";
	}
	
		//Check for a location
	if (document.surveySignup.province.value == ""){
		errorMsg += "\n\tYour Province/State. \t\t ";
	}
	
		//Check for a location
	if (document.surveySignup.postal.value == ""){
		errorMsg += "\n\tYour Postal/Zip Code. \t\t ";
	}
	
		//Check for a location
	if (document.surveySignup.email.value == ""){
		errorMsg += "\n\tYour Email Address. \t\t ";
	}
	
		//Check for a location
	if (document.surveySignup.quantity.value == ""){
		errorMsg += "\n\tThe quantity of Survey's you would like to receive. \t\t ";
	}



	//Question 5 - how satisfied?
	if(valButton(document.surveySignup.payment) > -1){
		errorMsg +="\n\tPlease select a method of payment.  \t\t";
	}

			
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "\n\n";
		msg += "The National Wellness Suvery order form has not been sent.\n";
		msg += "Please answer the question(s) and re-submit the order form.\n";
		msg += "\n\n";
		msg += "The following feild(s) need to be filled in: \n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}
// -->