/**
 * 工程位置：一大把网站改版2.0->会员前台
 * 开发时间：2008-3-7
 * 开发人员：会员体系组->莫炎
 * 
 * 页面名称：JS输入验证
 * 代码功能：验证输入内容合法性的JS脚本
 * 
 * 修改记录：
 * 
 * 包含文件：包含此文件时需同时包含prototype.js以做支持
 * 
 */

//表单验证标志
var result = Array(23);
var tmpVar = 0;

/*****************************************************
 * @desc 		字符串去空格
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String str 被处理的字符串
 * @return 		String
 * */
function Trim(str) 
{
	return str.replace(/(^\s*)|(\s*$)/g, ""); 
}

function filter(obj)
{
	str = $F(obj);
	str = str.replace(/(")/g,"");
	str = str.replace(/(')/g,"");
	$(obj).value = str;
	return str;
}

function checkblack(bbb){
	var m=filterwords.length;
	for(ii=0;ii<m;ii++){
		if(bbb.match(filterwords[ii]) != null){
			return true;
		}
	}
	return false;
}

/*****************************************************
 * @desc 		用户名验证(邮箱格式验证)
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkEmail()
{
	var emailStr=Trim($F("GRZLusername"));
	var emailPat=/^((\w+([-+.]\w+)*))@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
	var matchArray=emailStr.match(emailPat);
	$("userid").className='gfocus';
	var emailcom = emailStr.split("@");
	if (emailStr.length == 0 || emailStr=="请输入您的邮箱")
	{
		var strtemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 此项为必填项。</div>";
		$("useridclew").innerHTML = strtemp;
		result[0] = true;
	}
	else if (emailcom[1]=="yidaba.com")
	{
		var strtemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 如果您已经开通了大把邮,请尝试登陆。</div>";
		$("useridclew").innerHTML = strtemp;
		result[0] = true;
	}
	else if (matchArray==null)
	{
		var strtemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 邮箱格式错误,请输入正确的邮箱。</div>";
		$("useridclew").innerHTML = strtemp;
		result[0] = true;
	}
	else
	{
		//Ajax检查邮箱
		var url = "ajaxcheck.php";
		var pars = "";
		pars = "para=" + emailStr + "&f=username";
		var myAjax_1 = new Ajax.Request(url,
			{
				method: 'get',
				parameters: pars,
				onComplete: responseUsername
			});
	}
	//alert("调试邮箱验证结果"+result[0]);
}

/*****************************************************
 * @desc 		邮箱格式验证
 * @author 		wangyihua@ceopen.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkEmailNo()
{
	var fffff = document.getElementById("mailMark").value;
	var emailStr=Trim(fffff);
	var emailPat=/^((\w+([-+.]\w+)*))@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
	var matchArray=emailStr.match(emailPat);
	document.getElementById('mailShow').style.display='';
	document.getElementById("mailMarkLa").className='point';
	var emailcom = emailStr.split("@");
	if (emailStr.length == 0)
	{
		var strtemp = '<img src="images/gerror_03.gif" alt="" /> 请输入您的常用邮箱。';
		document.getElementById("mailShow").innerHTML = strtemp;
		result[30] = true;
	}
	else if (emailcom[1]=="yidaba.com")
	{
		var strtemp = "<img src='images/gerror_03.gif' alt='' /> 如果您已经开通了大把邮,请尝试登陆。";
		document.getElementById("mailShow").innerHTML = strtemp;
		result[30] = true;
	}
	else if (matchArray==null)
	{
		var strtemp = '<img src="images/gerror_03.gif" alt="" /> 邮箱格式错误,请输入正确的邮箱。';
		document.getElementById("mailShow").innerHTML = strtemp;
		result[30] = true;
	}
	else
	{
		document.getElementById("mailMarkLa").className='';
		var strtemp = '';
		document.getElementById('mailShow').style.display='none';
		document.getElementById("mailShow").innerHTML = strtemp;
		result[30] = false;
		
	}
	//alert("调试邮箱验证结果"+result[0]);
}

/*****************************************************
 * @desc 		用户名验证(vip邮箱格式验证)
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkvipname()
{
	var emailStr=Trim($F("GRZLvipname"));
	var emailPat=/^[a-z0-9][._-]{0,1}([a-z0-9]+[._-]{0,1})*[a-z0-9]+$/i;
	pass = true;
	var emailtemp = emailStr.toLowerCase();
	if (emailtemp.indexOf('yidaba') != -1)
	{
		pass = false;
	}
	var matchArray=emailStr.match(emailPat);
	$("vipmailTr").className='gfocus';
	if (emailStr.length == 0 || emailStr=="请输入您的邮箱")
	{
		var strtemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 请输入邮箱！</div>";
		$("vipmailTrcue").innerHTML = strtemp;
		result[0] = true;
	}
	else if (matchArray==null)
	{
		var strtemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 邮箱格式错误,请输入正确的邮箱。</div>";
		$("vipmailTrcue").innerHTML = strtemp;
		result[0] = true;
	}
	else if (emailStr.length < 6 || emailStr.length > 32)
	{
		var strtemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 长度在6到32个字符，英文字母、符号或数字都可以。</div>";
		$("vipmailTrcue").innerHTML = strtemp;
		result[0] = true;
	}
	else if (pass == false)
	{
		var strtemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您的邮箱已经存在，请重新输入！</div>";
		$("vipmailTrcue").innerHTML = strtemp;
		result[0] = true;
	}
	else
	{
		//Ajax检查邮箱
		var url = "ajaxcheck.php";
		var pars = "";
		pars = "para=" + emailStr + "&f=vipname";
		var myAjax_1 = new Ajax.Request(url,
			{
				method: 'get',
				parameters: pars,
				onComplete: responseVipname
			});
	}
	//alert("调试邮箱验证结果"+result[0]);
}

/*****************************************************
 * @desc 		接收用户名验证返回值(邮箱格式验证)
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String ajaxObject ajax对象
 * @return 		boolean
 * */
function responseVipname(ajaxObject) 
{
	var resValue = ajaxObject.responseText;
	if (resValue == 1) 
	{
		$("vipmailTr").className='gfocub';
		$("vipmailTrcue").className='gfocub';
		disHTML = "";	
		result[0] = false;
	}
	else 
	{
		disHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您的邮箱已经存在，请重新输入！</div>";
		result[0] = true;
	}
	$("vipmailTrcue").innerHTML = disHTML;
}

/*****************************************************
 * @desc 		接收用户名验证返回值(邮箱格式验证)
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String ajaxObject ajax对象
 * @return 		boolean
 * */
function responseUsername(ajaxObject) 
{
	var resValue = ajaxObject.responseText;
	if (resValue == 0) 
	{
		$("userid").className='gfocub';
		$("useridclew").className='gfocub';
		disHTML = "";	
		result[0] = false;
	}
	else 
	{
		disHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您的邮箱已经存在，请重新输入!</div>";
		result[0] = true;
	}
	$("useridclew").innerHTML = disHTML;
}

/*****************************************************
 * @desc 		用户名验证(vip邮箱格式验证,开通专用)
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkaddvip()
{
	var emailStr=Trim($F("GRZLvipname"));
	var emailPat=/^((\w+([-+.]\w+)*))$/;
	var matchArray=emailStr.match(emailPat);
	pass = true;
	var emailtemp = emailStr.toLowerCase();
	if (emailtemp.indexOf('yidaba') != -1)
	{
		pass = false;
	}
	if (emailStr.length == 0 || emailStr=="请输入您的邮箱")
	{
		var strtemp = "请输入邮箱！";
		$("vipmailTrcue").innerHTML = strtemp;
		result[0] = true;
	}
	else if (matchArray==null)
	{
		var strtemp = "邮箱格式错误,请输入正确的邮箱。";
		$("vipmailTrcue").innerHTML = strtemp;
		result[0] = true;
	}
	else if (emailStr.length < 6 || emailStr.length > 32)
	{
		var strtemp = "长度在6到32个字符，英文字母、符号或数字都可以。";
		$("vipmailTrcue").innerHTML = strtemp;
		result[0] = true;
	}
	else if (pass == false)
	{
		var strtemp = "您的邮箱已经存在，请重新输入！";
		$("vipmailTrcue").innerHTML = strtemp;
		result[0] = true;
	}
	else
	{
		//Ajax检查邮箱
		var url = "ajaxcheck.php";
		var pars = "";
		pars = "para=" + emailStr + "&f=vipname";
		var myAjax_1 = new Ajax.Request(url,
			{
				method: 'get',
				parameters: pars,
				onComplete: responseaddVip
			});
	}
	//alert("调试邮箱验证结果"+result[0]);
}

/*****************************************************
 * @desc 		接收用户名验证返回值(邮箱格式验证)
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String ajaxObject ajax对象
 * @return 		boolean
 * */
function responseaddVip(ajaxObject) 
{
	var resValue = ajaxObject.responseText;
	if (resValue == 1) 
	{
		disHTML = "";	
		result[0] = false;
	}
	else 
	{
		disHTML = "您的邮箱已经存在，请重新输入！";
		result[0] = true;
	}
	$("vipmailTrcue").innerHTML = disHTML;
}

/*****************************************************
 * @desc 		接收用户名验证返回值(邮箱格式验证)
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String ajaxObject ajax对象
 * @return 		boolean
 * */
function responseUsername(ajaxObject) 
{
	var resValue = ajaxObject.responseText;
	if (resValue == 0) 
	{
		$("userid").className='gfocub';
		$("useridclew").className='gfocub';
		disHTML = "";	
		result[0] = false;
	}
	else 
	{
		disHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您的邮箱已经存在，请重新输入!</div>";
		result[0] = true;
	}
	$("useridclew").innerHTML = disHTML;
}

/*****************************************************
 * @desc 		修改邮箱验证
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String value 被处理的字符串
 * @return 		boolean
 * */
function checkEmailMod(value)
{
	var emailStr=value;
	var emailPat=/^((\w+([-+.]\w+)*))@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
	var matchArray=emailStr.match(emailPat);
	if (emailStr.length == 0) {
		var strtemp = '邮箱地址不能为空!';
		document.getElementById('info').innerHTML = strtemp;
		result[0] = true;
	} else if (matchArray==null) {
		var strtemp = "请输入正确格式的邮箱地址!</div>";
		document.getElementById('info').innerHTML = strtemp;
		result[0] = true;
	} 
	else 
	{ 
		//调用Ajax检查邮箱
		var url = "ajaxcheck.php";
		var pars = "";
		pars = "para=" + emailStr + "&f=username";
		var myAjax_1 = new Ajax.Request(
			url,
			{
				method: 'get',
				parameters: pars,
				onComplete: responseUsernameMod
			 });
	}
}

/*****************************************************
 * @desc 		接收修改邮箱验证返回值(邮箱格式验证)
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String ajaxObject ajax对象
 * @return 		boolean
 * */
function responseUsernameMod(ajaxObject) 
{
	var resValue = ajaxObject.responseText;
	if (resValue == 0) 
	{
		var strtemp = '';
		document.getElementById('info').innerHTML = strtemp;
		document.getElementById('modusr').action="username.php";
		document.getElementById('modusr').submit();
	}
	else 
	{
		var strtemp = '您输入的邮箱地址已经注册过！尝试<span class="blue"><a href="login.php" target="_blank">登录</a></span>';
		document.getElementById('info').innerHTML = strtemp;
		result[0] = true;
	}
}

/*****************************************************
 * @desc 		确认用户名验证
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkMailAffirm() 
{
	var getValue1 = $F("GRZLusername");
	var getValue2 = $F("GRZLusername1");
	var patt = /^\s*$/; 
	var dispStr = "";
	$("useridclew2Tr").className='gfocus';
	getValue1 = getValue1.replace(patt, "");
	getvalue2 = getValue2.replace(patt, "");
	if (getValue2.length == 0)
	{
		dispStr	= "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 此项为必填项。</div>";
		result[24] = true;
	}
	else if (getValue2 != getValue1) 
	{
		dispStr = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您两次输入的Email地址不一致，请重新输入。</div>";
		result[24] = true;
	} 
	else 
	{
		$("useridclew2Tr").className='gfocub';
		dispStr = "";
		result[24] = false;
	}
	$("useridclew2").innerHTML = dispStr;
}

/*****************************************************
 * @desc 		昵称合法性验证
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkNick() 
{
	var getValue = Trim($F("GRZLnickname"));
	var patt = /^[\w\u4E00-\u9FA5\uF900-\uFA2D]*$/;
	var dispStr;
	var temp="";
	var str = getValue;
	for (var i = 0; i < str.length; i++)
	{
		if (str.charCodeAt(i)==12288)
		{
			temp+= String.fromCharCode(str.charCodeAt(i)-12256);
			continue;
		}
		if (str.charCodeAt(i)>65280 && str.charCodeAt(i)<65375)
		{
			temp+= String.fromCharCode(str.charCodeAt(i)-65248);
		}
		else 
		{
			temp+= String.fromCharCode(str.charCodeAt(i));
		}
	}
	document.getElementById("GRZLnickname").value = temp;
	getValue = temp;
	if (getValue.length == 0) 
	{
		dispStr = "<img src='images/gerror_03.gif' width='14' height='14' /> 此项为必填项。";
		$("txtnicknameTr").className='gfocus';
		$("txtnickname").innerHTML = dispStr;
		result[1] = true;
	}
	else if (!patt.test(getValue) || getValue.length < 2 || getValue.length > 40) 
	{
		$("txtnicknameTr").className='gfocus';
		dispStr = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 输入错误，请重新输入。</div>";
		$("txtnickname").innerHTML = dispStr;
		result[1] = true;
	}
	else
	{
		//AJAX检查昵称
		var url = "ajaxcheck.php";
		var pars = "";
			pars = "para=" + getValue + "&f=nickname";
			var myAjax_2 = new Ajax.Request(url, 
				{
					method: 'get',
					parameters: pars,
					onComplete: responseNick
				});
	}
}

/*****************************************************
 * @desc 		接收昵称验证返回值
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String ajaxObject ajax对象
 * @return 		boolean
 * */
function responseNick(ajaxObject) 
{
	var resValue = ajaxObject.responseText;
	$("txtnickname").innerHTML = "";
	if (resValue == 0)
	{
		$("txtnicknameTr").className='gfocub';
		disHTML = "";
		$("txtnickname").innerHTML = disHTML;
		$("nicknamecue").innerHTML = "";
		result[1] = false;
	}
	else 
	{
		disHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 该昵称已被使用，您可以使用以下建议昵称。</div>";
		result[1] = true;
		$("txtnickname").innerHTML = disHTML;
		nickinput=String(document.getElementById('GRZLnickname').value);
		if(nickinput.length > 30)
		{
			nickinput = nickinput.substr(0,30);
		}
		var now= new Date(); 
		var year=String(now.getYear()); 
		var month=now.getMonth()+1;
		if(month < 10)
		{
			month = "0"+String(month);
		}
		var date = year+month;
		var radiotmp = "";
		for(var i=0;i<5;i++)
		{
			rand = String(parseInt(Math.random()*898)+101);
			nickcue = nickinput + date + rand;
			radiotmp +="<input type='radio' name='radiobutton' value='" + nickcue + "' onclick='document.getElementById(\"GRZLnickname\").value=this.value;document.getElementById(\"GRZLnickname\").focus();'/>" + nickcue + "<br>";
		}
		$("nicknamecue").innerHTML = radiotmp;
	}
}

/*****************************************************
 * @desc 		密码合法性验证
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkPassword1() 
{
	result[2] = false;
	var getValue = Trim($F("GRZLpassword"));
	var dispStr = "";
	$("txtPwd1Tr").className='gfocus';
	if (getValue.length == 0) 
	{
		dispStr = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 此项为必填项。</div>";	
		result[2] = true;
	} 
	else if (getValue.length < 6 || getValue.length >20) 
	{
		dispStr = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 长度在6到20个字符，英文字母、符号或数字都可以。</div>";	
		result[2] = true;
	} 
	else 
	{
		for (var i=0; i<getValue.length; i++) 
		{
			var intCode = getValue.charCodeAt(i);
			if (intCode < 0 || intCode > 128 || intCode == 39) 
			{
				dispStr = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 长度在6到20个字符，英文字母、符号或数字都可以。</div>";	
				result[2] = true;
			}
		}
	}
	if (!result[2]) 
	{
		$("txtPwd1Tr").className='gfocub';
		result[2] = false;
	}
	$("txtPwd1").innerHTML = dispStr;
}

/*****************************************************
 * @desc 		确认密码验证
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkPassword2() 
{
	var getValue1 = $F("GRZLpassword");;
	var getValue2 = $F("GRZLpassword1");
	var patt = /^\s*$/; 
	var dispStr = "";
	$("txtPwd2Tr").className='gfocus';
	getValue1 = getValue1.replace(patt, "");
	getValue2 = getValue2.replace(patt, "");
	if (getValue2.length == 0) 
	{
		dispStr	= "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 此项为必填项。</div>";
		result[3] = true;
	} 
	else if (getValue2 != getValue1) 
	{
		dispStr = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您两次输入的密码不一致，请重新输入。</div>";
		result[3] = true;
	} 
	else 
	{
		$("txtPwd2Tr").className='gfocub';
		dispStr = "";	
		result[3] = false;
	}
	$("txtPwd2").innerHTML = dispStr;
}

/*****************************************************
 * @desc 		密码合法性验证
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkVipPassword1() 
{
	result[2] = false;
	var getValue = Trim($F("GRZLpassword"));
	var dispStr = "";
	if (getValue.length == 0) 
	{
		dispStr = "此项为必填项。";	
		result[2] = true;
	} 
	else if (getValue.length < 6 || getValue.length >20) 
	{
		dispStr = "长度在6到16个字符，英文字母、符号或数字都可以。";	
		result[2] = true;
	} 
	else 
	{
		for (var i=0; i<getValue.length; i++) 
		{
			var intCode = getValue.charCodeAt(i);
			if (intCode < 0 || intCode > 128 || intCode == 39) 
			{
				dispStr = "长度在6到16个字符，英文字母、符号或数字都可以。";	
				result[2] = true;
			}
		}
	}
	if (!result[2]) 
	{
		result[2] = false;
	}
	$("txtPwd1").innerHTML = dispStr;
}

/*****************************************************
 * @desc 		确认密码验证
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkVipPassword2() 
{
	var getValue1 = $F("GRZLpassword");;
	var getValue2 = $F("GRZLpassword1");
	var patt = /^\s*$/; 
	var dispStr = "";
	getValue1 = getValue1.replace(patt, "");
	getValue2 = getValue2.replace(patt, "");
	if (getValue2.length == 0) 
	{
		dispStr	= "此项为必填项。";
		result[3] = true;
	} 
	else if (getValue2 != getValue1) 
	{
		dispStr = " 您两次输入的密码不一致，请重新输入。";
		result[3] = true;
	} 
	else 
	{
		dispStr = "";	
		result[3] = false;
	}
	$("txtPwd2").innerHTML = dispStr;
}

/*****************************************************
 * @desc 		确认验证码
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkValidatecode()
{
	var url = "ajaxcheck.php";
	var getValue = $F("num");
	var pars = "";
	pars = "para=" + getValue + "&f=validatecode";
	var myAjax = new Ajax.Request(
		url, 
		{
			method: 'get',
			parameters: pars,
			onComplete: responseValidate
		});
}

/*****************************************************
 * @desc 		接收确认验证码
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String ajaxObject AJAX对象
 * @return 		boolean
 * */
function responseValidate(ajaxObject)
{
	var resValue = ajaxObject.responseText;
	if (resValue == 0) 
	{
		$("valdatetr").className='gfocub';
		disHTML = "";	
		result[25] = false;
	}
	else 
	{
		disHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您输入的验证码不正确，请重新输入!</div>";
		document.getElementById("valdatetr").className='gfocus';
		result[25] = true;
	}
	$("valdate").innerHTML = disHTML;
}
/*****************************************************
 * @desc 		确认手机验证码
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkPhonecode()
{
	var getValue = $F("phoneKeyName");
	if (getValue.length == 0) 
	{
		$("phonekey").className='point';
		$('codeShow').style.display='';
		disHTML = '<img src="images/gerror_03.gif" alt="" /> 手机验证码不能为空!';
		$("codeShow").innerHTML = disHTML;
		result[26] = true;
	}
	else
	{
		var getValue = $F("phoneKeyName");
		var url = "ajaxcheck.php";
		var pars = "";
		pars = "para=" + getValue + "&f=phonecode";
		var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get',
				//asynchronous:false,
				parameters: pars,
				onComplete: responsePhone
			});
	} 
}

/*****************************************************
 * @desc 		接收确认验证码
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String ajaxObject AJAX对象
 * @return 		boolean
 * */
function responsePhone(ajaxObject)
{
	var resValue = ajaxObject.responseText;
	if (resValue == 0) 
	{
		$("phonekey").className='';
		$('codeShow').style.display='none';
		disHTML = "";	
		result[26] = false;
	}
	else 
	{
		$("phonekey").className='point';
		$('codeShow').style.display='';
		disHTML = '<img src="images/gerror_03.gif" alt="" /> 您输入的手机验证码不正确，请重新输入!';
		result[26] = true;
	}
	$("codeShow").innerHTML = disHTML;
}
/*****************************************************
 * @desc 		企业名称合法性验证
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkConame() 
{
	checkValidatecode1();
	var conameObj = Trim($F("QYZL_coname"));
	conameObj = filter('QYZL_coname');
	var strTemp = "";
	$("ting").className='gfocus';
	$("txtConame").className='gfocus';
	if (conameObj.length == 0) 
	{
		strTemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 此项为必填项。</div>";
		$("txtConame").innerHTML = strTemp;
		result[4] = true;
	} 
	else 
	{
		var totallength = 0;
		for (var i=0;i<conameObj.length;i++)
		{
			var intCode = conameObj.charCodeAt(i);
			if (intCode>=0 && intCode<=128) totallength = totallength + 1; //非中文单个字符长度加 1
			else totallength = totallength + 2; //中文字符长度则加 2
		}
		if(checkblack(conameObj)){
			strTemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您输入的内容中有系统禁止的关键词，请重新输入！</div>";
			$("txtConame").innerHTML = strTemp;
			result[4] = true;
		}else if (totallength <10 || totallength >150) 
		{
			strTemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 企业名称长度必须为10-150个字符!</div>";
			$("txtConame").innerHTML = strTemp;
			result[4] = true;
		}
		else
		{
			//AJAX检查企业名称
			var url = "ajaxcheck.php";
			var pars = "para=" + conameObj + "&f=coname";
			var myAjax = new Ajax.Request(url,
						{
							method: 'get',
							parameters: pars,
							onComplete: disposalConame
						});
		}
	}
}

/*****************************************************
 * @desc 		接收企业名称验证返回值
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String ajaxObject ajax对象
 * @return 		boolean
 * */
function disposalConame(ajaxObject) 
{
	var getValue = ajaxObject.responseText;
	var strTemp = "";
	$("txtConame").value = "";
	if (getValue == 0) 
	{
		$("ting").className='gfocub';
		$("txtConame").className='gfocub';
		strTemp = "";
		result[4] = false;
	} 
	else if (getValue == 1) 
	{
		strTemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 企业名称已经存在，请重新确认填写</div>";
		result[4] = true;
	}
	else
	{
		$("ting").className='gfocub';
		$("txtConame").className='gfocub';
	}
	$("txtConame").innerHTML = strTemp;
}

/*****************************************************
 * @desc 		验证详细地址
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkAddress() 
{
	var getValue = Trim($F("QYZL_address"));
	getValue = filter('QYZL_address');
	var strTemp = "";
	$("txtAddressTr").className='gfocus';
	$("txtAddress").className='gfocus';
	if (getValue.length == 0) {
		strTemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 此项为必填项。</div>";
		result[5] = true;
	}
	else if(checkblack(getValue)){
			strTemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您输入的内容中有系统禁止的关键词，请重新输入！</div>";
			$("txtAddress").innerHTML = strTemp;
			result[5] = true;
	}
	else 
	{
		$("txtAddressTr").className='gfocub';
		$("txtAddress").className='gfocub';
		result[5] = false;
	}
	$("txtAddress").innerHTML = strTemp;
}

/*****************************************************
 * @desc 		验证邮编
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkPostcode() 
{
	var getValue = Trim($F("QYZL_zipcode"));
	if(getValue.length == 0)
	{
		$("txtpostcodeTr").className='gfocus';
		$("txtpostcode").innerHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' />此项为必填项。</div>";
		result[6] = true;
		return;
	}
	if(getValue.length < 6 || getValue.length > 10)
	{
		$("txtpostcodeTr").className='gfocus';
		$("txtpostcode").innerHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' />不足六位，请填写规范的6位邮政编码 。</div>";
		result[6] = true;
		return;
	}
	if(isNumber(getValue) == false)
	{
		$("txtpostcodeTr").className='gfocus';
		$("txtpostcode").innerHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' />请填写规范的6位邮政编码 。</div>";
		result[6] = true;
		return;
	}
	$("txtpostcodeTr").className='gfocub';
	$("txtpostcode").innerHTML = "";
	result[6] = false;
	return;
}

/*****************************************************
 * @desc 		验证联系电话
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String ajaxObject ajax对象
 * @return 		boolean
 * */
function checkPhone() 
{
	var getValue1 = Trim($F("QYZL_areacode"));
	var getValue2 = Trim($F("QYZL_phone"));
	var getValue3 = Trim($F("QYZL_extension"));
	var getMun ="";
	if	(getValue3 == "分机号")
	{
		getValue3 = "";
		getMun = getValue1+"-"+getValue2;
	}
	else
	{
		getMun = getValue1+"-"+getValue2+"-"+getValue3;
	}
	$("txtphoneTr").className='gfocus';
	$("txtphone").className='gfocus';
	var pattern = /((^\+?(0?13\d))-?(\d{8})$)|(^((\+)?(0\d{1,3})-)?(\+)?(0\d{2,3})-(\d{7,8})|(\d{8})$)/g;
	var strTemp = "";
	$("txtphone").innerHTML = "";
	if (getValue1.length == 0 || getValue1 == "区号" || getValue2.length == 0 || getValue2 == "电话号码" ) 
	{
		strTemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 联系电话不能为空!</div>";
		result[7] = true;
	} 
	else if (!pattern.test(getMun)) 
	{
		strTemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 联系电话格式不正确!</div>";
		result[7] = true;
	} 
	else 
	{
		$("txtphoneTr").className='gfocub';
		$("txtphone").className='gfocub';
		strTemp = "";	
		result[7] = false;
	}
	$("txtphone").innerHTML = strTemp;
}

/*****************************************************
 * @desc 		验证经营范围
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkMainProd() 
{
	var obj = Trim($F("QYZL_workrange"));	
	obj = filter('QYZL_workrange');
	var length = 150;
	var theLen = 0;
    var teststr = '';
	if (obj.length == 0) 
	{
		$("txtMainProdTr").className='gfocus';
		$("txtMainProd").innerHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 此项为必填项。</div>";	
		result[10] = true;
	}else if(checkblack(obj)){
			strTemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您输入的内容中有系统禁止的关键词，请重新输入！</div>";
			$("txtMainProd").innerHTML = strTemp;
			result[10] = true;
	}
	else 
	{
		for(i=0;i<obj.length;i++)
	    {
	        teststr=obj.charAt(i);
	        if(obj.charCodeAt(i)>255)
	        theLen=theLen+1;
	        else
	        theLen=theLen+1;
	    }
	    if(theLen>length)
	    {
			$("txtMainProdTr").className='gfocus';
			$("txtMainProd").innerHTML="<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /></div>";
			result[10] = true;
			return;	
	    }
	    else
	    {
	        $("txtMainProdTr").className='gfocub';
			$("txtMainProd").innerHTML="";
			result[10] = false;
	    }
	}
}

/*****************************************************
 * @desc 		验证公司网址
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkCollection() 
{
	var obj = Trim($F("QYZL_website"));	
	obj = filter('QYZL_website');
	var pattern = /http:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?$/g;
	if (obj == "http://" || obj == "") {
		$("txtCollection").style.display = "none";
		result[12] = false;
	} else if (!pattern.test(obj)) {
		$("txtCollection").style.display = "";
		$("txtCollection").innerHTML = "<div class='STYLE2'>您填写的公司网址错误</div>";	
		result[12] = true;
	} else {
		$("txtCollection").style.display = "none";
		result[12] = false;
	}
}

/*****************************************************
 * @desc 		验证公司简介
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkIntroduce() 
{
	var str = "";
	var obj = Trim($F("QYZL_introduce"));
	obj = filter('QYZL_introduce');
	$("txtIntroduceTr").className='gfocus';
	$("txtIntroduce").className='gfocus';
	if (obj.length == 0) 
	{
		str = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 此项为必填项。</div>";
		result[13] = true;
	}else if(checkblack(obj)){
			str = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您输入的内容中有系统禁止的关键词，请重新输入！</div>";
			result[13] = true;
	}
	else if (obj.length < 50 || obj.length > 500) 
	{
		str = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 公司简介请填写50汉字至500汉字!</div>";
		result[13] = true;
	} 
	else 
	{
		$("txtIntroduceTr").className='gfocub';
		$("txtIntroduce").className='gfocub';
		str = "";
		result[13] = false;
	}
	$("txtIntroduce").innerHTML = str;
}

/*****************************************************
 * @desc 		验证联系人姓名
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkRealname() 
{
	var obj = Trim($F("QYZL_linkman"));
	var patt = /^[\w\u4E00-\u9FA5\uF900-\uFA2D]*$/;
	var disArea = $("txtRealname");
	var length = 50;
	var theLen = 0;
    var teststr = '';
	$("txtRealnameTr").className='gfocus';
	if (obj.length == 0) 
	{
		disArea.innerHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' />此项为必填项。</div>";	
		result[14] = true;
	}else if(checkblack(obj)){
			disArea.innerHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您输入的内容中有系统禁止的关键词，请重新输入！</div>";
			result[14] = true;
	}
	else
	{
	    for(i=0;i<obj.length;i++)
	    {
	        teststr=obj.charAt(i);
	        if(obj.charCodeAt(i)>255)
	        theLen=theLen+2;
	        else
	        theLen=theLen+1;
	    }
	    if(theLen>length)
	    {
			disArea.innerHTML="<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /></div>";
			result[14] = true;
			return;
	    }
	    else if (!patt.test(obj)) 
		{
			disArea.innerHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 联系人姓名格式不正确!</div>";	
				result[14] = true;
		}
		else 
		{
			$("txtRealnameTr").className='gfocub';
			disArea.innerHTML = "";
			result[14] = false;
		}
	}
}

/*****************************************************
 * @desc 		验证手机
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkMobile() 
{
	$("mobiletr").className='gfocus';
	$("txtMobile").className='gfocus';
	var obj = Trim($F("QYZL_mobile"));
	var disArea = $("txtMobile");
	if (obj.length == 0) 
	{
		disArea.innerHTML = "";
		$("mobiletr").className='gfocub';
		$("txtMobile").className='gfocub';
		result[16] = false;
	} 
	else if (isNumber(obj) == false || obj.length >20 ) 
	{
		disArea.innerHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' />手机电话格式不正确!</div>";
		result[16] = true;
	} 
	else 
	{
		disArea.innerHTML = ""; 
		$("mobiletr").className='gfocub';
		$("txtMobile").className='gfocub';
		result[16] = false;
	}
}
/*****************************************************
 * @desc 		验证基本注册大把邮开通手机
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkBasicMobile() 
{
	$("phoneLa").className='';
	var obj = Trim($F("phoneMark"));
	var disArea = $("phoneShow");
	if (obj.length == 0) 
	{
		disArea.innerHTML = "";
		$("phoneLa").className='point';
		$('phoneShow').style.display='';
		disArea.innerHTML = "<img src='images/gerror_03.gif' alt='' /> 手机不能为空!";
		result[31] = true;
	} 
	else if (isNumber(obj) == false || obj.length >20 ) 
	{
		$("phoneLa").className='point';
		$('phoneShow').style.display='';
		disArea.innerHTML = "<img src='images/gerror_03.gif' alt='' /> 手机电话格式不正确!";
		result[31] = true;
	} 
	else 
	{
		disArea.innerHTML = ""; 
		$('phoneShow').style.display='none';
		$("phoneLa").className='';
		result[31] = false;
	}
}
/*****************************************************
 * @desc 		验证手机(VIP邮箱用)
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkMobileVip() 
{
	$("mobiletr").className='gfocus';
	$("txtMobile").className='gfocus';
	var obj = Trim($F("phoneVip"));
	var disArea = $("txtMobile");
	if (obj.length == 0) 
	{
		disArea.innerHTML = "";
		$("mobiletr").className='gfocub';
		$("txtMobile").className='gfocub';
		result[8] = false;
	} 
	else if (isNumber(obj) == false || obj.length >20 ) 
	{
		disArea.innerHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' />手机电话格式不正确!</div>";
		result[8] = true;
	} 
	else 
	{
		disArea.innerHTML = ""; 
		$("mobiletr").className='gfocub';
		$("txtMobile").className='gfocub';
		result[8] = false;
	}
}
/*****************************************************
 * @desc 		验证传真
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkFax1() 
{
	var obj = Trim($F("QYZL_fax"));
	var obj2 = Trim($F("QYZL_fax1"));
	obj = checkchang(obj);
	obj2 = checkchang(obj2);
	if ((obj.length == 3 || obj.length == 4 || obj.length == 0) && (isNumber(obj) == true && isNumber(obj2) == true)) 
	{
		$("faxinfo").innerHTML = ""; 
		$("faxinfotr").className='gfocub';
		result[17] = false;
	} 
	else if(isNumber(obj) == false || isNumber(obj2) == false)
	{
		$("faxinfo").innerHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' />传真号码只能是数字。</div>";
		$("faxinfotr").className='gfocus';
		result[17] = true;
	}
	else
	{
		$("faxinfotr").className='gfocus';
		$("faxinfo").innerHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' />区号错误，电话号码只能是3-4位。</div>"; 
		result[17] = true;
	}
}

/*****************************************************
 * @desc 		验证企业所在地
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkNoSel1() 
{
	var getCountry = document.getElementById('s1').value;
	var getProvince = document.getElementById('s2').value;
	var getArea = document.getElementById('s3').value;
	$("txtAreaTr").className='gfocus';
	if (getCountry == "省/直辖市") 
	{
		result[19] = true;	
		$("txtArea").innerHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' />此项为必填项。</div>";
	} 
	else 
	{
		$("txtAreaTr").className='gfocub';
		$("txtArea").className='gfocub';
		result[19] = false;
		$("txtArea").innerHTML = "";	
	}
}

/*****************************************************
 * @desc 		验证所属行业
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkNoSel2() 
{
	var getFstindustry = $F("INDUSTRY_ID");
	if (getFstindustry == "") {
		$("txtIndustryTr").className='gfocus';
		$("txtIndustry").className='gfocus';
		result[20] = true;
		$("txtIndustry").innerHTML = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 此项为必填项。</div>";
	} else {
		$("txtIndustryTr").className='gfocub';
		$("txtIndustry").className='gfocub';
		result[20] = false;
		$("txtIndustry").innerHTML = "";
	}
}

/*****************************************************
 * @desc 		验证联系电话
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkPhone1()
{
	var getValue1 = Trim($F("QYZL_areacode"));
	var getValue2 = Trim($F("QYZL_phone"));
	var getValue3 = Trim($F("QYZL_extension"));
	getValue1 = checkchang(getValue1);
	getValue2 = checkchang(getValue2);
	getValue3 = checkchang(getValue3);
	if(getValue1.length == 0 || getValue2.length == 0)
	{
		$("txtphoneTr").className='gfocus';
		$("txtphone").innerHTML="<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 此项为必填项。</div>";
		result[7] = true;
		return;	
	}
	if(getValue1.length < 3 || getValue1.gength > 4 || isNumber(getValue1) == false)
	{
		$("txtphoneTr").className='gfocus';
		$("txtphone").innerHTML="<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 区号错误，区号只能是3到4位数字。</div>";
		result[7] = true;
		return;	
	}
	if(getValue2.length < 7 || getValue2.length > 8 || isNumber(getValue2) == false)
	{
		$("txtphoneTr").className='gfocus';
		$("txtphone").innerHTML="<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 电话号码错误，电话号码只能是7或8位数字。</div>";
		result[7] = true;
		return;	
	}
	if(getValue3.length > 8 || isNumber(getValue3) == false)
	{
		$("txtphoneTr").className='gfocus';
		$("txtphone").innerHTML="<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 分机错误，只能是8位以内数字。</div>";
		result[7] = true;
		return;	
	}
	$("txtphoneTr").className='gfocub';
	$("txtphone").innerHTML="";
	result[7] = false;
}

/*****************************************************
 * @desc 		验证备用电话1
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkPhone2()
{
	var getValue1 = Trim($F("QYZL_phone1"));
	var getValue2 = Trim($F("QYZL_extension1"));
	getValue1 = checkchang(getValue1);
	getValue2 = checkchang(getValue2);
	if((getValue1.length < 7 || getValue1.length > 8 || isNumber(getValue1) == false) && getValue1.length != 0)
	{
		$("byphone1tr").className='gfocus';
		$("byphone1").innerHTML="<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 电话号码错误，电话号码只能是7或8位数字。</div>";
		result[27] = true;
		return;	
	}
	if(getValue2.length > 8 || isNumber(getValue2) == false)
	{
		$("byphone1tr").className='gfocus';
		$("byphone1").innerHTML="<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 分机错误，只能是8位以内数字。</div>";
		result[27] = true;
		return;	
	}
	$("byphone1tr").className='gfocub';
	$("byphone1").innerHTML="";
	result[27] = false;
}

/*****************************************************
 * @desc 		验证备用电话2
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkPhone3()
{
	var getValue1 = Trim($F("QYZL_phone2"));
	var getValue2 = Trim($F("QYZL_extension2"));
	getValue1 = checkchang(getValue1);
	getValue2 = checkchang(getValue2);
	if((getValue1.length < 7 || getValue1.length > 8 || isNumber(getValue1) == false) && getValue1.length != 0)
	{
		$("byphone2tr").className='gfocus';
		$("byphone2").innerHTML="<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 电话号码错误，电话号码只能是7或8位数字。</div>";
		result[28] = true;
		return;	
	}
	if(getValue2.length > 8 || isNumber(getValue2) == false)
	{
		$("byphone2tr").className='gfocus';
		$("byphone2").innerHTML="<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 分机错误，只能是8位以内数字。</div>";
		result[28] = true;
		return;	
	}
	$("byphone2tr").className='gfocub';
	$("byphone2").innerHTML="";
	result[28] = false;
}

/*****************************************************
 * @desc 		验证法人代表负责人
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkstring()
{
	var str = $F("QYZL_corporation");
	str = filter('QYZL_corporation');
	var length = 20;
	var theLen = 0;
    var teststr = '';
	if(checkblack(str)){
		strTemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您输入的内容中有系统禁止的关键词，请重新输入！</div>";
		$("corporationinfoTR").className='gfocus';
		$("corporationinfo").innerHTML = strTemp;
		result[29] = true;
		return;
	}
    for(i=0;i<str.length;i++)
    {
        teststr=str.charAt(i);
        if(str.charCodeAt(i)>255)
        theLen=theLen+2;
        else
        theLen=theLen+1;
    }
    if(theLen>length)
    {
		$("corporationinfoTR").className='gfocus';
		$("corporationinfo").innerHTML="<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /></div>";
		result[29] = true;
		return;	
    }
    else
    {
        $("corporationinfoTR").className='gfocub';
		$("corporationinfo").innerHTML="";
		result[29] = false;
    }
}

/*****************************************************
 * @desc 		验证所在部门
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkszbm()
{
	var str = $F("QYZL_dep");
	str = filter('QYZL_dep');
	var length = 50;
	var theLen = 0;
    var teststr = '';
	if(checkblack(str)){
		strTemp = "<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /> 您输入的内容中有系统禁止的关键词，请重新输入！</div>";
		$("deptr").className='gfocus';
		$("dep").innerHTML = strTemp;
		result[30] = true;
		return;
	}
    for(i=0;i<str.length;i++)
    {
        teststr=str.charAt(i);
        if(str.charCodeAt(i)>255)
        theLen=theLen+2;
        else
        theLen=theLen+1;
    }
    if(theLen>length)
    {
		$("deptr").className='gfocus';
		$("dep").innerHTML="<div class='STYLE2'><img src='images/gerror_03.gif' width='14' height='14' /></div>";
		result[30] = true;
		return;	
    }
    else
    {
        $("deptr").className='gfocub';
		$("dep").innerHTML="";
		result[30] = false;
    }
}

/*****************************************************
 * @desc 		验证验证码（一次性注册用）
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkValidatecode1()
{
	var url = "ajaxcheck.php";
	var getValue = $F("num");
	var pars = "";
	pars = "para=" + getValue + "&f=validatecode";
	var myAjax = new Ajax.Request(
		url, 
		{
			method: 'get',
			parameters: pars,
			onComplete: responseValidate1
		});
}

/*****************************************************
 * @desc 		接收验证验证码（一次性注册用）
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String ajaxObject ajax对象
 * @return 		boolean
 * */
function responseValidate1(ajaxObject)
{
	var resValue = ajaxObject.responseText;
	if (resValue == 0) 
	{	
		result[25] = false;
	} 
	else 
	{
		result[25] = true;
	}
}

/*****************************************************
 * @desc 		AJAX验证行业周刊
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkHYZK()
{
	var value = $F("INDUSTRY_ID");
	var url = "ajaxcheck.php";
	var pars = "";
	pars = "para=" + value + "&f=hyzk";
		var myAjax_1 = new Ajax.Request(
			url,
			{
				method: 'get',
				parameters: pars,
				onComplete: responseHYZK
			 });
}

/*****************************************************
 * @desc 		接收AJAX验证行业周刊返回值
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @param 		String ajaxObject ajax对象
 * @return 		boolean
 * */
function responseHYZK(ajaxObject)
{
	var resValue = ajaxObject.responseText;
	if (resValue == '0') {
		$("QYZL_hyzk").checked=false;
		$("QYZL_hyzk").disabled=true;
		$("hyzk_iid").value='0';
	} else {
		$("QYZL_hyzk").checked=true;
		$("QYZL_hyzk").disabled=false;		
		$("hyzk_iid").value=resValue;
	}
}

/*****************************************************
 * @desc 		获取文本框中提示字符
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function changestr()
{
	$("QYZL_areacode").value = checkchang($F("QYZL_areacode"));
	$("QYZL_phone").value = checkchang($F("QYZL_phone")); 
	$("QYZL_extension").value = checkchang($F("QYZL_extension"));
	$("QYZL_phone1").value = checkchang($F("QYZL_phone1"));
	$("QYZL_extension1").value = checkchang($F("QYZL_extension1"));
	$("QYZL_phone2").value = checkchang($F("QYZL_phone2"));
	$("QYZL_extension2").value = checkchang($F("QYZL_extension2"));
	$("QYZL_website").value = checkchang($F("QYZL_website"));
	$("QYZL_fax").value = checkchang($F("QYZL_fax"));
	$("QYZL_fax1").value = checkchang($F("QYZL_fax1"));
}

/*****************************************************
 * @desc 		过滤文本框中提示字符
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkchang(str)
{
	if(str=="分机号" || str=="区号" || str =="电话号码" || str =="http://")
	{
		str="";
		return str;
	}
	else
	{
		return str;
	}
}

/*****************************************************
 * @desc 		判断是否为数字
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function isNumber(str)
{

	if(str=="")
	{
		return true; 
	}
	var reg = /\D/; 
	return str.match(reg)==null; 
}

/*****************************************************
 * @desc 		过滤判断结果如果有一个未通过就返回false
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function control1(num) 
{
	var act = 0;
	for (i = 0; i < num; i++) 
	{
		if(result[i] == true) 
		{
			act = 1;
		}
	}
	if(act == 1)
	{
		return true;
	}
	else
	{
		return false;
	}
}

/*****************************************************
 * @desc 		判断一次性注册
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkOneTime()
{
	var temp;
	checkEmail();
	checkMailAffirm();
	//checkNick();
	checkPassword1();
	checkPassword2();
	checkValidatecode();
	checkConame();
	checkAddress();
	checkPostcode();
	checkPhone1();
	checkPhone2();
	checkPhone3();
	checkMainProd();
	checkIntroduce();
	checkRealname();
	checkNoSel2();
	checkMobile();
	checkNoSel1();
	checkszbm();
	checkFax1();
		temp = control1(31);
		if (temp) 
		{ 
			alert("您填写的信息有误或没有填写必填项，请仔细检查!");
			return false;
		} 
		else 
		{
			return true;	
		}
}

/*****************************************************
 * @desc 		判断个人基本注册
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkLeaguer()
{
	//alert("进入了整体验证");
	var temp;
	checkEmail();
	checkMailAffirm();
	//checkNick();
	checkPassword1();
	checkPassword2();
	checkValidatecode();
	temp = control1(26);
	//alert("打印数组返回"+temp);
	var my_array= new Array(4);
	my_array[1] = result[0];
	my_array[2] = result[24];
	my_array[3] = false; //把昵称屏蔽没以后修改的，下面注释是没有屏蔽昵称的发放
	//my_array[3] = result[1];
	if (temp) 
	{
		my_array[0] = false;
		$("GRZLpassword").value = "";
		$("GRZLpassword1").value = "";
		alert("您填写的信息有误或没有填写必填项，请仔细检查!");
		return my_array;
	}
	else
	{
		my_array[0] = true;
		return my_array;
	}
}

/*****************************************************
 * @desc 		判断个人基本注册（vip邮箱用）
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkvipLeaguer()
{
	
	var temp;
	checkvipname();
	//checkNick();
	checkPassword1();
	checkPassword2();
	//checkValidatecode();
	if($('validateAct').value == "phone")
	{
		//alert("验证手机");
		result[30] = false;
		checkBasicMobile();
		checkPhonecode();
	}
	else if($('validateAct').value == "mail")
	{
		//alert("验证验证邮箱");
		result[26] = false;
		result[31] = false;
		checkEmailNo();
	}
	temp = control1(40);
	//console.log(temp);
	if (temp) 
	{
		$("GRZLpassword").value = "";
		$("GRZLpassword1").value = "";
		alert("您填写的信息有误或没有填写必填项，请仔细检查!");
		return false;
	}
	else
	{
		return true;
	}
}

/*****************************************************
 * @desc 		判断一次性注册
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkvipOneTime()
{
	var temp;
	checkvipname();
	checkNick();
	checkPassword1();
	checkPassword2();
	checkValidatecode();
	checkConame();
	checkAddress();
	checkPostcode();
	checkPhone1();
	checkPhone2();
	checkPhone3();
	checkMainProd();
	checkIntroduce();
	checkRealname();
	checkNoSel2();
	checkMobile();
	checkNoSel1();
	checkszbm();
	checkFax1();
		temp = control1(31);
		if (temp) 
		{ 
			alert("您填写的信息有误或没有填写必填项，请仔细检查!");
			return false;
		} 
		else 
		{
			return true;	
		}
}

/*****************************************************
 * @desc 		判断一次性注册
 * @author 		moyan@myce.net.cn
 * @version 	V1.0
 * @return 		boolean
 * */
function checkvipmailadd()
{
	var temp;
		checkaddvip();
		checkVipPassword1();
		checkVipPassword2();
		temp = control1(26);
		if (temp) 
		{ 
			alert("您填写的信息有误或没有填写必填项，请仔细检查!");
			return false;
		} 
		else 
		{
			return true;	
		}
}