regedit.js 20.9 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679
(function(){
	
	
	if(!window.Reg){
		window.Reg = {};
	}
	var showTips = window.Reg.showTips || function(tips, obj){
		$(obj).addClass("user-red");
		var tipsIndicationHtml =  '<td class="relative_login">'+
		  						  '<span class="r-ni-bg" id="tipsIndicationId"><i class="u-login-tip"></i> ' + tips +
		  						  '</span></td>';
		if($(obj).parent().siblings(".relative_login").length == 0){
			$(obj).parent().after(tipsIndicationHtml);
		}
	};
	var clearTips = window.Reg.clearTips || function(obj){
		$(obj).removeClass("user-red");
		$(obj).parent().siblings(".relative_login").remove();
	};
	
	var showExtError = window.Reg.showExtError || function(obj){
		$(obj).siblings(".f-prompt").show();
		if($(obj).hasClass("correct")){
			$(obj).removeClass("correct");
		}
	};
	
	var hideExtError = window.Reg.hideExtError || function(obj){
		$(obj).removeAttr("val");
		$(obj).siblings(".f-prompt").hide();
		if($(obj).val() != ""){
			$(obj).addClass("correct");
		}
	};
	
	var isComReg = window.Reg.isComReg || function(){
		return jQuery("#qyregForm").length > 0 && jQuery("#qyregForm").is(":visible");
	};
	
	var xssFilter = window.Reg.xssFilter || function(s){
		var pattern = new RegExp("[!@#$^&*=\\[\\].<>/?&]");
		return pattern.test(s);
	};
	
	window.Reg.isComReg = isComReg;
	window.Reg.xssFilter = xssFilter;
	window.Reg.showTips = showTips;
	window.Reg.clearTips = clearTips;
	window.Reg.showExtError = showExtError;
	window.Reg.hideExtError = hideExtError;
	
	// tab页切换
	Tools.setSelected("rt-tab", "li", "on", {
		fun : function(view){
			if(view.index() == 0){
				$('.rt-view').eq(0).hide();
				$('.rt-view').eq(1).show();
			}else{
				$('.rt-view').eq(0).show();
				$('.rt-view').eq(1).hide();
			}
			contanerCate = window.Reg.isComReg() ? "qy" : "";
		}
	});
	
})();

var oldPhoneNumber, oldAccountName;
var contanerCate = window.Reg.isComReg() ? "qy" : "";
var countDownStop = false;
var sec = 0;
var smsExpireTime = (window.sms_interval && typeof window.sms_interval != 'undefined') ? window.sms_interval : 10;

function companyqyFocus(obj){
	window.Reg.showTips("请输入您营业执照上的公司名称", obj);
}

function checkCom(obj){
	
	/*window.Reg.clearTips(obj);
	var companyName = $("#qycompanyNameId").val();
	var comReg = /^[\u4E00-\u9FA5]{4,50}$/;
	if(companyName == ""){
		$(obj).removeClass("correct");
		$("#spanCompanyId").html("公司名称不能为空");
		$("#qycompanyId").css('display', 'block');
	}else if(!comReg.test(companyName)) {
		$(obj).removeClass("correct");
		$("#spanCompanyId").html("公司名称格式不正确");
		$("#qycompanyId").css('display', 'block');	
	} else {
		$(obj).addClass("correct");
		$("#qycompanyId").hide();
	}*/
}
function phoneNumberFocus(obj){
	window.Reg.showTips("请输入您真实有效的手机号码", obj);
}
function accountFocs(obj){
	if($(obj).parent().siblings(".relative_login").length == 0){
		window.Reg.showTips("请输入6-20位的非全数字的中文、英文、数字作为用户名", obj);
	}
}
function pwdFocus(obj){
	window.Reg.showTips("请输入8-20位字母、数字组合", obj);
}
function checkPwdAginFocus(obj){
	window.Reg.showTips("请再次输入密码", obj);
}

function showErrorBox(elem, flag) {
	if(flag){
		$(elem).addClass("error");
		$(elem).removeClass("valid");
	} else {
		$(elem).addClass("valid");
		$(elem).removeClass("error");
	}
}

function checkPhoneNumber(obj) {
	window.Reg.clearTips(obj);
	var elem = $("#" + contanerCate + "phoneNumeber");
	var phoneNumber = $(elem).val();
	var regPartton = /^1(3[0-9]|5[0-3]|45|47|5[5-9]|8[0-9]|70|7[6-8])\d{8}$/;
	if(phoneNumber == ""){
		showErrorBox(elem,true);
		$(obj).removeClass("correct");
		$("#" + contanerCate + "spanPhoneId").html("手机号码不能为空");
		$("#" + contanerCate + "phonetdid").css('display', 'block');
	}else if(isNaN(phoneNumber)){
		showErrorBox(elem,true);
		$(obj).removeClass("correct");
		$("#" + contanerCate + "spanPhoneId").html("目前国内的手机号码为全数字,请输入正确的国内手机号");
		$("#" + contanerCate + "phonetdid").css('display', 'block');
	}else if(phoneNumber.length < 11){
		showErrorBox(elem,true);
		$(obj).removeClass("correct");
		$("#" + contanerCate + "spanPhoneId").html("目前国内手机号均为11位,请输入正确的国内手机号码");
		$("#" + contanerCate + "phonetdid").css('display', 'block');
	}else if (!regPartton.test(phoneNumber)) {
		showErrorBox(elem,true);
		$(obj).removeClass("correct");
		$("#" + contanerCate + "spanPhoneId").html("目前只支持移动、联通、电信的手机号,请输入正确的手机号前3位");
		$("#" + contanerCate + "phonetdid").css('display', 'block');
	}else {
		$.ajax({
			type : 'post',
			url : "/regedit/checkPhone?phoneNumber=" + phoneNumber,
			success : function(data) {
				if (data) {
					$(obj).addClass("correct");
					$("#" + contanerCate + "phonetdid").hide();
					showErrorBox(elem,false);
				} else {
					$(obj).removeClass("correct");
					showErrorBox(elem,true);
					if($("#regisPnrId").val()=="true"){
						$("#" + contanerCate + "spanPhoneId").html("该手机已注册,立即 <i><a style='color:#c00300;' href='https://passport.nong12.com/uc/login.aspx'>登录</a></i> 或  <i><a style='color:blue;' href='https://passport.nong12.com/forgot/forgot.aspx'>找回密码</a></i>");
					}else{
						$("#" + contanerCate + "spanPhoneId").html("该手机已注册,立即 <i><a style='color:#c00300;' href='https://passport.dilisx.com/uc/login.aspx'>登录</a></i> 或  <i><a style='color:blue;' href='https://passport.dilisx.com/forgot/forgot.aspx'>找回密码</a></i>");
					}
					$("#" + contanerCate + "phonetdid").css('display', 'block');
					sec = 0;
					countDownStop = true;
				}
			},
			error : function() {
				showErrorBox(elem,true);
				$(obj).removeClass("correct");
				$("#" + contanerCate + "spanPhoneId").html("验证手机号码超时");
				$("#" + contanerCate + "phonetdid").css('display', 'block');
			}
		});
	}
	oldPhoneNumber = phoneNumber;
}

function checkPwd(obj) {
	window.Reg.clearTips(obj);
	var re = /^[\W_a-zA-z0-9-]{6,20}$/i;
	var elem = $("#" + contanerCate + "regeditPassword");
	var pwd = $("#" + contanerCate + "regeditPassword").val();
	if(pwd == ""){
		showErrorBox(elem,true);
		$(obj).removeClass("correct");
		$("#" + contanerCate + "errorpwd").html("密码不能为空");
		$("#" + contanerCate + "pwdtdid").css('display', 'block');
	}else if(!re.test(pwd)) {
		showErrorBox(elem,true);
		$(obj).removeClass("correct");
		$("#" + contanerCate + "errorpwd").html("密码格式不正确");
		$("#" + contanerCate + "pwdtdid").css('display', 'block');	
	} else {
		showErrorBox(elem,false);
		$(obj).addClass("correct");
		$("#" + contanerCate + "pwdtdid").hide();
		pwStrength(pwd);
		$("#" + contanerCate + "pwdtdStrId").css('display', 'block');
		$("#" + contanerCate + "pwdtdStrId").parent().show();
		$("#" + contanerCate + "serviceErrorId").hide();
		if(jQuery("#" + contanerCate + "regPwdAgin").val() != ""){
			checkPwdAgin(jQuery("#" + contanerCate + "regPwdAgin"));
		}
		serviceCheck();
	}
}

function checkPwdAgin(obj) {
	var topVal;
	window.Reg.clearTips(obj);
	var elem = $("#" + contanerCate + "regPwdAgin");
	var pwdOne = $("#" + contanerCate + "regeditPassword").val();
	var pwd = $("#" + contanerCate + "regPwdAgin").val();
	var b = false;
	if (pwdOne != pwd) {
		showErrorBox(elem,true);
		$(obj).removeClass("correct");
		if($("#" + contanerCate + "pwdtdStrId").parent().is(":hidden")){
			topVal = !window.Reg.isComReg() ? 194 : 244 + "px";
		}else{
			topVal = !window.Reg.isComReg() ? 244 : 294 + "px";
		}
		$("#" + contanerCate + "pwdagintdid").find(".m-prompt").css('top',topVal);
		$("#" + contanerCate + "errorpwdAgin").html("两次密码输入不一致");
		$("#" + contanerCate + "pwdagintdid").css('display', 'block');
	} else if(pwdOne != ""){
		showErrorBox(elem,false);
		$(obj).addClass("correct");
		$("#" + contanerCate + "pwdagintdid").hide();
		b = true;
	}
	return b;
}

function checkValidCode(obj){
	var elem = $("#" + contanerCate + "validationCode");
	var validCode = $("#" + contanerCate + "validationCode").val();
	var reOne = /^[0-9]{6}$/;
	var flag = false;
	if(validCode == ""){
		showErrorBox(elem, true);
		$("#" + contanerCate + "spanAuthcodeId").html("请输入验证码");
		$("#" + contanerCate + "authcodeid").css('display', 'block');
	}else if(!reOne.test(validCode)){
		showErrorBox(elem, true);
		$("#" + contanerCate + "spanAuthcodeId").html("验证码格式不正确");
		$("#" + contanerCate + "authcodeid").show();
	}else {
		showErrorBox(elem, false);
		$(obj).addClass("correct");
		$("#" + contanerCate + "authcodeid").hide();
		flag = true;
	}
	return flag;
}

function checkValidCodeNum(obj){
	var validCode = $("#" + contanerCate + "validationCode").val();
	var phoneNum = $("#" + contanerCate + "phoneNumeber").val();
	var uuid = jQuery("#uuid").val();
	var flag = false;
	$.ajax({
		async : false,
		type : 'post',
		url : "/regedit/validate/" + phoneNum + "?uuid=" + uuid + "&token=" + validCode,
		success : function(data) {
			if (data) {
				flag = true;
			} else {
				$("#" + contanerCate + "spanAuthcodeId").html("验证码错误,请输入正确验证码");
				$("#" + contanerCate + "authcodeid").show();
			}
		},
		error : function() {
			$("#" + contanerCate + "spanAuthcodeId").html("验证码验证超时");
			$("#" + contanerCate + "authcodeid").show();
		}
	});
	return flag;
}

function checkAccount(obj) {
	var account = $("#" + contanerCate + "regeditAccountName").val();
	var reOne = /^[0-9]{6,20}$/;
	var re = /^([a-zA-Z0-9-_]|[\u4E00-\u9FA5]){4,20}$/;
	if(account == ""){
		$(obj).removeClass("correct");
		$("#" + contanerCate + "spanAccountId").html("请输入用户名");
		$("#" + contanerCate + "accounttdid").css('display', 'block');
	}else if(reOne.test(account)) {
		$(obj).removeClass("correct");
		$("#" + contanerCate + "spanAccountId").html("用户名格式不正确");
		$("#" + contanerCate + "accounttdid").css('display', 'block');
	}else if(!re.test(account)) {
		$(obj).removeClass("correct");
		$("#" + contanerCate + "spanAccountId").html("用户名格式不正确");
		$("#" + contanerCate + "accounttdid").css('display', 'block');
	}else if(account != oldAccountName){
		var data = {
			account : account
		};
		$.ajax({
			type : 'post',
			url : "/regedit/checkAccount",
			data : data,
			success : function(data) {
				if (data) {
					$(obj).addClass("correct");
					$("#" + contanerCate + "accounttdid").hide();
				} else {
					$(obj).removeClass("correct");
					window.Reg.clearTips(obj);
					if($("#regisPnrId").val()=="true"){
						$("#" + contanerCate + "spanAccountId").html("该用户已注册,立即 <i><a style='color:#c00300;' href='https://passport.nong12.com/uc/login.aspx'>登录</a></i> 或  <i><a style='color:blue;' href='https://passport.nong12.com/forgot/forgot.aspx'>找回密码</a></i>");
					}else{
						$("#" + contanerCate + "spanAccountId").html("该用户已注册,立即 <i><a style='color:#c00300;' href='https://passport.dilisx.com/uc/login.aspx'>登录</a></i> 或  <i><a style='color:blue;' href='https://passport.dilisx.com/forgot/forgot.aspx'>找回密码</a></i>");
					}
					$("#" + contanerCate + "accounttdid").css('display', 'block');
				}
			},
			error : function() {
				$(obj).removeClass("correct");
				window.Reg.clearTips(obj);
				$("#" + contanerCate + "spanAccountId").html("验证用户名超时");
				$("#" + contanerCate + "accounttdid").css('display', 'block');
			}
		});
	}
	oldAccountName = account;
	if(!$(obj).hasClass("correct")){
		window.Reg.clearTips(obj);
	}
}

function serviceCheck(){
	var topVal;
	if($("#" + contanerCate + "serviceCheckId").attr('checked')){
		$("#" + contanerCate + "serviceErrorId").hide();
		return true;
	}else{
		if($("#" + contanerCate + "pwdtdStrId").parent().is(":hidden")){
			topVal = !window.Reg.isComReg() ? 234 : 284 + "px";
		}else{
			topVal = !window.Reg.isComReg() ? 285 : 334 + "px";
		}
		$("#" + contanerCate + "serviceErrorId").find(".m-prompt").css('top',topVal);
		$("#" + contanerCate + "serviceErrorId").css('display','block');
		return false;
	}
}

function executeReg(){
	var inputObj = "input[name='mobileValidationCode']";
	$("#" + contanerCate + "regForm").find(inputObj).val($("#" + contanerCate + "validationCode").val());
	$("#" + contanerCate + "regForm").submit();
	$(".atnow").unbind("click");
}

function MobileConfirm(obj){
	var limit = window.Reg.isComReg() ? 4 : 4;
	checkSubmit();
	if($(".f-prompt:visible").length > 0){
		return ;
	}
	if(serviceCheck() && $(".correct:visible").length == limit){
		if(window.Reg.isComReg()){
			$("#qyregForm").submit();
		}else {
			$("#regForm").submit();
		}
	}
}

function checkSubmit() {
	checkPhoneNumber();
//	checkAccount();
	checkPwd();
	checkValidCode();
	checkValidCodeNum();
	if (window.Reg.isComReg()) {
		checkCom();
	}
}

function countDown(){
	var time = $("#countDownSec").text();
	var btn = $("#" + contanerCate + "sendSMSBtn");
	$("#countDownSec").text(time - 1);
	sec += 1;
	if (sec == smsExpireTime) {
		countDownIntervalInt = window.clearInterval(countDownIntervalInt);
		sec = 0;
		$(btn).removeClass("waiting");
		$(btn).addClass("btn-big-w");
		$(btn).html("重新发送验证码");
	} else if(countDownStop) {
		countDownIntervalInt = window.clearInterval(countDownIntervalInt);
		sec = 0;
	}
}

function reSendSMS(){
	checkPhoneNumber();
	var phoneNumber = jQuery("input[name='regeditPhoneNumber']:visible").val();
	var regPartton = /^1(3[0-9]|5[0-3]|45|47|5[5-9]|8[0-9]|70|7[6-8])\d{8}$/;
	if(phoneNumber == ""){
		return ;
	}else if (!regPartton.test(phoneNumber)) {
		return ;
	}
	var elem = $("#" + contanerCate + "phonetdid");
	if(!$(elem).is(':hidden')){
		return ;
	}
	var btn = $("#" + contanerCate + "sendSMSBtn");
	if($(btn).hasClass("waiting")){
		return ;
	}
	var uuid = jQuery("#uuid").val();
	var url = location.protocol + "//" + location.hostname + "/regedit/sendSMS/" + phoneNumber + "?uuid=" + uuid + "&yys=" + new Date().getTime();
	$.get(url, function(result){
		if(result){
		}
	});
	$(btn).addClass("waiting");
	$(btn).removeClass("btn-big-w");
	$(btn).html("<b>"+(smsExpireTime)+"</b>秒后重新发送");
	var _sec = 0;
	var totalSec = smsExpireTime;
//	countDownIntervalInt = setInterval(countDown, 1000);
	var countDownIntervalInt = setInterval(function (){
		$(btn).find('b').html(totalSec - _sec);
		if(_sec >= totalSec){
			countDownIntervalInt = window.clearInterval(countDownIntervalInt);
			_sec = 0;
			$(btn).removeClass("waiting");
			$(btn).addClass("btn-big-w");
			$(btn).html("重新发送验证码");
		}
		_sec ++;
	}, 1000);
}

function CharMode(iN) {
	if (iN >= 48 && iN <= 57) // 数字
		return 1;
	if (iN >= 65 && iN <= 90) // 大写字母
		return 2;
	if (iN >= 97 && iN <= 122) // 小写
		return 4;
	else
		return 8; // 特殊字符
}
// bitTotal函数
// 计算出当前密码当中一共有多少种模式
function bitTotal(num) {
	modes = 0;
	for (var i = 0; i < 4; i++) {
		if (num & 1)
			modes++;
		num >>>= 1;
	}
	return modes;
}
// checkStrong函数
// 返回密码的强度级别
function checkStrong(sPW) {
	Modes = 0; // 输入的字符种类有几种如:a1两种aA_d三种
	for (var i = 0; i < sPW.length; i++) {
		// 测试每一个字符的类别并统计一共有多少种模式.
		Modes |= CharMode(sPW.charCodeAt(i));
	}
	Modes = bitTotal(Modes); // 由几种字符组成
	var pwdLength = sPW.length; // 密码长度
	var level = 0; // 密码强度级别
	if (pwdLength < 8 && Modes <= 2)
		level = 0;
	if ((pwdLength < 10 && Modes >= 3) || (pwdLength >= 8 && Modes == 2))
		level = 1;
	if (pwdLength >= 10 && Modes >= 3)
		level = 2;
	return level;
}
// pwStrength函数
// 根据pwd强度改变css样式
function pwStrength(pwd) {
	var $pwdStrength = $("#" + contanerCate + "pwdtdStrId");
	if (pwd == null || pwd == '') {
		Lcolor = Mcolor = Hcolor = O_color;
	} else {
		// $strength_L.removeClass("security3");
		// $strength_L.removeClass("security2");
		// $strength_L.removeClass("security1");
		var levelHTML = "";
		S_level = checkStrong(pwd);
		switch (S_level) {

		case 0: // 低
			levelHTML += '<div class="worse"></div><div></div><div></div>';
			break;
		case 1: // 中
			levelHTML += '<div class="notbad"></div><div class="notbad"></div><div></div>';
			break;
		case 2: // 高
			levelHTML += '<div class="great"></div><div class="great"></div><div class="great"></div>';
			break;
		default:
			levelHTML += '<div class="worse"></div><div></div><div></div>';
			break;
		}
		$($pwdStrength).html("");
		$($pwdStrength).append(levelHTML);
	}
	return;
}

function changeType(value){
	$("#businessTypeId").val(value);
}
function chageSex(value){
	$("#sexid").val(value);
}
var validateRegExp = {
    chinese: "^[\\u4e00-\\u9fa5]+$", //仅中文
    date: "^\\d{4}(\\-|\\/|\.)\\d{1,2}\\1\\d{1,2}$", //日期
    email: "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$", //邮件
    letter: "^[A-Za-z]+$", //字母
    letter_l: "^[a-z]+$", //小写字母
    letter_u: "^[A-Z]+$", //大写字母
    mobile: "^0?(13|15|18|14|17|19)[0-9]{9}$", //手机
    notempty: "^\\S+$", //非空
    password: "^.*[A-Za-z0-9\\w_-]+.*$", //密码
    fullNumber: "^[0-9]+$", //数字
    tel: /^[0-9\-()();;,,]{7,18}$/, //电话号码的函数(包括验证国内区号,国际区号,分机号)
    url: "^http[s]?:\\/\\/([\\w-]+\\.)+[\\w-]+([\\w-./?%&=]*)?$", //url
    username: "^[A-Za-z0-9_\\-\\u4e00-\\u9fa5]+$", //用户名
    authcode: "^[a-zA-Z0-9]{4,4}$", //验证码
    realName: /^[A-Za-z0-9\\u4e00-\\u9fa5]{2,10}$/,
    address:  "^.{0,50}$",
    companyName: "^[\u4E00-\u9FA5]{4,50}$",
    deptName: "^[\u4E00-\u9FA5]{2,10}$"
};

function checkExtAddressInfo(obj){
	var val = $.trim($(obj).val());
	var error = $(obj).parent().siblings(".f-column-h").find(".f-prompt");
	if(val != "" && (val.length > 50 || window.Reg.xssFilter(val))){
		$(error).show();
		$(obj).attr("val",0);
		$(obj).addClass("correct");
	}else if(val != ""){
		$(error).hide();
	}else{
		window.Reg.hideExtError(obj);
		$(obj).removeClass("correct");
	}
}

function checkExtAccountInfo(obj){
	var val = $.trim($(obj).val());
	if(val != '' && validateRegExp.realName.test(val)){
		window.Reg.showExtError(obj);
		$(obj).attr("val",0);
	}else if(val != ""){
		window.Reg.hideExtError(obj);
	}else{
		window.Reg.hideExtError(obj);
		$(obj).removeClass("correct");
	}
}
function checkExtMobileInfo(obj){
	var val = $.trim($(obj).val());
	if (val != "" && !validateRegExp.tel.test(val)) {
		window.Reg.showExtError(obj);
		$(obj).attr("val",0);
	}else if(val != ""){
		window.Reg.hideExtError(obj);
	}else{
		window.Reg.hideExtError(obj);
		$(obj).removeClass("correct");
	}
}
function checkExtCompanyInfo(obj){
	var val = $.trim($(obj).val());
	if(val != "" && !new RegExp(validateRegExp.companyName).test(val)){
		window.Reg.showExtError(obj);
		$(obj).attr("val",0);
	}else if(val != ""){
		window.Reg.hideExtError(obj);
	}else{
		window.Reg.hideExtError(obj);
		$(obj).removeClass("correct");
	}
}
function checkExtDeptInfo(obj){
	var val = $.trim($(obj).val());
	if(val != "" && !new RegExp(validateRegExp.deptName).test(val)){
		window.Reg.showExtError(obj);
		$(obj).attr("val",0);
	}else if(val != ""){
		window.Reg.hideExtError(obj);
	}else{
		window.Reg.hideExtError(obj);
		$(obj).removeClass("correct");
	}
}
function checkExtOcpInfo(obj){
	var val = $.trim($(obj).val());
	if(val != "" && !new RegExp(validateRegExp.deptName).test(val)){
		window.Reg.showExtError(obj);
		$(obj).attr("val",0);
	}else if(val != ""){
		window.Reg.hideExtError(obj);
	}else{
		window.Reg.hideExtError(obj);
		$(obj).removeClass("correct");
	}
}
function saveInfo(obj){
	$("#cityAddId").val("");
	$("#cityAddId").val($("#address_county").val());
	if($("#address_county").val()==""){
		$("#cityAddId").val($("#address_city").val());
	}
	if($("#address_city").val()==""){
		$("#cityAddId").val($("#address_province").val());
	}
	$("#infoFormId").submit();
}
function qysaveInfo(obj){
	$("#qycityAddId").val("");
	$("#qycityAddId").val($("#address_county").val());
	if($("#address_county").val()==""){
		$("#qycityAddId").val($("#address_city").val());
	}
	if($("#address_city").val()==""){
		$("#qycityAddId").val($("#address_province").val());
	}
	$("#completeCompanyFormId").submit();
}
function formCheck(obj){
	var inputObjs = $(obj).find("input");
	var b = true;
	jQuery.each(inputObjs,function(i,n){
		if(typeof $(n).attr("val") != 'undefined' && $(n).attr("val") == 0 ){
			b = false;
			return;
		} 
	});
	return b;
}
jQuery(function(){
	$(".rt-tab-more a").click(function(){
		window.location = window.DiliPath.loginPath + location.search;
	});
});

function showProtocol(){
	
	var protocol = '<br ><iframe src="https://passport.nong12.com/agreement/index.html" vspace="0" hspace="0" allowtransparency="true" scrolling="yes" marginwidth="0" marginheight="0" frameborder="0" ></iframe>'; 
	
	Popup.start({
		title   : '《农丰网批发用户协议》',
		content : protocol,
		width:890,
		height:570,
		time:1000,//延迟时间
		saveclick:true,//是否点击确定
		cancelclick:false,//是否点击取消
		saveFun:function(data){
		},
		verification:true,//点击确定是否删除弹框
		hidefooterBar:true,
		hideheaderBar:false,
		btns : ['确定'],
	});

}