// Addign various event-handlers on the tv application form
// JavaScript Document for Lingo
// Using Jquery

	
$(document).ready(function() {
                $("#aanmeldenTV").validate({
                        invalidHandler: function(form,validator) {
                                validator.showErrors();
                                $('#aanmeldenTV div input').keydown(function() {
                                        if($(this).next().hasClass('error')) $(this).next().hide();
                                });
                                $('#aanmeldenTV div.gender input').click(function() {
                                        if($(this).next().hasClass('error')) $(this).next().hide();
                                        if($(this).prev().prev().hasClass('error')) $(this).prev().prev().hide();
                                });
                                $('#aanmeldenTV div select').keydown(function() {
                                        if($(this).next().hasClass('error')) $(this).next().hide();
                                });
                                $('#aanmeldenTV div textarea').keydown(function() {
                                        if($(this).next().hasClass('error')) $(this).next().hide();
                                });
                        }

                });
});
