// 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 (feedBack) { 

	//Initialise variables
	var errorMsg = "";


	//Question 1 - how often visit the site
	if(valButton(document.feedBack.question1) > -1){
		errorMsg +="\n\tHow often do you visit our site?\t\t";
	}

	//Question 2 - what capacity
	if(valButton(document.feedBack.question2) > -1){
		errorMsg +="\n\tIn which capacity did you visit us today? \t\t";
	}

	//Question 3 - what type of info?
	if(valButton(document.feedBack.question3) > -1){
		errorMsg +="\n\tWhat type of information were you looking for?  \t\t";
	}

	//Question 4 - find what you were looking for?
	if(valButton(document.feedBack.question4) > -1){
		errorMsg +="\n\tDid you find what you were looking for on our website?   \t\t";
	}
                  
	//Question - like most about site
	if (document.feedBack.question1.value == "") { 
 		errorMsg += "\n\tWhat did you like most about our website?  \t\t";
	}


	//Question - like most about site
	if (document.feedBack.likeMost.value == "") { 
 		errorMsg += "\n\tWhat did you like most about our website?  \t\t";
	}
	
	//Question - like least about site
	if (document.feedBack.likeLeast.value == "") { 
 		errorMsg += "\n\tWhat did you like least about our website? \t\t";
	}	
	
	//Check for a location
	if (document.feedBack.location.value == ""){
		errorMsg += "\n\tIn which city and country are you located? \t\t ";
	}


	//Question 5 - how satisfied?
	if(valButton(document.feedBack.question5) > -1){
		errorMsg +="\n\tOverall, how satisfied are you with your visit to our website?   \t\t";
	}

			
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "\n\n";
		msg += "The website survey has not been sent.\n";
		msg += "Please answer the question(s) and re-submit the survey.\n";
		msg += "\n\n";
		msg += "The following question(s) need answers: \n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}
// -->