	function product_login()
	{
		var customer = document.getElementById('product_login_customer').value;
		var password = document.getElementById('product_login_password').value;
		if (!Utils.isEmail(customer))
		{
			alert('请填写正确的Email');
			document.getElementById('product_login_customer').focus();
			return false;
		}
		if (password < 6)
		{
			alert('密码不能小于6位');
			document.getElementById('password').focus();
			return false;
		}
		var before_page = $("#login_loading").html();
		$("#login_loading").html("登录中，请稍等……");
		$.ajax({
			type:"POST",
			url:"user_validate.php",
			cache:false,
			dataType:'json',     //接受数据格式
			data:"customer="+customer+"&password="+password+"&act=login&return_url=flow.php?step=flow",
			success:function (result){
				if (result.error == 1)
				{
					alert(result.message);
					$("#login_loading").html(before_page);
				}
				else
				{
					show_comment('comment','1');
					$("#login_loading").html(before_page);
					clear_input_text()
				}
			}
		});
	}
	
	function product_register()
	{
		var customer = document.getElementById('product_reg_customer').value;
		var first_password = document.getElementById('product_reg_password').value;
		var second_password = document.getElementById('product_reg_second_password').value;
		if (!Utils.isEmail(customer))
		{
			alert('用户名格式不正确');
		}
		if (first_password.length < 6)
		{
			alert('密码不能小于6位');
			return false;
		}
		if (first_password != second_password)
		{
			alert('两次填写的密码不相同');
			return false;
		}
		var before_page = $("#reg_loading").html();
		$("#reg_loading").html("注册中，请稍等……");
		$.ajax({
			type:"POST",
			url:"user_validate.php",
			cache:false,
			dataType:'json',     //接受数据格式
			data:"customer="+customer+"&password="+first_password+"&act=reg",
			success:function (result){
				if (result.error == 1)
				{
					alert(result.message);
					$("#reg_loading").html(before_page);
				}
				else
				{
					show_comment('comment','1');
					$("#reg_loading").html(before_page);
					clear_input_text()
				}
			}
		});
	}
	
	function clear_input_text()
	{
		document.getElementById('product_reg_customer').value = '';
		document.getElementById('product_reg_password').value = '';
		document.getElementById('product_reg_second_password').value = '';
		document.getElementById('product_login_customer').value = '';
		document.getElementById('product_login_password').value = '';
	}