$(function() {
    if($('.select1').length > 0) validateSingleSelect();
});

function validateSingleSelect() {
    myForm = $('.select1').closest('FORM');
    
    $(myForm).bind('submit', function() {
        return validateForm(this);
    });
}

function validateForm(myForm) {
    foundOptions = new Array();
    stop = false;
    
    $(myForm).find('.select1').each(function() {
        if($(this).val() == "Yes" && $.inArray($(this).attr('rel'), foundOptions) != -1) {
            alert("Please only select one " + $(this).attr('rel'));
            stop = true;
        } else if($(this).val() == "Yes") {
            foundOptions[foundOptions.length] = $(this).attr('rel');
        }
    });
    
    if(foundOptions.length == 0) {
        alert("Please select at least one Risk Reduction Package");
        stop = true;
    }
    
    if(stop)
        return false;
    else
        return true;
}
