
GroupPage.prototype.countCheckedBoxen = function () {
    var count = 0;

    for (var i=0; i<this.checkBoxes.length; i++)
    {
        if (this.checkBoxes[i].checked) 
            count = count + 1;
    } 

    return count;
}

GroupPage.prototype.validateMultiAddForm = function (evt) {
    var checks = this.countCheckedBoxen();
    if (checks==0)
    {
        if (this.checkBoxes.length < 1) // shouldn't happen, really.
            return true;
        alert("Select the item(s) you'd like from the list by checking the box next to each.\n" + 
                " Be sure to select front and rear, or left and right, as appropriate.");
        return false;
    }  
    return true;
}

function GroupPage() 
{
    var me = this;
    this.checkBoxes = $('.checkbox-add');

    $('#group-add-multiple').bind('submit', function(evt) { return me.validateMultiAddForm(evt) });
}

