$(function() {
	$("#btnForm").live('click',function(){
		$('#firstname_error').html("");
		$('#lastname_error').html("");
		$('#email_error').html("");
		$('#topics_error').html("");
		
		
		var validate = true; 
		if ($('#firstname').val() == ""){
			validate = false;
			$('#firstname_error').html('<span class="red">Please enter first name.</span>');
		}
		if ($('#lastname').val() == ""){
			validate = false;
			$('#lastname_error').html('<span class="red">Please enter your surname.</span>');
		}
		
		if ($('#email').val() == ""){
			validate = false;
			$('#email_error').html('<span class="red">Please enter your email.</span>');
		}
					
		if($('input[type=checkbox]').filter(':checked').length == "0"){
			validate = false;
			$('#topics_error').html('<span class="red">Please indicate the topic(s) you are interested in.</span>');
		}
		
		if (validate == true){
			$("#frmRegister").submit();
		}
		
	})
})// JavaScript Document
