function subform_onsubmit() {
if (document.subform.sub_to.value=="")
	{
	  alert("收货人姓名不能为空。")
	  document.subform.sub_to.focus()
	  return false
	 }
else if(document.subform.sub_adds.value=="")
	{
	  alert("收货人地址不能为空。")
	  document.subform.sub_adds.focus()
	  return false
	 }
else if(document.subform.sub_post.value=="")
	{
	  alert("收货人邮编不能为空。")
	  document.subform.sub_post.focus()
	  return false
	 }
else if(document.subform.sub_tel.value=="")
	{
	  alert("联系电话不能为空。")
	  document.subform.sub_tel.focus()
	  return false
	 }
	 
else if(document.subform.sub_mail.value.length!=0)
  {
    if (document.subform.sub_mail.value.charAt(0)=="." ||        
         document.subform.sub_mail.value.charAt(0)=="@"||       
         document.subform.sub_mail.value.indexOf('@', 0) == -1 || 
         document.subform.sub_mail.value.indexOf('.', 0) == -1 || 
         document.subform.sub_mail.value.lastIndexOf("@")==document.subform.sub_mail.value.length-1 || 
         document.subform.sub_mail.value.lastIndexOf(".")==document.subform.sub_mail.value.length-1)
     {
      alert("Email地址格式不正确！");
      document.subform.sub_mail.focus();
      return false;
      }
   }
 else
  {
   alert("Email不能为空！");
   document.subform.sub_mail.focus();
   return false;
   }	 	 
}

function Fuc_BeUserName(fo){
	sub_from = document.subform.sub_from.value;
	sub_fromtel = document.subform.sub_fromtel.value;
	sub_frommail = document.subform.sub_frommail.value;
	sub_fromadds = document.subform.sub_fromadds.value;
	sub_frompost = document.subform.sub_frompost.value;
	if(fo.checked){
		if(sub_from!=""){
			document.subform.sub_to.value = sub_from
		}
		}else{
		document.subform.sub_to.value = "";
	}
	if(fo.checked){
		if(sub_fromtel!=""){
			document.subform.sub_tel.value = sub_fromtel
		}
		}else{
		document.subform.sub_tel.value = "";
	}
	if(fo.checked){
		if(sub_frommail!=""){
			document.subform.sub_mail.value = sub_frommail
		}
		}else{
		document.subform.sub_mail.value = "";
	}
	if(fo.checked){
		if(sub_fromadds!=""){
			document.subform.sub_adds.value = sub_fromadds
		}
		}else{
		document.subform.sub_adds.value = "";
	}
	if(fo.checked){
		if(sub_frompost!=""){
			document.subform.sub_post.value = sub_frompost
		}
		}else{
		document.subform.sub_post.value = "";
	}

}