$(document).ready(function() {
                
        $("#add_link").click(function() {

            var new_num = $(".participant_email_row").size() + 1;

            if(new_num==10){
                $("#more_container").html('This form only permits ten attendees to be registered at a time. If you would like send more than ten participants, please fill this form out in full twice or contact us.');
            }
        
            $(".participant_email_row:last").after('<tr><td>&nbsp;</td><td></td></tr><tr><td width="200">Participant #'+new_num+' Name:</td><td><input type="text" name="name'+new_num+'" /></td></tr><tr><td>&nbsp;</td><td></td></tr><tr class="participant_email_row"><td>Participant #'+new_num+' Email:</td><td><input type="text" name="email'+new_num+'" /></td></tr>');

            $(".more_info").show();
        });
        
        $("#training_reg").submit(function() {
            var already_alerted = false;
        
           //Validate the form
           $(".required").each(function() {
            if(!already_alerted && $(this).val() == '') {
                alert($(this).attr("validation_alert"));
                already_alerted = true;
            }
           });
           
           return (!already_alerted);
        });
            
});