function validate()
{
    var fm = document.res;
    var errors="";

    if (fm.comp_name.value == "") {
        errors += "- name of the production member who earned this comp ticket\n";
    }

    if (fm.name.value == "") {
        errors += "- name of the person who will pick up this ticket(s)\n";
    }

    var showsel = false;
    for (var ix=0; ix<fm.performance_date.length; ix++) {
	if (fm.performance_date[ix].checked) {
	    showsel = true;
	}
    }
    if (!showsel) {
	errors += "- which performance you will be attending\n";
    }

    tickets =
	fm.comp_tickets.value +
        fm.tickets_4.value +
        fm.tickets_3.value +
        fm.tickets_2.value +
        fm.tickets_1.value +
	'0';

    if (tickets == 0 || tickets.match(/[^\d]/)) {
        errors += "- number of tickets you will need (numbers only)\n";
    }

    if (fm.email.value =="") {
	if (fm.contact_method[0].checked) {
	    errors += "- contact email address\n";
	} else if (fm.cc[0].checked) {
	    errors += "- email address to send confirmation to\n";
	}
    }

    if (fm.home_phone.value+fm.work_phone.value =="") {
	if (fm.contact_method[1].checked) {
	    errors += "- contact phone number\n";
	}
    }

    if (errors != "") {
        alert("Please fill out the following fields:\n" + errors);
        return false;
    } else
        return true;
}

