function checklt_ss()
{
	if(document.luantan_ss.ss_gjz.value=="")
	{
	  alert("请输入搜索的关键词!");
	  document.luantan_ss.ss_gjz.focus();
	  return false;
	}
}
function check_dl()
{
	if(document.zhuce_denglu.zfhf_users_dl.value=="")
	{
	  alert("请输入登陆的用户名!");
	  document.zhuce_denglu.zfhf_users_dl.focus();
	  return false;
	}
	if(document.zhuce_denglu.zfhf_users_pwd.value=="")
	{
	  alert("请输入登陆密码!");
	  document.zhuce_denglu.zfhf_users_pwd.focus();
	  return false;
	}
}
function checkUsername() 
{
	//var username=document.getElementById("username").value;
	var username=document.zhuce_dyb.username.value;
	if(username == "" || username == null)
	 {
		alert("请先填写用户名！");
		//document.getElementById("username").focus();
		document.zhuce_dyb.username.focus();
		return false;
	}
	switch(isUsername(username))
	{
		case 0: break;
		case 1:	
		{
			changeUsernamePrompt("您选择的用户名"+username+"格式不正确，用户名不能以数字开头");
			return false;
		}
		case 2:	
		{
			changeUsernamePrompt("您选择的用户名‘"+username+"’字符长度有误，合法长度为5-20个字符");
			return false;
		}
		case 3:	
		{
			changeUsernamePrompt("您选择的用户名‘"+username+"含有非法字符，用户名只能包含_,英文字母，数字");
			return false;
		}
		case 4:	
		{
			changeUsernamePrompt("您选择的用户名‘"+username+"’格式不正确，用户名只能包含_,英文字母，数字");
			return false;
		}
	}
	
	return true;
	
	
}
function changeUsernamePrompt(cnt)
{
	document.getElementById("tishixinxi" ).innerHTML=cnt;
	document.getElementById("tishixinxi" ).style.display="";
}


function chooseThis(name) 
{
	document.getElementById("username" ).value=name;
}
function isUsername(username)
{
	if( /^\d.*$/.test(username ))
	{
		return 1;
	}
	if(! /^.{5,20}$/.test(username))
	{
		return 2;
	}
	if(! /^[\w_]*$/.test(username))
	{
		return 3;
	}
	if(! /^([a-z]|[A-Z])[\w_]{4,19}$/.test(username))
	{
		return 4;
	}
	return 0;
}
function checkPWD(me)
{
	if(! isPassword(me.value) || !/^[^%&]*$/.test(me.value)) _("chkPwd").style.display="";
	else 
	{
		_("chkPwdStr").innerHTML="<font color=black>密码安全程度：</font>"+checkStrong(me.value);
		_("chkPwdStr").style.display="";
	}
}
function isPassword(str)
{
	if(str.length < 6 || str.length > 16) return false;
	var len;
	var i;
	len=0;
	for (i=0;i<str.length;i++)
	{
		if (str.charCodeAt(i)>255) return false;
	}
	return true;
}
function checkNumber(num ,max)
{
    if( /^[0-9]+$/.test(num) && num <=max && num > 0)
		return true;
	else return false;
}
function confirmPwd(me)
{
	var oPassword=_("password");
	if( ! (me.value==oPassword.value) || ! isPassword(me.value)) _("pwdConfirm").style.display="";
}
function checkVerifyCode( me ){
	if( me.value=="" || !( /^\w{6}$/.test(me.value)) || me.value.length !=6) _("verifyConfirm").style.display="";
}
function checkBirthday() 
{
	if (_("year").value=="" || !checkNumber(_("month").value,12) || !checkNumber(_("date").value,31))
	{
		_("birthdayConfirm").style.display="";
	}
}
function isAnswer(answer)
{
	return /^[^%&]{2,20}$/.test(answer);
}
function checkGender()
{
	for( var i=0; i<document.getElementsByName("gender").length; i++)	
	{
		if(document.getElementsByName("gender")[i].checked) return true;
	}
	return false;
}
function checkQuestion()
{
    if ( _("question").value=="cus")
    {
    	_("cus_question").style.display="";
    }else{  
    	_("cus_question").style.display="none";
    	showCQChk( "no" );
    }
}
function showCQChk(show)
{
    if(show=="yes")
    { 
    	_("questionConfirm").style.display="";
    }else{  
    	_("questionConfirm").style.display="none";
    }
}
function checkCustomQuestion(customquestion)
{
    var oCQ =_('questionConfirm');
    showCQChk("yes");
    if (customquestion==null || customquestion =="")
    {
    	oCQ.innerHTML="请填写自定义提示问题";
    	return;
    }
    if (customquestion.length > 30)
    {
    	oCQ.innerHTML="提示问题答案应不超过30个字符";
    	return;
    }
    if(! /^[^%&]+$/.test(customquestion))
    {
    	oCQ.innerHTML="提示问题中不能包含'%'和'&'这两个字符";
    	return;
    }
    showCQChk("no");
}
function _(id) 
{
	return document.getElementById(id);
}
function addErrMsg(msg) 
{
	var nmsg="<div style=\"text-align:left;padding-left:180px;\" class=\"error_explain font_space\">"+msg+"</div>";
	_("errMsg").innerHTML=_("errMsg").innerHTML + nmsg;
	_("errMsgTitle").style.display="";
	_("errMsg").style.display="";
	_('vadimg').src='/magic126v2.jsp?t='+(new Date().getTime());
	_('verify_code').value="";
	window.scroll(0,0);
	//location.href="#";
}

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 (i=0;i<4;i++){ 
		if (num & 1) modes++; 
		num>>>=1; 
	} 
	return modes; 
} 

//checkStrong函数 
//返回密码的强度级别 
function checkStrong(sPW){ 
	Modes=0; 
	for (i=0;i<sPW.length;i++){ 
		//测试每一个字符的类别并统计一共有多少种模式. 
		Modes|=CharMode(sPW.charCodeAt(i)); 
	} 
	switch(bitTotal(Modes)) 
	{
		case 1:
			return "<font color='#FF7300'>弱</font>";
			break;
		case 2:
			return "<font color='#FF7300'>中</font>";
			break;
		case 3:
			return "<font color='#FF7300'>强</font>";
			break;
		default:
			return "<font color='#FF7300'>弱</font>";
	}
}
function checkAnswer(me)
{
	if(! isAnswer(me.value)) _("answerConfirm").style.display="";
}
function checkCustomQuestion(customquestion)
{
    var oCQ=_('questionConfirm');
    showCQChk("yes");
    if (customquestion==null || customquestion=="")
    {
    	oCQ.innerHTML="请填写自定义提示问题";
    	return;
    }
    if (customquestion.length > 30)
    {
    	oCQ.innerHTML="提示问题答案应不超过30个字符";
    	return;
    }
    if(! /^[^%&]+$/.test(customquestion))
    {
    	oCQ.innerHTML="提示问题中不能包含'%'和'&'这两个字符";
    	return;
    }
    showCQChk("no");
}
function showCQChk(show)
{
    if(show=="yes")
    { 
    	_("questionConfirm").style.display="";
    }else{  
    	_("questionConfirm").style.display="none";
    }
}

function checkyouxiang(customquestion)
{
    var oCQ=_('ccyouxiang');
    youxiangck("yes");
    if (customquestion==null || customquestion=="")
    {
    	oCQ.innerHTML="请填写您的邮箱！";
    	return;
    }
    if(/\w+@\w+\.\w+/.test(customquestion)==false)
    {
    	oCQ.innerHTML="邮箱填写错误！";
    	return;
    }
    youxiangck("no");
}

function youxiangck(show)
{
    if(show=="yes")
    { 
    	_("ccyouxiang").style.display="";
    }else{  
    	_("ccyouxiang").style.display="none";
    }
}

function checkdianhua(customquestion)
{
    var oCQ = _('ccdianhua');
    dianhuack("yes");
    if (customquestion==null || customquestion=="")
    {
    	oCQ.innerHTML="请填写您的电话！";
    	return;
    }
    if(/^[0-9]{3,4}-[0-9]{7,8}/.test(customquestion)==false)
    {
    	oCQ.innerHTML="电话填写错误！";
    	return;
    }
    dianhuack("no");
}

function dianhuack(show)
{
    if(show=="yes")
    { 
    	_("ccdianhua").style.display="";
    }else{  
    	_("ccdianhua").style.display="none";
    }
}


function fillAge(agev) 
{
	if(!document.all)agev+=1900;
	var ageValue = "0";
	if (agev >= 51) 
	{
		ageValue = "8";
	} else if (agev >= 41) 
	{
		ageValue = "7";
	} else if (agev >= 34) 
	{
		ageValue = "6";
	} else if (agev >= 28) 
	{
		ageValue = "5";
	} else if (agev >= 23) 
	{
		ageValue = "4";
	} else if (agev >= 19) 
	{
		ageValue = "3";
	} else if (agev >= 16) 
	{
		ageValue = "2";
	} else if (agev <= 15 && agev > 0) 
	{
		ageValue = "1";
	}
	if (agev > 200) ageValue = "0";
	//firstSelect("age",ageValue);
}
function birthPress()
{
	var k = window.event.keyCode;
	if (k < 48 || k > 57)
		window.event.keyCode=0 ;
}
function birthYear(selectyear) 
{
    var year = new Date().getYear();
    if(year<1000)
	{
            year += 1900;
    }
    var thisyear=selectyear ? selectyear : year;
    for(var i=0; i<80; i++)
    {
        document.write("<option value="+year);
        if(year == thisyear) document.write(" selected");
        document.write(" >"+year+"</option>");
        year--;
    }
}

function birthMonth(thismonth){
    var month;
    month=thismonth ? thismonth : 1;

    for(var i=1; i<=12; i++)
	{
        document.write("<option value="+i);
        if(i== month)
        {
            document.write(" selected");
        }
        document.write(">"+i+"</option>");
    }
}


function birthDay(thisday){
    var day;
    day = thisday ? thisday : 1;

    for(var i=1; i<=31; i++)
	{
        document.write("<option value="+i);
        if(i == day)
		{
            document.write(" selected");
        }
        document.write(">"+i+"</option>");
    }
}
function firstSelect(id,value) 
{
	if(value == null || value == '') return;
	var sTmp = document.getElementById(id);
	for (var i=0; i < sTmp.length; i++)
	{
		if(sTmp.options[i].value==value)
		{
			sTmp.options[i].selected=true;
			return;
		}
	}
}

function zhuce_zcheck()
{
  if(document.zfhf_reg.password.value=="")
  {
	alert("密码不能为空！") 
	document.zfhf_reg.password.focus();
	return false;
  }
  if(document.zfhf_reg.password_cf.value=="")
  {
	alert("确认密码不能为空！") 
	document.zfhf_reg.password_cf.focus();
	return false;
  }
  if(document.zfhf_reg.password.value != document.zfhf_reg.password_cf.value)
  {
	alert("两次密码不一致！") 
	document.zfhf_reg.password.focus();
	return false;
  }
  if(document.zfhf_reg.custom_question.value=="")
  {
	alert("密码提示问题不能为空！") 
	document.zfhf_reg.custom_question.focus();
	return false;
  }
  if(document.zfhf_reg.answer.value=="")
  {
	alert("提示问题答案不能为空！") 
	document.zfhf_reg.answer.focus();
	return false;
  }
   if(document.zfhf_reg.biming.value=="")
  {
	alert("用户笔名不能为空！") 
	document.zfhf_reg.biming.focus();
	return false;
  }
  // if(document.zfhf_reg.xingming.value=="")
  //{
	//alert("用户真实姓名不能为空！") 
	//document.zfhf_reg.xingming.focus();
	//return false;
  //}
  if(document.zfhf_reg.year.value==0)
  {
	alert("年不能为空！") 
	document.zfhf_reg.year.focus();
	return false;
  }
  if(document.zfhf_reg.month.value==0)
  {
	alert("月不能为空！") 
	document.zfhf_reg.month.focus();
	return false;
  }
  if(document.zfhf_reg.date.value==0)
  {
	alert("日不能为空！") 
	document.zfhf_reg.date.focus();
	return false;
  }
  if(document.zfhf_reg.dianhua.value =="")
  {
	alert("电话不能为空！") 
	document.zfhf_reg.dianhua.focus();
	return false;
  }
  if(document.zfhf_reg.youxiang.value=="")
  {
	alert("邮箱不能为空！") 
	document.zfhf_reg.youxiang.focus();
	return false;
  }
  if(document.zfhf_reg.province.value=="")
  {
	alert("省份不能为空！") 
	document.zfhf_reg.province.focus();
	return false;
  }
  if(document.zfhf_reg.city.value=="")
  {
	alert("所在城市不能为空！") 
	document.zfhf_reg.city.focus();
	return false;
  }
 // if(document.zfhf_reg.gongsimingcheng.value=="")
 // {
	//alert("公司名称不能为空！") 
	//document.zfhf_reg.gongsimingcheng.focus();
	//return false;
  //}
  //if(document.zfhf_reg.zhiwei.value=="")
 // {
	//alert("职位不能为空！") 
	//document.zfhf_reg.zhiwei.focus();
//	return false;
//  }
  if(document.zfhf_reg.yanzhenma.value=="")
  {
	alert("验证码不能为空！") 
	document.zfhf_reg.yanzhenma.focus();
	return false;
  }


if(_( "chkPwd" ).style.display == "")
 {  
	alert("密码填写不符合标准！") 
	document.zfhf_reg.password.focus();
	return false;
  }
  if(_( "pwdConfirm" ).style.display == "")
  {
	alert("确认密码填写不符合标准！") 
	document.zfhf_reg.password_cf.focus();
	return false;
  }
  if(_( "pwdConfirm" ).style.display == "" || _( "chkPwd" ).style.display == "")
  {
	alert("两次密码不一致！") 
	document.zfhf_reg.password.focus();
	return false;
  }
  if(_( "questionConfirm" ).style.display == "")
  {
	alert("密码提示问题不符合标准！") 
	document.zfhf_reg.custom_question.focus();
	return false;
  }
  if(_( "answerConfirm" ).style.display == "")
  {
	alert("提示问题答案不符合标准！") 
	document.zfhf_reg.answer.focus();
	return false;
  }
  if(_( "pwdConfirm" ).style.display == "")
  {
	alert("年不能为空！") 
	document.zfhf_reg.year.focus();
	return false;
  }
  if(_( "pwdConfirm" ).style.display == "")
  {
	alert("月不能为空！") 
	document.zfhf_reg.month.focus();
	return false;
  }
  if(_( "birthdayConfirm" ).style.display == "")
  {
	alert("出生日期填写不符合标准！") 
	return false;
  }
  if(_( "ccdianhua" ).style.display == "")
  {
	alert("电话填写不符合标准！") 
	document.zfhf_reg.dianhua.focus();
	return false;
  }
  if(_( "ccyouxiang" ).style.display == "")
  {
	alert("邮箱填写不符合标准！") 
	document.zfhf_reg.youxiang.focus();
	return false;
  }
  
}

function qh_moshi()
{
if (document.tz_huifu.msqh.checked == true) 
{   document.tz_huifu.ms_value.value=2;
	chkbox1.style.display = "";
	chkbox2.style.display = "none";
	//alert(document.frame("cnEditBox").scr);
	//document.frame("cnEditBox").location.src="EditBox.asp";   
	gengduo.innerText="切换到HTML器编辑模式";
}else
{
	 document.tz_huifu.ms_value.value=1;    
	chkbox2.style.display = "";
	chkbox1.style.display = "none";
	//document.frame("cnEditBox").location.src="";  
	gengduo.innerText="如果您不能使用上面的HTML编辑器，请切换到普通编辑器";
}
}

function check_tp()
{
  if(document.myform.Attch.value == "")
  {
	alert("请选择要上传的图片！") 
	document.myform.Attch.focus();
	return false;
  }
}

function check_qm_s()
{
 // if(document.qmd.wangzhi.value == "http://")
  //{
	//alert("请填写连接地址！") 
	//document.qmd.wangzhi.focus();
	//return false;
 // }
  if(document.qmd.qmdnr.value == "" && document.qmd.wangzhi.value == "http://")
  {
	alert("签名当内容或连接地址必须有一个不为空！") 
	document.qmd.qmdnr.focus();
	return false;
  }
  
}

function caifu_zs()
{
  if(document.zs_cf.zs_bm.value == "")
  {
	alert("请填写财富赠送人的笔名！") 
	document.zs_cf.zs_bm.focus();
	return false;
  }
  if(document.zs_cf.zs_je.value == "")
  {
	alert("请填写赠送财富的金额！") 
	document.zs_cf.zs_je.focus();
	return false;
  }
  
  //if(document.zs_cf.zs_yy.value == "")
  //{
	//alert("请填写赠送财富的原因！") 
	//document.zs_cf.zs_yy.focus();
	//return false;
  //}
  if(document.zs_cf.zs_mima.value == "")
  {
	alert("请填写你的密码！") 
	document.zs_cf.zs_mima.focus();
	return false;
  }
}

function caifu_zs1()
{
  if(document.zs_cf.zs_bm.value == "")
  {
	alert("请填写财富赠送人的笔名！") 
	document.zs_cf.zs_bm.focus();
	return false;
  }
  if(document.zs_cf.zs_je.value == "")
  {
	alert("请填写赠送财富的金额！") 
	document.zs_cf.zs_je.focus();
	return false;
  }
  
}


function caifu_fanwei()
{
  if(/\D/.test(document.zs_cf.zs_je.value)){alert('只能输入数字');document.zs_cf.zs_je.value='';}
  if(document.zs_cf.zs_je.value > 50)
  {
	alert("一次赠送金额不能超过50个财富值！") 
	document.zs_cf.zs_je.focus();
	return false;
  }

}

function check_msg()
{
  if(document.message1.ly_biming.value == "")
  {
	alert("请填写留言接受人的笔名！") 
	document.message1.ly_biming.focus();
	return false;
  }
  if(document.message1.ly_title.value == "")
  {
	alert("请填写留言的主题！") 
	document.message1.ly_title.focus();
	return false;
  }
  if(document.message1.ly_content.value == "")
  {
	alert("请填写留言的内容！") 
	document.message1.ly_content.focus();
	return false;
  }
  
}
function checkserch()
{
   if(document.sousuo.gjz.value == "" && document.sousuo.yhm.value == "" )
   {
      alert("关键字和用户名至少有一个不能为空！");
	  document.sousuo.gjz.focus();
	  return false;
   }
   
}
function open_window(url)
{
	window.open(url," ","width=800,height=600,top=10,left=10");
}
function zhuce_dyb1()
{
  if(document.zhuce_dyb.username.value == "")
  {
	alert("请输入您的帐号！") 
	document.zhuce_dyb.username.focus();
	return false;
  }
}
function zhuce_dyb2()
{
  if(document.zhuce_dyb.wenti.value == "")
  {
	alert("请输入您的问题的答案！") 
	document.zhuce_dyb.wenti.focus();
	return false;
  }
}

function zhuce_dyb3()
{
if(document.zhuce_dyb.genghua.checked==true)
  {
	if(document.zhuce_dyb.oldemail.value == "")
  {
	alert("请输入你注册时的油箱！") 
	document.zhuce_dyb.oldemail.focus();
	return false;
  }
	if(document.zhuce_dyb.newemail.value == "")
  {
	alert("请输入您要接收的新的油箱！") 
	document.zhuce_dyb.newemail.focus();
	return false;
  }
  }
}
<!-- <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> -->


 
 




