<!DOCTYPE html>
<html lang=zh-cn> 
<head>
	<meta charset=utf-8> 
	<title>注册纵横通行帐号</title> 
	<meta name=description content=一个帐号通用纵横旗下所有网络产品。> 
	<meta name=copyright content=smartcost.com.cn> 
	<link rel=stylesheet href=<?php echo $data['rootUrl_CSS']; ?>global.css> 
	<script src=<?php echo $data['rootUrl_JS']; ?>jquery-1.7.1.min.js></script> 
	<script src=<?php echo $data['rootUrl_JS']; ?>global.js></script> 
	<script src=<?php echo $data['rootUrl_JS']; ?>smartcost.js></script>
	<script src=<?php echo $data['rootUrl_JS']; ?>jquery.validate.min.js></script>
	<script type="text/javascript">
	    $(function(){
	    	$("input[id^='web']").click(function(){
	    		if($(this).attr("checked")=='checked'){
	    			$("#web").val(1);
	    			$("#webSoft").show();
	    		}else{
	    			$("#web").val(2);
	    			$("#webSoft").hide();
	    		}
	    	});
			jQuery.validator.addMethod("isMobile", function(value, element) {
				var length = value.length;
				var mobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1})|(14[0-9]{1}))+\d{8})$/;
				return this.optional(element) || (length == 11 && mobile.test(value));
			}, "请正确填写您的手机号码");
			jQuery.validator.addMethod("isCode", function(value, element) {
				var length = value.length;
				var mobile = /^(\d{6})$/;
				return this.optional(element) || (length == 6 && mobile.test(value));
			}, "请正确填写验证码");

			$("#regform").validate({
	            rules: {
					zhemail: {
						required: true,
						email: true,
						remote: {
							url: '<?php echo $data['rootUrl']; ?>check',
							type: 'POST',
							dateType: 'json',
							data: {
								zhemail: function () {
									return $('#zhemail').val();
								}
							}
						}
					},
					zhuser: {
						required: true,
						minlength: 3,
						maxlength: 18,
						remote: {
							url: '<?php echo $data['rootUrl']; ?>check',
							type: 'POST',
							dateType: 'json',
							data: {
								zhuser: function () {
									return $('#zhuser').val();
								}
							}
						}
					},
					zhpasswd: {
						required: true,
						minlength: 6
					},
					zhpwdrepeat: {
						required: true,
						equalTo: "#zhpasswd",
						minlength: 6
					},
					zhanswer: {
	                    required: true
					},
					zhq: {
	                    required: true
					},
					defq: {
	                    required: true
					},
	                realName: {
	                	required: "#web:checked"
	                },
	                PhoneNum: {
	                	required: "#web:checked"
	                },
	                Company: {
		                required: "#web:checked"
		            },
		            MobileNum: {
		                required: "#web:checked"
		            },
		            QQ: {
		                required: "#web:checked"
		            },
		            Address: {
		                required: "#web:checked"
		            }
	            },
	            messages: {
	                zhemail:{
	                    required:"请填写有效邮箱地址",
	                    email: "请填写有效邮箱地址（例如 myemail@qq.com）",
	                    remote: "该邮箱已被注册！"
	                },
	                zhuser:{
	                    required:"请输入您的注册账户",
	                    remote: "账户已被注册！",
	                    minlength:"长度不能低于3个字符",
	                    maxlength:"长度超过18个字符"
	                },
	                zhpasswd:{
	                    required:"请输入密码",
	                    minlength: "密码长度不能小于6"
	                },
	                zhpwdrepeat:{
	                    required:"请重复密码",
	                    minlength: "密码长度不能小于6",
	                    equalTo: "请输入相同的密码"
	                },
	                zhanswer: {
	                    required:"请输入答案"
	                },
	                zhq: {
	                    required:"请选择问题"
	                },
	                defq: {
	                    required:"请选择问题"
	                },
	                realName: {
	                	required: "请输入姓名"
	                },
	                PhoneNum: {
	                	required: "请输入手机号码"
	                },
	                Company: {
		                required: "请输入公司名称"
		            },
		            MobileNum: {
		                required: "请输入电话号码"
		            },
		            QQ: {
		                required: "请输入QQ"
		            },
		            Address: {
		                required: "请输入地址"
		            }
	            },
	            errorElement: "span",// 错误信息容器标签
	            errorClass: "erroT",
	            validClass: "inputSus",
	            onkeyup: false
	        });

			$('#regmobileform').validate({
				rules: {
					zhmobile:{
						required: true,
						isMobile: true,
						remote: {
							url: '<?php echo $data['rootUrl']; ?>check',
							type: 'POST',
							dateType: 'json',
							data: {
								zhmobile: function () {
									return $('#zhmobile').val();
								}
							}
						}
					},
					zhmpasswd: {
						required: true,
						minlength: 6,
						maxlength: 16
					},
					zhmpwdrepeat: {
						required: true,
						equalTo: "#zhmpasswd",
						minlength: 6
					},
					zhsmscode: {
						required: true,
						isCode: true,
						remote: {
							url: '<?php echo $data['rootUrl']; ?>check',
							type: 'POST',
							dateType: 'json',
							data: {
								zhsmscode: function () {
									return $('#zhsmscode').val();
								},
								zhmobile: function () {
									return $('#zhmobile').val();
								}
							}
						}
					},
					zhmuser: {
						required: true,
						minlength: 3,
						maxlength: 18,
						remote: {
							url: '<?php echo $data['rootUrl']; ?>check',
							type: 'POST',
							dateType: 'json',
							data: {
								zhmuser: function () {
									return $('#zhmuser').val();
								}
							}
						}
					}
				},
				messages: {
					zhmobile:{
						required: "请输入手机号",
						remote: "该手机号码已被注册！"
					},
					zhmpasswd:{
						required:"请输入密码",
						minlength: "密码长度不能小于6",
						maxlength: "密码长度不能大于16"
					},
					zhmpwdrepeat:{
						required:"请重复密码",
						minlength: "密码长度不能小于6",
						equalTo: "请输入相同的密码"
					},
					zhsmscode: {
						required: "请输入验证码",
						remote: "验证码过期或不一致，请重新获取"
					},
					zhmuser:{
						required:"请输入您的注册账户",
						minlength:"长度不能低于3个字符",
						maxlength:"长度不能超过18个字符",
						remote: "账户已被注册！"
					}
				},
				errorElement: "span",// 错误信息容器标签
				errorClass: "erroT",
				validClass: "inputSus",
				onkeyup: false
			});

	        $('#zhq').change(function(){
	            if($('#zhq').val()==6){
	                $("#defq").show();//隐藏
	                $("#definput").show();//显示
	                $(this).addclass(':required');//显示
	            }else{
	                $("#defq").hide();//隐藏
	                $("#definput").hide();//显示
	            }
	        });
	    });
	</script>
</head>
<body>
<?php include Doo::conf()->SITE_PATH .  Doo::conf()->PROTECTED_FOLDER . "viewc/v2/_header.php"; ?>
<div class="width950 userInfoPanel clearfix">
		<a href="http://sso.smartcost.com.cn" title="返回通行帐号首页"><img src="<?php echo $data['rootUrl_IMG']; ?>mainlogo.png" class="fL"></a><!-- <p><b>techen</b>，<a href="#">管理</a>&nbsp;<a href="#">退出</a></p> -->
</div>
<div class="globalContent width950">
	<div class="formItem">
		<h2>注册通行帐号</h2>
		<div class="trainForm">
			<div class="trainFormTab clearfix">
				<a class="now">使用邮箱注册</a>
				<a>使用手机注册</a>
			</div>
		</div>
		<div class="trainFormItem">
			<div class="formEntry clearfix">
				<div class="regInfo fR">
					<div class="regStepTip">
						<p class="colGreen"><b>第一步 填写注册信息</b></p>
						<p>第二步 进行邮箱验证</p>
						<p>第三步 完成注册</p>
					</div>
					<div class="regTips">
						<b>什么是纵横通行账号？</b>
						<p>纵横通行账号是纵横推出的统一帐号系统。拥有了纵横通行账号即可以畅通纵横网站服务，在众多个性化产品中直接登录使用，免去了重复注册，重复登录的步骤，并能充分享受为您量身定制的各种个性化会员服务。</p>
					</div>
				</div>
				<form id="regform" name="iform" method="post" >
					<dl class="regForm">
						<dd class="clearfix hide"><b style="font-size:30px;color:#f90000">暂停注册</b></dd>
						<dt>您的邮箱</dt>
						<dd><input id="zhemail" name="zhemail" class="inputText"><p class="tips">找回密码，修改密码等操作重要凭证</p></dd>
						<dt>密码</dt>
						<dd><input type="password" name="zhpasswd" id="zhpasswd" class="inputText">
							<p class="tips">密码长度为6～16位，建议使用数字与英文混合</p>
						</dd>
						<dt>确认密码</dt>
						<dd><input type="password" name="zhpwdrepeat" id="zhpwdrepeat" class="inputText">
							<p class="tips">再次输入你的密码</p></dd>
						<dt>怎么称呼您</dt>
						<dd><input name="zhuser" id="zhuser" class="inputText">
							<p class="tips">3-18位，可以由中英文、数字和标点符号等组合</p>
						</dd>
						<dt>密码保护问题</dt>
						<dd>
							<select name ="zhq" id="zhq">
								<option value="">请选择</option>
								<option value="1">您父亲的名字是？</option>
								<option value="2">您母亲的名字是？</option>
								<option value="3">您的英文名字是？</option>
								<option value="4">您身份证最后6位数字是？</option>
								<option value="5">您就读的第一所学校全称是？</option>
								<option value="6">自定义问题</option>
							</select>
						</dd>
						<dt id="defq" style="display: none">自定义问题</dt>
						<dd id="definput" style="display: none"><input name="defq" id="defq" class="inputText" /></dd>
						<dt>您的答案</dt>
						<dd><input name="zhanswer" id="zhanswer" class="inputText">
							<p class="tips">找回账号密码时必填项，请牢记！</p></dd>
					</dl>

					<dl class="regForm">
						<dd class="clearfix"><br><br><input type="submit" id="regsubmit" name="regsubmit" value="同意以下协议并注册"  class="button btn-green " />
							<!-- <b style="font-size:18px;color:#f90000">暂停注册，请联系官方客服，企业QQ：800003850</b> -->
						</dd>
						<dd><br><a href="http://help.smartcost.com.cn/hc/kb/article/161192/" target="_blank" style="color:#999">《通行帐号注册协议》</a></dd>
					</dl>
				</form>
			</div>
			<div class="formEntry reportContent" style="display:none">
				<div class="regInfo fR">
					<div class="regStepTip">
						<p class="colGreen"><b>第一步 填写注册信息</b></p>
						<p>第二步 完成注册</p>
					</div>
					<div class="regTips">
						<b>什么是纵横通行账号？</b>
						<p>纵横通行账号是纵横推出的统一帐号系统。拥有了纵横通行证即可以畅通纵横网站服务，在众多个性化产品中直接登录使用，免去了重复注册，重复登录的步骤，并能充分享受为您量身定制的各种个性化会员服务。</p>
					</div>
				</div>
				<form id="regmobileform" name="mobileform" method="post" action="<?php echo $data['rootUrl']; ?>smsreg">
					<dl class="regForm">
						<dt>手机号</dt>
						<dd>
							<input id="zhmobile" name="zhmobile" class="inputText">
							<p class="tips">请输入你的手机号码</p>
						</dd>
						<dt>密码</dt>
						<dd><input type="password" name="zhmpasswd" id="zhmpasswd" class="inputText">
							<p class="tips">密码长度为6～16位，建议使用数字与英文混合</p>
						</dd>
						<dt>确认密码</dt>
						<dd><input type="password" name="zhmpwdrepeat" id="zhmpwdrepeat" class="inputText">
							<p class="tips">再次输入你的密码</p></dd>
						<dt>短信校验码</dt>
						<dd><input type="text" class="inputText" name="zhsmscode" id="zhsmscode" style="width:177px;"><p class="tips">验证码是6位数字</p><input type="button" class="btnTextOne" id="codebtn" name="codebtn" value="获取验证码" onclick="checkAndSend(this)" ></dd>
						<dt>怎么称呼您</dt>
						<dd>
							<input id="zhmuser" name="zhmuser" class="inputText">
							<p class="tips">3-18位，可以由中英文、数字和标点符号等组合</p>
						</dd>
					</dl>
					<dl class="regForm">
						<dd class="clearfix"><br><br><input type="submit" id="regmsubmit" name="regmsubmit"  class="button btn-green " value="同意以下协议并注册"></dd>
						<dd><br><a href="http://help.smartcost.com.cn/hc/kb/article/161192/" target="_blank" style="color:#999">《通行帐号注册协议》</a></dd>
					</dl>
				</form>
			</div>
		</div>
	</div>
</div>
<?php include Doo::conf()->SITE_PATH .  Doo::conf()->PROTECTED_FOLDER . "viewc/v2/_footer.php"; ?>
<script type="text/javascript">
	var clock = '';
	var nums = 60;
	var btn;
	function checkAndSend(thisbtn){
		$('#zhmobile').removeClass('erroT');
		if($('#zhmobile').siblings().hasClass('erroT')){
			$('#zhmobile').siblings('.erroT').remove();
		}
		var mobile = $('#zhmobile').val();
		if(mobile == ''){
			$('#zhmobile').addClass('erroT');
			var span = '<span class="erroT">请输入手机号</span>';
			$('#zhmobile').parent().append(span);
			return false;
		}else if(!mobile.match(/^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1})|(14[0-9]{1}))+\d{8})$/)){
			$('#zhmobile').addClass('erroT');
			var span = '<span class="erroT">请正确填写您的手机号码</span>';
			$('#zhmobile').parent().append(span);
			return false;
		}
		var flag = true;
		$.ajax({
			url: '<?php echo $data['rootUrl']; ?>checksms',
			type: 'POST',
			dateType: 'json',
			async: false,
			data: {zhmobile:mobile},
			success: function (result) {
				var data = eval('('+result+')');
				if(data.code == -1){
					$('#zhmobile').addClass('erroT');
					var span = '<span class="erroT">'+data.msg+'</span>';
					$('#zhmobile').parent().append(span);
					flag = false;
				}else if(data.code == 1){
					flag = true;
				}
			}
		});
		if(!flag){
			return false;
		}
		$('#zhmobile').addClass('inputSus');
		sendCode(thisbtn);
	}

	function sendCode(thisBtn)
	{
		btn = thisBtn;
		btn.disabled = true; //将按钮置为不可点击
		btn.value = nums+'秒后可重新获取';
		$('#codebtn').removeClass('btnTextOne').addClass('btnText');
		btn.style.cursor = 'no-drop';
		clock = setInterval(doLoop, 1000); //一秒执行一次
	}
	function doLoop()
	{
		nums--;
		if(nums > 0){
			btn.value = nums+'秒后可重新获取';
		}else{
			clearInterval(clock); //清除js定时器
			btn.disabled = false;
			btn.value = '点击发送验证码';
			$('#codebtn').removeClass('btnText').addClass('btnTextOne');
			btn.style.cursor = 'pointer';
			nums = 60; //重置时间
		}
	}
</script>
</body>
</html>