$("input[name=survey_listen08]").click(function() {
	var didListen = "";
	var els = $("input[name=survey_listen08]");
	for(var i = 0; i < els.length; i ++) {
		if (els[i].checked)
			didListen = els[i].value;
	}
	
	if (didListen == "N") {
		$("#listen-no").show();
		$("#listen-yes").hide();
		window.location.hash = "nolist";
	} else {
		$("#listen-no").hide();
		$("#listen-yes").show();
		window.location.hash = "list";
	}
});

$("input[name=survey_nolisten]").click(function() {
	var otherReason = false;
	var els = $("input[name=survey_nolisten]");
	for(var i = 0; i < els.length; i ++) {
		if (els[i].value == 4 && els[i].checked)
			otherReason = true;
	}
	if (otherReason) {
		$("#nolisten_other").show();
		$("#nolisten_other").focus();
	} else {
		$("#nolisten_other").hide();
	}
});

$("input[name=survey_listen_d]").click(function() {
	$("#weekday-times,#saturday-times,#sunday-times").hide();
	var els = $("input[name=survey_listen_d]");
	for(var i = 0; i < els.length; i ++) {
		if (els[i].value == "We" && els[i].checked) {
			$("#weekday-times").show();
			continue;
		}
		if (els[i].value == "Sa" && els[i].checked) {
			$("#saturday-times").show();
			continue;
		}
		if (els[i].value == "Su" && els[i].checked) {
			$("#sunday-times").show();
			continue;
		}
	}
});

$("input[name=survey_listen08]").click(function() {
	var didListen = "";
	var els = $("input[name=survey_listen08]");
	for(var i = 0; i < els.length; i ++) {
		if (els[i].checked)
			didListen = els[i].value;
	}
	
	if (didListen == "N") {
		$("#listen-no").show();
		$("#listen-yes").hide();
		window.location.hash = "nolist";
	} else {
		$("#listen-no").hide();
		$("#listen-yes").show();
		window.location.hash = "list";
	}
});
