
iws=false;function shlist(){document.getElementById("t_select-list").style.display=document.getElementById("t_select-list").style.display=="block"?"none":"block";}
function changesever(ts){document.getElementById("t_selected").innerHTML=""+ts.innerHTML+"";var s=$(ts).attr('id');$('#smile').val(s);shlist();}
function cws(val){iws=val;}
function hlist(){if(!iws)document.getElementById("t_select-list").style.display="none";}
function shlist2(){document.getElementById("t_select-list2").style.display=document.getElementById("t_select-list2").style.display=="block"?"none":"block";}
function changesever2(ts2){document.getElementById("t_selected2").innerHTML=""+ts2.innerHTML+"";shlist2();}
function hlist2(){if(!iws)document.getElementById("t_select-list2").style.display="none";}
function shlist3(){document.getElementById("t_select-list3").style.display=document.getElementById("t_select-list3").style.display=="block"?"none":"block";}
function changesever3(ts2){document.getElementById("t_selected3").innerHTML=""+ts2.innerHTML+"";shlist3();}
function hlist3(){if(!iws)document.getElementById("t_select-list3").style.display="none";}
function shlist4(){document.getElementById("t_select-list4").style.display=document.getElementById("t_select-list4").style.display=="block"?"none":"block";}
function changesever4(ts2){document.getElementById("t_selected4").innerHTML=""+ts2.innerHTML+"";shlist4();}
function hlist4(){if(!iws)document.getElementById("t_select-list4").style.display="none";}
function shlist5(){document.getElementById("t_select-list5").style.display=document.getElementById("t_select-list5").style.display=="block"?"none":"block";}
function changesever5(ts2){document.getElementById("t_selected5").innerHTML=""+ts2.innerHTML+"";shlist5();}
function hlist5(){if(!iws)document.getElementById("t_select-list5").style.display="none";}
function shlist6(){document.getElementById("t_select-list6").style.display=document.getElementById("t_select-list6").style.display=="block"?"none":"block";}
function changesever6(ts2){document.getElementById("t_selected6").innerHTML=""+ts2.innerHTML+"";shlist6();}
function hlist6(){if(!iws)document.getElementById("t_select-list6").style.display="none";}
function shlist7(){document.getElementById("t_select-list7").style.display=document.getElementById("t_select-list7").style.display=="block"?"none":"block";}
function changesever7(ts2){document.getElementById("t_selected7").innerHTML=""+ts2.innerHTML+"";shlist7();}
function hlist7(){if(!iws)document.getElementById("t_select-list7").style.display="none";}
function chkSpeChar(str1){var str2="\'\",`~!@#$%^&*()|;:";for(i=0;i<str1.length;i++){if(str2.indexOf(str1.substr(i,1))!=-1)return false;}
return true;}
function upprivate(){obj=document.getElementById("nick_name");nick_name=obj.value;if(!chkSpeChar(nick_name)){alert('昵称中不能包含一下字符\'\",`~!@#$%^&*()|;:"');return false;}
if(nick_name==''){alert('用户昵称不能为空');obj.value='';return false;}
if(len(nick_name)>12){alert('字符长度不合法!请输入中文、英文、长度不超过12个字符');return false;}
obj=document.getElementById('content');if(obj.value.length>200){alert("心情内容过长,最大允许输入200个字！");obj.value=obj.value.substring(0,200);return false;}
document.getElementById("private_info").submit();}
function change_image(){obj=document.getElementsByName("sex");for(i=0;i<obj.length;i++){if(obj[i].checked){if(i==1){obj=document.getElementById("head");obj.value=201;obj=document.getElementById("image");obj.innerHTML="<img src=\"image/header/20111.gif\">";return false;}
else{obj=document.getElementById("head");obj.value=101;obj=document.getElementById("image");obj.innerHTML="<img src=\"image/header/10111.gif\">";return false;}}}}
function down_photo(){var j;obj=document.getElementsByName("sex");for(i=0;i<obj.length;i++){if(obj[i].checked)j=i;}
if(j==0){for(i=101;i<105;i++){obj=document.getElementById("head");if(i==obj.value){i++;if(i==105){obj.value=101;obj=document.getElementById("image");obj.innerHTML="<img src='image/header/10111.gif'>";return false;}
obj.value=i;obj=document.getElementById("image");obj.innerHTML="<img src='image/header/"+i+11+".gif' >";return false;}}}
else{for(i=201;i<205;i++){obj=document.getElementById("head");if(i==obj.value){i++;if(i==205){obj.value=201;obj=document.getElementById("image");obj.innerHTML="<img src='image/header/20111.gif'>";return false;}
obj.value=i;obj=document.getElementById("image");obj.innerHTML="<img src='image/header/"+i+11+".gif' >";return false;}}}}
function up_photo(){var j;obj=document.getElementsByName("sex");for(i=0;i<obj.length;i++){if(obj[i].checked)j=i;}
if(j==0){for(i=101;i<105;i++){obj=document.getElementById("head");if(i==obj.value){i--;if(i==100){obj.value=104;obj=document.getElementById("image");obj.innerHTML="<img src='image/header/10411.gif' >";return false;}
obj.value=i;obj=document.getElementById("image");obj.innerHTML="<img src='image/header/"+i+11+".gif' >";return false;}}}
else{for(i=201;i<205;i++){obj=document.getElementById("head");if(i==obj.value){i--;if(i==200){obj.value=204;obj=document.getElementById("image");obj.innerHTML="<img src='image/header/20411.gif'>";return false;}
obj.value=i;obj=document.getElementById("image");obj.innerHTML="<img src='image/header/"+i+11+".gif'>";return false;}}}}
function sub_mapinfo(){obj=document.getElementById("villagename");if(obj.value.length==0){alert("村庄名不能为空");obj.focus();return false;}
if(!chkSpeChar(obj.value)){alert("村庄名中不能包含以下字符\'\",`~!@#$%^&*()|;:");obj.focus();return false;}
if(len(obj.value)<2||len(obj.value)>16){alert("村庄名长度不正确 请使用大于两位小于八位汉字 或者长度在2-16位的英文、数字");obj.focus();return false;}
document.getElementById('mapinfo').submit();}
function xy(){var flag="2";document.getElementById('xy').style.background='url(loginimages/img-race88.gif)';document.getElementById('xyinfo').style.display='block';document.getElementById('img-xy').style.display='block';document.getElementById('img-tj').style.display='none';document.getElementById('img-chy').style.display='none';document.getElementById('xyinfo').style.background='url(loginimages/img-race9.gif)'
document.getElementById('tjinfo').style.display='none';document.getElementById('chyinfo').style.display='none';document.getElementById('tj').style.background='url(transparent.gif)';document.getElementById('chy').style.background='url(transparent.gif)';document.tribeForm.tirbe.value=flag;}
function tj(){var flag="3";document.getElementById('tj').style.background='url(loginimages/img-race88.gif)';document.getElementById('tjinfo').style.display='block';document.getElementById('img-tj').style.display='block';document.getElementById('img-chy').style.display='none';document.getElementById('img-xy').style.display='none';document.getElementById('tjinfo').style.background='url(loginimages/img-race10.gif)'
document.getElementById('xyinfo').style.display='none';document.getElementById('chyinfo').style.display='none';document.getElementById('xy').style.background='url(transparent.gif)';document.getElementById('chy').style.background='url(transparent.gif)';document.tribeForm.tirbe.value=flag;}
function chy(){var flag="1";document.getElementById('chy').style.background='url(loginimages/img-race88.gif)';document.getElementById('chyinfo').style.display='block';document.getElementById('img-tj').style.display='none';document.getElementById('img-chy').style.display='block';document.getElementById('img-xy').style.display='none';document.getElementById('chyinfo').style.background='url(loginimages/img-race111.gif)';document.getElementById('xyinfo').style.display='none';document.getElementById('tjinfo').style.display='none';document.getElementById('xy').style.background='url(transparent.gif)';document.getElementById('tj').style.background='url(transparent.gif)';document.tribeForm.tirbe.value=flag;}
function submitForm(){var str="确定选定该种族么?种族选定后不可修改";jconfirm2(str);}
function margin(flag){if(flag==1){document.getElementById('a').style.display="block";document.getElementById('b').style.display="none";}
if(flag==2){document.getElementById('a').style.display="none";document.getElementById('b').style.display="block";}}
function KeyDown(){if(event.keyCode==13){event.returnValue=false;event.cancel=true;reg.btnsubmit.click();}}
function resetchar(){obj=document.getElementById('username');obj.value='';obj=document.getElementById('passwd1');obj.value='';obj=document.getElementById('passwd2');obj.value='';obj=document.getElementById('email');obj.value='';obj=document.getElementById('valicode');obj.value='';}
function resetchar2(){obj=document.getElementById('user_name');obj.value='';obj=document.getElementById('card');obj.value='';obj=document.getElementById('birthday');obj.value='';obj=document.getElementById('officer');obj.value='';obj=document.getElementById('nation');obj.value='';}
function fresh_lal(){document.getElementById('rndimg').src="valid.php?m"+Math.random();}
function ajaxCheck(cols,name,objname){var value=document.getElementById(cols).value;var obj=document.getElementById(objname);var ul='reg.php';var params='act=c&item='+name+'&name='+value;var way="GET";$.ajax({type:way,url:ul,data:params,error:function(response){alert("连接超时，操作取消");},success:function(response){var str="";var t="test1";switch(response){case'100':if(!chkChar(value)){str="<span style='color:#f00'>用户名字符不合法</span>";break;}
if(len(value)<6||len(value)>12){str="<span style='color:#f00'>用户名长度不合法</span>";break;}
str="<span style='color:#080'>用户名可用</span>";break;case'101':str="<span style='color:#f00'>用户名已存在</span>";break;case'102':str="<span style='color:#080'>村庄名可用</span>";break;case'103':str="<span style='color:#f00'>村庄名已存在</span>";break;case'104':if(!isEmail(value)){str="<span style='color:#f00'>邮箱不合法</span>";break;}
str="<span style='color:#080'>邮箱可用</span>";break;case'105':str="<span style='color:#f00'>邮箱已被注册</span>";break;}
obj.innerHTML=str;}});}
function reg_check(){obj=document.getElementById("username");if(obj.value.length==0){alert("用户名不能为空");obj.focus();return false;}
if(chkChar(obj.value)==false){alert("用户名字符不合法 请使用英文、数字，长度在6-12个字符");obj.value='';obj.focus();return false;}
if(len(obj.value)<6||len(obj.value)>12){alert("用户名字符不合法 请使用英文、数字，长度在6-12个字符");obj.value='';obj.focus();return false;}
objP1=document.getElementById("passwd1");if(objP1.value.length==0){alert("密码不能为空");objP1.focus();return false;}
objP2=document.getElementById("passwd2");if(objP2.value.length==0){alert("确认密码不能为空");objP2.focus();return false;}
if(len(objP1.value)<6){alert("密码长度不能小于6位");objP1.value="";objP2.value="";objP1.focus();return false;}
if(objP1.value!=objP2.value){alert("密码不一致");objP1.value="";objP2.value="";objP1.focus();return false;}
obj=document.getElementById("email");if(!isEmail(obj.value)){alert("请输入有效邮箱");obj.focus();return false;}
obj=document.getElementById("valicode");if(obj.value.length==0){alert("验证码不能为空");obj.focus();return false;}
obj=document.getElementById("nickname");if(obj.value.length==0){alert("昵称不能为空");obj.focus();return false;}
if(len(obj.value)<3||len(obj.value)>12){alert("昵称字符不合法 请使用英文、数字，长度在6-12个字符");obj.value='';obj.focus();return false;}
var pattern=/^[1-2]{1}[0-9]{7}$/;obj=document.getElementById("que");if(obj.value>7){obj=document.getElementById("answer1");if(!pattern.test(obj.value)){alert("请输入正确的生日格式!");return false;}}else{obj=document.getElementById("answer1");if(len(obj.value)<2||len(obj.value)>8){alert("问题答案长度不合法");obj.value='';obj.focus();return false;}}
obj=document.getElementById("que2");if(obj.value>7){obj=document.getElementById("answer2");if(!pattern.test(obj.value)){alert("请输入正确的生日格式!");return false;}}else{obj=document.getElementById("answer2");if(len(obj.value)<2||len(obj.value)>8){alert("问题答案长度不合法");obj.value='';obj.focus();return false;}}
obj=document.getElementById("reg");obj.submit();}
function len(s){var l=0;var a=s.split("");for(var i=0;i<a.length;i++){if(a[i].charCodeAt(0)<299){l++;}else{l+=2;}}
return l;}
function isEmail(str){if(str.match(/[\w-]+@{1}[\w-]+\.{1}\w{2,4}(\.{0,1}\w{2}){0,1}/ig)!=str)
return false;else
return true;}
function charType(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;}
function modeEff(num){modes=0;for(i=0;i<4;i++){if(num&1)modes++;num>>>=1;}
return modes;}
function checkStrong(sPW){strength=0;typeInfo=0;isRepeatPw=1;isCostNum=0;isSpeNumSeri=0;flagOne=0;flagTwo=0;if(sPW.length<6){strength=101;return strength;}
if(sPW.charCodeAt(0)>=48&&sPW.charCodeAt(0)<=57){isSpeNumSeri=1;flagOne=1;flagTwo=1;}
for(i=0;i<sPW.length;i++){typeInfo|=charType(sPW.charCodeAt(i));if(sPW.charCodeAt(i)!=sPW.charCodeAt(0))isRepeatPw=0;if(isSpeNumSeri==1){if(sPW.charCodeAt(0)==48&&sPW.charCodeAt(2)==57){}else{if(sPW.charCodeAt(0)!=sPW.charCodeAt(1)+1)falgTwo=0;}
if(i!=0&&i!=sPW.length-1){if(sPW.charCodeAt(i)!=sPW.charCodeAt(i-1)+1)flagOne=0;if(sPW.charCodeAt(i+1)!=sPW.charCodeAt(i)-1)flagTwo=0;}
if(sPW.charCodeAt(sPW.length-1)==48&&sPW.charCodeAt(sPW.length-2)==57&&flagOne==1){}else{if(sPW.charCodeAt(sPW.length-1)!=sPW.charCodeAt(sPW.length-2)+1)flagOne=0;}}}
typeNum=modeEff(typeInfo);if(isRepeatPw==1){strength=102;return strength;}
if(flagOne+flagTwo==0){isSpeNumSeri=0;}
if(isSpeNumSeri==1){strength=103;return strength;}
if(typeNum==1&&sPW.length<8){strength=1;return strength;}
if(typeNum==1&&sPW.length>=8&&sPW.length<13){strength=2;return strength;}
if(typeNum==1&&sPW.length>=13){strength=3;return strength;}
if(typeNum==2&&sPW.length<8){strength=2;return strength;}
if(typeNum==2&&sPW.length>=8){strength=3;return strength;}
if(typeNum==3&&sPW.length<8){strength=2;return strength;}
if(typeNum==3&&sPW.length>=8){strength=3;return strength;}
if(typeNum>3){strength=3;return strength;}
return strength;}
function checkPw(){var obj=document.getElementById("passwd1");var PW=document.getElementById("PW");var flag=0;if(obj.value.length==0){PW.innerHTML="<span style='color:#f00'>密码不能为空</span>";flag=1;obj.focus();return false;}
if(chkChar(obj.value)==false){PW.innerHTML="<span style='color:#f00'>密码字符不合法</span>";flag=2;obj.value='';obj.focus();return false;}
if(obj.value.length<6||obj.value.length>12){PW.innerHTML="<span style='color:#f00'>密码长度不合法</span>";flag=3;obj.value='';obj.focus();return false;}
if(flag==0){PW.innerHTML="<span style='color:#080'>密码准确</span>";}}
function checkPw2(){var Pwd1=document.getElementById("passwd1");var Pwd2=document.getElementById("passwd2");var PW=document.getElementById("PW");var PW2=document.getElementById("PW2");if(Pwd1.value.length==0){PW.innerHTML="<span style='color:#f00'>密码不能为空</span>";PW2.innerHTML="";Pwd2.value='';Pwd1.focus();return false;}else{if(Pwd1.value==Pwd2.value){PW2.innerHTML="";}else{PW2.innerHTML="<span style='color:#f00'>密码不相同</span>";}
return false;}}
function pwStrength(pwd){colorDl="#eeeeee";colorEr="#FF0000";colorLs="#FF0000";colorMs="#FF9900";colorHs="#33CC00";text_0="格式错误";text_null='<img src=\"'+'loginimages/low.gif'+'\" /><img src=\"'+'loginimages/middle.gif'+'\" /><img src=\"'+'loginimages/high.gif'+'\" />';text_1='<img src=\"'+'loginimages/low1.gif'+'\" /><img src=\"'+'loginimages/middle.gif'+'\" /><img src=\"'+'loginimages/high.gif'+'\" />';text_2='<img src=\"'+'loginimages/low.gif'+'\" /><img src=\"'+'loginimages/middle1.gif'+'\" /><img src=\"'+'loginimages/high.gif'+'\" />';text_3='<img src=\"'+'loginimages/low.gif'+'\" /><img src=\"'+'loginimages/middle.gif'+'\" /><img src=\"'+'loginimages/high1.gif'+'\" />';text_101='<img src=\"'+'loginimages/low1.gif'+'\" /><img src=\"'+'loginimages/middle.gif'+'\" /><img src=\"'+'loginimages/high.gif'+'\" />';text_102="重复字符";text_103="连续字符"
PWcolor=0;PWtext=0;PWvalue=0;if(pwd==null||pwd==''){PWcolor=colorEr;PWtext=text_null;PWvalue=99;}else{S_level=checkStrong(pwd);switch(S_level){case 0:PWcolor=colorDl;PWtext=text_0;PWvalue=0;break;case 1:PWcolor=colorLs;PWtext=text_1;PWvalue=1;break;case 2:PWcolor=colorMs;PWtext=text_2;PWvalue=2;break;case 3:PWcolor=colorHs;PWtext=text_3;PWvalue=3;break;case 101:PWcolor=colorEr;PWtext=text_101;PWvalue=0;break;case 102:PWcolor=colorEr;PWtext=text_102;PWvalue=0;break;case 103:PWcolor=colorEr;PWtext=text_103;PWvalue=0;break;default:PWcolor=colorDl;PWtext=text_0;PWvalue=0;break;}}
document.getElementById("PWstrength").innerHTML=PWtext;document.getElementById("PWstrength").color=PWcolor;document.getElementById("passwd1").rs=PWvalue;return;}
function issubmit(){if(event.keyCode==13){document.getElementById('snd').submit();}}
function issubmit1(str){if(event.keyCode==13){if(str.length>0){document.getElementById('snd').submit();}else{alert("用户名不能为空");}}}
function chkChar(str2){var str1="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_";for(i=0;i<str2.length;i++)
if(str1.indexOf(str2.substr(i,1))==-1)return false;return true;}
function createSelect(ActionFlag){var selYear=document.getElementById("tYEAR");var selMonth=document.getElementById("tMON");var selDay=document.getElementById("tDAY");var dt=new Date();if(ActionFlag==1){MaxYear=dt.getFullYear();MinYear=dt.getFullYear()-100;for(var i=MinYear;i<=MaxYear;i++){var op=document.createElement("OPTION");op.value=i;op.innerHTML=i;selYear.appendChild(op);}
selYear.selectedIndex=0;for(var i=1;i<13;i++){var op=document.createElement("OPTION");op.value=i;op.innerHTML=i;selMonth.appendChild(op);}
selMonth.selectedIndex=dt.getMonth();}
var date=new Date(selYear.value,selMonth.value,0);var daysInMonth=date.getDate();selDay.options.length=0;for(var i=1;i<=daysInMonth;i++){var op=document.createElement("OPTION");op.value=i;op.innerHTML=i;selDay.appendChild(op);}
selDay.selectedIndex=dt.getDate()-1;}
function showHide(fl){var bObj=document.getElementById("base");var mObj=document.getElementById("master");if(fl==0){bObj.style.display="none";mObj.style.display="";}else{mObj.style.display="none";bObj.style.display="";}}
function changeSex(sSex){var men=document.getElementById("men");var women=document.getElementById("women");var sex=document.getElementById("sex");sex.value=sSex;if(sSex==1){men.src="loginimages/tab-reginfo2-14.gif";women.src="loginimages/tab-reginfo2-13.gif";}else{men.src="loginimages/tab-reginfo2-13.gif";women.src="loginimages/tab-reginfo2-14.gif";}}
function ajaxFindPw(){var answers=new Array('您母亲的姓名是','您父亲的姓名是','您配偶的姓名是','您的出生地是','您高中班主任是','您初中班主任是','您小学班主任是','您的小学校名是','您父亲的生日是','您母亲的生日是','您配偶的生日是');var value=document.getElementById("findname").value;var obj=document.getElementById("findinfo");var html="";var ul='login.php';var params='act=findpw&name='+value;var way="GET";$.ajax({type:way,url:ul,data:params,error:function(response){alert("连接超时，操作取消");},success:function(response){if(response==0){html='<div class="login-center mypng"><img src="images/bg-findpwd.png" alt="" /></div><div class="content-findpwd"><p class="title-findpwd">找回密码</p><p style="padding-bottom:30px;">开天神魔传安全验证</p><p class="ranktd">对不起，你输入的账号不存在！请仔细填写！</p><div align="left" style="margin-top:50px;margin-left:30px;"><a href="#" onclick="prestep();"><img src="images/btn-beforepwd.gif" alt="" /></a>&nbsp;<a href="#" onclick="prestep(),$(\'#findinfo\').hide();"><img src="images/btn-findcancel.gif" alt=""/></a></div></div>';}else{var num=response.split('-');html='<div class="login-center mypng"><img src="images/bg-findpwd.png" alt="" /></div><div class="content-findpwd"><p class="title-findpwd">找回密码</p><p>开天神魔传安全验证<br />根据系统设置，在找回密码前<br />需要进行身份验证</p><p>密保问题验证:</p><p>'+answers[num[0]]+'？</p><p>问题一：<input id="ans1" type="text" class="input-findpwd" /></p><p>'+answers[num[1]]+'？</p><p>问题二：<input id="ans2" type="text" class="input-findpwd" /></p><div align="left"><a href="#" onclick="checkanswer(\''+num[0]+'\',\''+num[1]+'\',\''+num[2]+'\');"><img src="images/btn-findnext.gif" alt="" style="margin-top:10px;margin-left:30px;"/></a>&nbsp;<a href="#"onclick="prestep(),$(\'#findinfo\').hide();"><img src="images/btn-findcancel.gif" alt="" style="margin-top:10px;"/></a></div></div>';}
obj.innerHTML=html;}});}
function checkanswer(quest1,quest2,user_id){var obj=document.getElementById("findinfo");var ans1=document.getElementById("ans1").value;var ans2=document.getElementById("ans2").value;var ul='login.php';var params='act=chkanswer&user_id='+user_id+'&quest1='+quest1+'&quest2='+quest2+'&ans1='+ans1+'&ans2='+ans2;var way="GET";$.ajax({type:way,url:ul,data:params,error:function(response){alert("连接超时，操作取消");},success:function(response){if(response==0){html='<div class="login-center mypng"><img src="images/bg-findpwd.png" alt="" /></div><div class="content-findpwd"><p class="title-findpwd">找回密码</p><p style="padding-bottom:30px;">开天神魔传安全验证</p><p class="ranktd">您回答的问题错误，请点击上<br />一步返回重新回答或点击取消<br />密码找回操作</p><div align="left" style="margin-top:50px;margin-left:30px;"><a href="#" onclick="prestep();"><img src="images/btn-beforepwd.gif" alt="" /></a>&nbsp;<a href="#" onclick="prestep(),$(\'#findinfo\').hide();"><img src="images/btn-findcancel.gif" alt=""/></a></div></div>';}else{html='<div class="login-center mypng"><img src="images/bg-findpwd.png" alt="" /></div><div class="content-findpwd"><p class="title-findpwd">找回密码</p><p class="pa">开天神魔传安全验证</p><p>设置新密码：</p><p><input type="password" id="newpws1" onblur ="chkpws(\'newpws1\')" class="input-findpwd" /></p><p class="pa">密码长度在6-12位之间</p><p>确认密码：</p><p><input  id="newpws2" onblur ="chkpws2(\'newpws1\',\'newpws2\')" type="password" class="input-findpwd" /></p><div align="left" style="margin-top:36px;*margin-top:32px;margin-left:30px;"><a href="#"  onclick="setnewpw(\''+response+'\')"><img src="images/btn-finishpwd.gif" alt="" /></a>&nbsp;<a href="#" onclick="prestep(),$(\'#findinfo\').hide();"><img src="images/btn-findcancel.gif" alt="" /></a></div></div>';}
obj.innerHTML=html;}});}
function setnewpw(user_id){var obj=document.getElementById("findinfo");var newpw1=document.getElementById("newpws1").value;var newpw2=document.getElementById("newpws2").value;var ul='login.php';var params='act=setpw&user_id='+user_id+'&newpw1='+newpw1+'&newpw2='+newpw2;var way="GET";$.ajax({type:way,url:ul,data:params,error:function(response){alert("连接超时，操作取消");},success:function(response){if(response==0){html='<div class="login-center mypng"><img src="images/bg-findpwd.png" alt="" /></div><div class="content-findpwd"><p class="title-findpwd">找回密码</p><p style="padding-bottom:30px;">开天神魔传安全验证</p><p class="ranktd">你输入的数据有误！请仔细填写！</p><div align="left" style="margin-top:50px;margin-left:30px;"><a href="#" onclick="prestep();"><img src="images/btn-beforepwd.gif" alt="" /></a>&nbsp;<a href="#" onclick="prestep(),$(\'#findinfo\').hide();"><img src="images/btn-findcancel.gif" alt=""/></a></div></div>';}else if(response==1){html='<div class="login-center mypng"><img src="images/bg-findpwd.png" alt="" /></div><div class="content-findpwd"><p class="title-findpwd">找回密码</p><p style="padding-bottom:30px;">开天神魔传安全验证</p><p class="ranktd">密码设置错误，请您重新仔细填写！</p><div align="left" style="margin-top:50px;margin-left:30px;"><a href="#" onclick="prestep();"><img src="images/btn-beforepwd.gif" alt="" /></a>&nbsp;<a href="#" onclick="prestep(),$(\'#findinfo\').hide();"><img src="images/btn-findcancel.gif" alt=""/></a></div></div>';}else if(response==2){html='<div class="login-center mypng"><img src="images/bg-findpwd.png" alt="" /></div><div class="content-findpwd"><p class="title-findpwd">找回密码</p><p style="padding-bottom:30px;">开天神魔传安全验证</p><p class="ranktd">您设置的密码跟原来的密码一致！不必修改。</p><div align="left" style="margin-top:50px;margin-left:30px;"><a href="#" onclick="prestep();"><img src="images/btn-beforepwd.gif" alt="" /></a>&nbsp;<a href="#" onclick="prestep(),$(\'#findinfo\').hide();"><img src="images/btn-findcancel.gif" alt=""/></a></div></div>';}else{html='<div class="login-center mypng"><img src="images/bg-findpwd.png" alt="" /></div><div class="content-findpwd"><p class="title-findpwd">找回密码</p><p style="padding-bottom:30px;">开天神魔传安全验证</p><p class="ranktd">恭喜，您的密码已经修改成功！</p><div align="center" style="margin-top:50px;"><a href="#" onclick="prestep(),$(\'#findinfo\').hide();"><img src="images/btn-finishpwd.gif" alt="" /></a></div></div>';}
obj.innerHTML=html;}});}
function chkpws(pw1){var newpw1=document.getElementById(pw1);if(newpw1.value.length==0){alert("密码不能为空");newpw1.focus();return false;}
if(chkChar(newpw1.value)==false){alert('密码字符不合法');newpw1.value='';newpw1.focus();return false;}
var pattern=/^[A-Za-z0-9_]+$/;if(!pattern.test(newpw1.value)){alert("请输入正确的格式!");return false;}
if(newpw1.value.length<6||newpw1.value.length>12){alert('密码长度不合法');newpw1.value='';newpw1.focus();return false;}}
function chkpws2(pw1,pw2){var newpw1=document.getElementById(pw1);var newpw2=document.getElementById(pw2);if(newpw1.value!=newpw2.value){alert('密码不一致');newpw2.value='';newpw2.focus();return false;}}
function prestep(){var obj=document.getElementById("findinfo");var html="";html='<div class="login-center mypng"><img src="images/bg-findpwd.png" alt="" /></div><div class="content-findpwd"><p class="title-findpwd">找回密码</p><p>开天神魔传安全验证</p><p>游戏账号：</p><p><input type="text" id="findname" class="input-findpwd2" /></p><p class="pstyle-findpwd"><img src="images/checked-findpwd.gif" align="absmiddle"/>通过密码保护找回</p><p class="pstyle-findpwd"><img src="images/nochecked-findpwd.gif" align="absmiddle"/>通过申诉找回<span style="color:#c00;">(暂未开放)</span></p><div align="left"><a href="#" onclick="ajaxFindPw()"><img src="images/btn-findnext.gif" alt="" style="margin-top:45px;margin-left:30px;"/></a>&nbsp;<a href="#" onclick="$(\'#findinfo\').hide();"><img src="images/btn-findcancel.gif" alt="" style="margin-top:45px;"/></a></div></div>';obj.innerHTML=html;}
function updatekey(){obj=document.getElementById("user");if(obj.value.length==0){alert("用户名不能为空");obj.focus();return false;}
if(chkChar(obj.value)==false){alert("用户名字符不合法 请使用英文、数字，长度在6-12个字符");obj.value='';obj.focus();return false;}
if(obj.value.length<6||obj.value.length>12){alert("用户名字符不合法 请使用英文、数字，长度在6-12个字符");obj.value='';obj.focus();return false;}
var html="";var tab=document.getElementById("centerinfo");var oldpw=document.getElementById("oldpw").value;var newpw=document.getElementById("newpw").value;var newpw2=document.getElementById("newpw2").value;var ul='login.php';var params='act=upw&user='+obj.value+'&oldpw='+oldpw+'&newpw='+newpw+'&newpw2='+newpw2;var way="GET";$.ajax({type:way,url:ul,data:params,error:function(response){alert("连接超时，操作取消");},success:function(response){if(response==0){html='<div class="login-center mypng"><img src="images/bg-logincenter.png" alt="" /></div><div class="content-logincenter"><p class="title-findpwd">修改密码</p><p style="margin:20px auto;text-align:center;">对不起！你输入的信息有误！</p><p style="line-height:20px; margin-top:10px;">请玩家妥善保存好密码或答案，如果不慎遗失，只能依据玩家个人信息中资料向客服寻求帮助</p><p align="center"><a href="#" onclick="prestep2()"><img src="images/btn-beforepwd.gif" alt="" style="margin-top:5px;" /></a>&nbsp;<a href="#" onclick="$(\'#centerinfo\').hide();"><img src="images/btn-login3.gif" alt="" style="margin-top:5px;" /></a></p></div>';}else{html='<div class="login-center mypng"><img src="images/bg-logincenter.png" alt="" /></div><div class="content-logincenter"><p class="title-findpwd">修改密码</p><p style="margin:20px auto;text-align:center;">恭喜你！密码修改成功！</p><p style="line-height:20px; margin-top:10px;">请玩家妥善保存好密码或答案，如果不慎遗失，只能依据玩家个人信息中资料向客服寻求帮助</p><p align="center"><a href="#" onclick="prestep2(),$(\'#centerinfo\').hide();"><img src="images/btn-finishpwd.gif" alt="" style="margin-top:5px;" /></a></p></div>';}
tab.innerHTML=html;}});}
function prestep2(){var obj=document.getElementById("centerinfo");var html="";html='<div class="login-center mypng"><img src="images/bg-logincenter.png" alt="" /></div><div class="content-logincenter"><p>用户账号：</p><p><input type="text" id="user" name="user" value="" class="input-logininfo2" /></p><p>旧密码：</p><p><input type="password" onblur ="chkpws(\'oldpw\')" id="oldpw" name="oldpw" value="" class="input-logininfo2" /></p><p>新密码：</p><p><input type="password" onblur ="chkpws(\'newpw\')" id="newpw" name="newpw" value="" class="input-logininfo2" /></p><p>确定密码：</p><p><input type="password" onblur ="chkpws2(\'newpw\',\'newpw2\')" id="newpw2" name="newpw2" value="" class="input-logininfo2" /></p><p style="line-height:20px; margin-top:10px;">请玩家妥善保存好密码或答案，如果不慎遗失，只能依据玩家个人信息中资料向客服寻求帮助</p><p align="center"><a href="#" onclick="updatekey()"><img src="images/btn-login2.gif" alt="" style="margin-top:5px;" /></a>&nbsp;<a href="#" onclick="$(\'#centerinfo\').hide();"><img src="images/btn-login3.gif" alt="" style="margin-top:5px;" /></a></p></div>';obj.innerHTML=html;}
function getCookie(name){var arr=document.cookie.match(new RegExp(name+"=[0-9a-zA-Z]*[;]?"));if(arr!=null||arr!=undefined){var items=arr[0].split(';');var val=items[0].split('=');if(val[1]!=undefined){if(val[1]!=null&&val[1]!="")return val[1];return null;}
return null;}
return null;if(arr!=null)return unescape(arr[2]);return null;}