$(document).ready(function(){
	$("#q1 ul a").click(function(){
		menuLayers.hide();
		$("#q1a").html($(this).html());
		$("#q1af").val($(this).html());
	});
	
	$("#q2 ul a").click(function(){
		menuLayers.hide();
		$("#q2a").html($(this).html());
		$("#q2af").val($(this).html());
	});
	
	$("#q3 ul a").click(function(){
		menuLayers.hide();
		$("#q3a").html($(this).html());
		$("#q3af").val($(this).html());
	});
	
	$("#q4 ul a").click(function(){
		menuLayers.hide();
		$("#q4a").html($(this).html());
		$("#q4af").val($(this).html());
	});
	
	$("#q5 ul a").click(function(){
		menuLayers.hide();
		$("#q5a").html($(this).html());
		$("#q5af").val($(this).html());
	});
	
	$("#q6 ul a").click(function(){
		menuLayers.hide();
		$("#q6a").html($(this).html());
		$("#q6af").val($(this).html());
	});
	
	$("#q7 ul a").click(function(){
		menuLayers.hide();
		$("#q7a").html($(this).html());
		$("#q7af").val($(this).html());
	});
	
	$("#q8 ul a").click(function(){
		menuLayers.hide();
		$("#q8a").html($(this).html());
		$("#q8af").val($(this).html());
	});
	
	$("#ipatf").submit(function(){
		if (($("#q1af").val() == '') || ($("#q2af").val() == '') || ($("#q3af").val() == '') || ($("#q4af").val() == '') || ($("#q5af").val() == '') || ($("#q6af").val() == '') || ($("#q7af").val() == '') || ($("#q8af").val() == '')) {
			alert("Please make sure that you've selected all the options on this page.");
			return false;
		}
	});
});