//提交验证表单数据
function judge(){
	var real_name = document.all("n_ame").value;
	var r_name = document.all("r_name").value;
	var character = /^[\u4e00-\u9fa5]{0,}$/;
	var user_email = document.all("e_mail").value;
	var email = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
	var user_telephone = document.all("t_el").value;
	var telephone = /^(\(\d{3,4}\)|\d{3,4}-)?\d{7,11}$/;
	var user_address = document.all("address1").value;
	var address = /^[\u4e00-\u9fa5]{0,}$/;
	var postalcode = document.all("postalcode").value;
	var postal = /^[1-9]\d{5}$/;
	var r_addr = document.all("r_addr").value;
	var r_postcode = document.all("r_postcode").value;
	var r_tel = document.all("r_tel").value;
	var r_eml = document.all("r_eml").value;		
	if(real_name==""){
		alert("消费者姓名不能为空");
		return false;}
	else if(user_telephone==""){
		alert("消费者电话不能为空");
		return false;}
	else if(user_address==""){
		alert("消费者地址不能为空");
		return false;}
	else if(user_email==""){
		alert("消费者邮件不能为空");
		return false;}
	else if(postalcode==""){
		alert("消费者邮码不能为空");
		return false;}
	else if(r_name==""){
		alert("收货人姓名不能为空");
		return false;}
	else if(r_tel==""){
		alert("收货人电话不能为空");
		return false;}
	else if(r_addr==""){
		alert("收货人地址不能为空");
		return false;}
	else if(r_eml==""){
		alert("收货人邮件不能为空");
		return false;}
	else if(r_postcode==""){
		alert("收货人邮码不能为空");
		return false;}
	else if(!character.test(real_name)){
		alert("消费者姓名必须是汉字");
		return false;}
	else if(!telephone.test(user_telephone)){
		alert("消费者电话不合法");
		return false;}
	else if(!email.test(user_email)){
		alert("消费者邮件不合法");
		return false;}
	else if(!postal.test(postalcode)){
		alert("消费者邮码不合法");
	  return false;}
	else if(!character.test(r_name)){
		alert("收货人姓名必须是汉字");
		return false;}
	else if(!telephone.test(r_tel)){
		alert("收货人电话不合法");
		return false;}
	else if(!email.test(r_eml)){
		alert("收货人邮件不合法");
		return false;}
	else if(!postal.test(r_postcode)){
		alert("收货人邮码不合法");
	  return false;}
	else{
		return true;}
}
//用户真实姓名
function isName(){
  var n_ame = document.all("n_ame").value;
  var r_name = document.all("r_name").value;
  var name = /^[\u4e00-\u9fa5]{0,}$/;
  var name1 = document.all("name1");
  var name5 = document.all("name5");
  var message = "";
  var message1 = "";
  if(n_ame==""){
     message = "<font color='#CC0000'>消费者姓名不可以为空";
  }else if(!name.test(n_ame)){
  	message = "<font color='#CC0000'>消费者姓名要为汉字，例如：小耗子<font>";
  }else{
  	 message = "<font color=red>√</font>";
  }
  name1.innerHTML = message;  
  if(r_name==""){
     message1 = "<font color='#CC0000'>收货人姓名不可以为空";
  }else if(!name.test(r_name)){
  	message1 = "<font color='#CC0000'>收货人姓名要为汉字，例如：小耗子<font>";
  }else{
  	 message1 = "<font color=red>√</font>";
  }
    name5.innerHTML = message1;
}
//联系电话
function telephone(){
  var t_el = document.all("t_el").value;
  var r_tel = document.all("r_tel").value;
	var telephone = /^(\(\d{3,4}\)|\d{3,4}-)?\d{7,11}$/;	
	var name2 = document.all("name2");
	var name9 = document.all("name9");
	var message = "";
	var message1 = "";
	if(t_el==""){
		message ="<font color='#CC0000'>消费者电话不可以为空！<font>";
	}else if(!telephone.test(t_el)){
		message = "<font color='#CC0000'>不是正确的电话号码，例如：0714-6238192 <font>";
	}else{
		message = "<font color=red>√</font>";
	}
	name2.innerHTML = message;
	if(r_tel==""){
		message1 ="<font color='#CC0000'>收货人电话不可以为空！<font>";
	}else if(!telephone.test(r_tel)){
		message1 = "<font color='#CC0000'>不是正确的电话号码，例如：0714-6238192 <font>";
	}else{
		message1 = "<font color=red>√</font>";
	}
	name9.innerHTML = message1;
 }
//地址
function address(){
 	var address = document.all("address1").value;
 	var r_addr = document.all("r_addr").value;
	var name3 = document.all("name3");
	var name7 = document.all("name7");
	var message = "";
	var message1 = "";
	if(address==""){
		message = "<font color='#CC0000'>地址不可以为空！<font>"
	}else{
	 	message = "<font color=red>√</font>";
	}
	name3.innerHTML = message;
	if(r_addr==""){
		message1 = "<font color='#CC0000'>地址不可以为空！<font>"
	}else{
	 	message1 = "<font color=red>√</font>";
	}
	name7.innerHTML = message1;
}
//邮件
function email(){
  var e_mail = document.all("e_mail").value;
  var r_eml = document.all("r_eml").value;
	var email = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
	var name4 = document.all("name4");
	var name10 = document.all("name10");
	var message = "";
	var message1 = "";
	if(e_mail==""){
		message = "<font color='#CC0000'>邮件不可以为空<font>";
	}else if(!email.test(e_mail)){
		message = "<font color='#CC0000'>你输入的邮件不合法，例如：shopwind@21cn.com<font>";
	}else{
		message = "<font color=red>√</font>";
	}
	name4.innerHTML = message;
	if(r_eml==""){
		message1 = "<font color='#CC0000'>邮件不可以为空<font>";
	}else if(!email.test(r_eml)){
		message1 = "<font color='#CC0000'>你输入的邮件不合法，例如：shopwind@21cn.com<font>";
	}else{
		message1 = "<font color=red>√</font>";
	}
	name10.innerHTML = message1;
}
 //邮政编码
function is_postalcode(){
  var postalcode = document.all("postalcode").value;
  var r_postcode = document.all("r_postcode").value;
	var postal = /^[1-9]\d{5}$/;
	var name6 = document.all("name6");
	var name8 = document.all("name8");
	var message = "";
	var message1 = "";
	if(postalcode==""){
		message = "<font color='#CC0000'>邮政编码不可以为空<font>";
	}else if(!postal.test(postalcode)){
		message = "<font color='#CC0000'>你输入的邮政编码不合法，例如：433013<font>";
	}else{
		message = "<font color=red>√</font>";
	}
	name6.innerHTML = message;
	if(r_postcode==""){
		message1 = "<font color='#CC0000'>邮政编码不可以为空<font>";
	}else if(!postal.test(r_postcode)){
		message1 = "<font color='#CC0000'>你输入的邮政编码不合法，例如：433013<font>";
	}else{
		message1 = "<font color=red>√</font>";
	}
	name8.innerHTML = message1;
 }