
$(function(){
		var EmailTabMsg ;var msgStats = [0,0,0,0];
$("#registerBotton").click(function(){
		EmailTabMsg = ""
		if ($("#UserComments").val()==""){
			EmailTabMsg+="【留言内容】";
			msgStats[0] = 1;
		}else{
			msgStats[0] = 0;
		}
		if ($("#UserName").val()==""){
			EmailTabMsg+="【联系人】";
			msgStats[1] = 1;
		}else{
			msgStats[1] = 0;
		}
		if ($("#Telephone").val()==""){
			EmailTabMsg+="【联系电话】";
			msgStats[2] = 1;
		}else{
			msgStats[2] = 0;
		}
		if ($("#vcodeText").val()==""){
			EmailTabMsg+="【验证码】";
			msgStats[3] = 1;
		}else{
			msgStats[3] = 0;
		}
		if (msgStats[0]==0&&msgStats[1]==0&&msgStats[2]==0&&msgStats[3]==0){
			if ($("#emailText").val()!=""){
				var patrn = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
				if (!patrn.exec($("#emailText").val())){
					$.fn.ShowTip('温馨提示','电子邮箱格式错误',300,80,0,5,0,0,1,1);
					return false;
				}
			}
				$.fn.ShowTip('温馨提示','<br />正在提交数据，请稍等～～<div><img src="/themes/images/loading.gif" /></div>',300,80,1,0,0,0,1,1);
				$.ajax({
				   type: "POST",
				   url: "/common/toemail2.aspx",
				   data: "msg="+$("#UserComments").val()+"&name="+$("#UserName").val()+"&telphone="+$("#Telephone").val()+"&email="+$("#emailText").val()+"&CompanyName="+$("#CompanyName").val()+"&Address="+$("#Address").val()+"&zipcode="+$("#zipcode").val()+"&sefecode="+$("#vcodeText").val(),
				   cache:false,
				   success: function(msg){
						if (msg=="1"){
							$.fn.ShowTip('温馨提示','我们已经收到您的留言，稍后会与您联系，谢谢！',300,80,0,5,0,0,1,1);
							}else if (msg=="0"){
								$.fn.ShowTip('温馨提示','系统繁忙，请稍后再发送！谢谢！',300,80,0,5,0,0,1,1);
								}else {
								$.fn.ShowTip('温馨提示','验证码错误！',300,80,0,5,0,0,1,1);
								document.getElementById('MzImgExpPwd').src='/common/SafeCode.ashx?temp='+ (new Date().getTime().toString(36))
							}
				   }
				   
				});
			
		}else{
			$.fn.ShowTip('温馨提示',EmailTabMsg+"<br />都必须填写",300,80,0,5,0,0,1,1);
			EmailTabMsg = null;	
		}
	})   
	 
})
