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