// show error meggase on registration page
function error_reg_message(msg)
{
	$("#reg_error").html(msg);
	message(msg);
}

// check registration data
function register_submit()
{	
	
	var agree = '';
	$('#agree:checked').each(function(i)
	{
		agree = this.value;
	});
	
	if(agree == '')
	{
		message('Please check the box indicating you agree to the terms and conditions');
		return false;
	}
	
	var email1 = $("#email").val();	
	if(!check_email(email1))
	{
		error_reg_message('Wrong E-mail format');
		return false;
	}

	var captcha = $("#captcha").val();	
	if(captcha == '')
	{
		error_reg_message('Please, enter text on image');
		return false;		
	}
	
	return true;	
}
