//用户注册格式校验
function check(){
	var $fname=$("#reg_firstname");
	var $lname=$("#reg_lastname");
	var $mail=$("#reg_mail");
	var $add=$("#reg_address");
	var $post=$("#reg_postcode");
	var $city=$("#reg_city");
	var $country=$("#reg_country");
	var $tel=$("#reg_telephone");
	var $pass1=$("#reg_pass1");
	var $pass2=$("#reg_pass2");
	if($.trim($fname.val())==""){
		alert("Please enter the firstname");
		return false;
	}
	if($.trim($lname.val())==""){
		alert("Please enter the lastname");
		return false;
	}
	if($.trim($mail.val())==""){
		alert("Please enter E-mail");
		return false;
	}
	if(!isMail($.trim($mail.val()))){
		alert("Please check your e-mail format");
		return false;
	}
	if($.trim($add.val())==""){
		alert("Please enter the address");
		return false;
	}
	if($.trim($post.val())==""){
		alert("Please enter the postcode");
		return false;
	}
	if(!isNumber($.trim($post.val()))){
		alert("Code can only be number");
		return false;
	}
	if($.trim($post.val()).length<5){
		alert("Code 5 digits");
		return false;				
	}
	if($.trim($city.val())==""){
		alert("Please enter the city");
		return false;
	}
	if($.trim($country.val())=="0"){
		alert("Please select the country");
		return false;
	}
	if($.trim($tel.val())==""){
		alert("Please enter the telephone");
		return false;
	}
	if($.trim($pass1.val())==""){
		alert("Please enter the password");
		return false;
	}
	if($.trim($pass2.val())==""){
		alert("Please enter the password Confirmation");
		return false;
	}
	if($.trim($pass1.val())!=$.trim($pass2.val())){
		alert("Both times the password is not the same as");
		return false;
	}
	$("#user_reg").submit();
}
