
	function chk_survey (x) { 

		submitOK		= "True";
		var message 	= "Form incomplete, please:\n\n";

		if (x.Email.value.length>2 && x.Name.value.length<2)
		{message 		+= "- Enter your name\n";								submitOK="False";}

		if (x.Name.value.length>2 && x.Email.value.length<2)
		{message 		+= "- Enter your email address\n";							submitOK="False";}

		if (x.Email.value.length>2 && !isValidEmail (trim(x.Email.value))) 
		{message 		+= "- Enter a correct email address\n";						submitOK="False"; }



		<!-- check survey has been filled -->

		var f = check_radio_buttons (x); 

		if (f == false)
			var f = check_textarea (x); 

		if (f == false)
		{message 	+= "- Tell us what you think about our new print designs\n";			submitOK="False";}



		<!-- display error if any -->

		if (submitOK=="False") {
 			alert(message)
 			return false;
 		}


		if (x.First_Place.value == "" && x.Second_Place.value == "" && x.Third_Place.value == "") 
			var f = confirm ("You have not told us which of our 3 products you like best.\n\nWould you like to do so?  (click 'Cancel' if yes)."); 

		return f; 		


	} <!-- end of function -->





	<!-- ----------------------------------------- End of Main Function ----------------------------------------- -->


	function check_radio_buttons(x) {

  		for (i=0;i<x.length;i++) {

			var tmp=x.elements[i];

			//alert (tmp.type + " " + tmp.name); 

			if (tmp.type == "radio")
				if (tmp.checked) 
					return true; 
  		}

		return false;

	} <!-- end of function -->




	function check_textarea (x) {

  		for (i=0;i<x.length;i++) {

			var tmp=x.elements[i];

			//alert (tmp.type + " " + tmp.name); 

			if (tmp.type == "textarea" && tmp.value.length > 2)
				return true; 
  		}

		return false;

	} <!-- end of function -->
