// javascript document function $d(doc){return document.getelementbyid(doc);} string.prototype.trim = function() { // 用正则表达式将前后空格 // 用空字符串替代。 return this.replace(/(^\s*)|(\s*$)/g, ""); } function correctpng() { for(var i=0; i" img.outerhtml = strnewhtml i = i-1 } } } function alphabackgrounds(){ var rslt = navigator.appversion.match(/msie (d+.d+)/, ''); var itsallgood = (rslt != null && number(rslt[1]) >= 5.5); for (i=0; i=0) && (strtemp.charcodeat(i)<=255)) sum=sum+1; else sum=sum+2; } return sum; } function fucchecknumber(numb){ var i,j,strtemp; strtemp="0123456789. "; for (i=0;i0 && image.height>0){ flag=true; if(image.width/image.height>= iwidth/iheight){ if(image.width>iwidth){ imgd.width=iwidth; imgd.height=(image.height*iwidth)/image.width; }else{ imgd.width=image.width; imgd.height=image.height; } } else{ if(image.height>iheight){ imgd.height=iheight; imgd.width=(image.width*iheight)/image.height; }else{ imgd.width=image.width; imgd.height=image.height; } } } } var ajax; function createajax() //建立ajax对象 { ajax=false; try{ ajax = new activexobject("msxml2.xmlhttp"); } catch (e){ try{ ajax = new activexobject("microsoft.xmlhttp"); } catch(e){ ajax = false; } } if(!ajax && typeof xmlhttprequest!='undefined'){ ajax = new xmlhttprequest(); } } function openwindow(url,name,iwidth,iheight) { var url; //转向网页的地址; var name; //网页名称,可为空; var iwidth; //弹出窗口的宽度; var iheight; //弹出窗口的高度; var itop = (window.screen.availheight-30-iheight)/2; //获得窗口的垂直位置; var ileft = (window.screen.availwidth-10-iwidth)/2; //获得窗口的水平位置; window.open(url,name,'height='+iheight+',,innerheight='+iheight+',width='+iwidth+',innerwidth='+iwidth+',top='+itop+',left='+ileft+',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no'); } var errimg=" "; var rightimg=" "; function checkreg(f){ if(f.username.value==""){ f.username.focus(); $d("s1").innerhtml=""+errimg+" 请输入您常用的电子邮箱地址。"; return false; }else{ if(checkmail(f.username.value)==false){ f.username.focus(); $d("s1").innerhtml=""+errimg+" email格式不正确,请重新输入。"; return false; }else{ $d("s1").innerhtml=""; } } if(f.password.value==""){ f.password.focus(); $d("s2").innerhtml=""+errimg+" 对不起,登录密码不能为空。"; return false; }else{ $d("s2").innerhtml=""; } if(f.password2.value==""){ f.password2.focus(); $d("s3").innerhtml=""+errimg+" 对不起,请输入确认密码。"; return false; }else{ $d("s3").innerhtml=""; } if(f.password2.value!=f.password.value){ f.password2.focus(); $d("s3").innerhtml=""+errimg+" 对不起,两次密码输入不一致,请重新输入。"; return false; }else{ $d("s3").innerhtml=""; } if(f.nickname.value==""){ f.nickname.focus(); $d("s5").innerhtml=""+errimg+" 对不起,请输入昵称。"; return false; }else{ $d("s5").innerhtml=""; } if(f.birthday.value==""){ f.birthday.focus(); $d("s7").innerhtml=""+errimg+" 对不起,请输入生日。"; return false; }else{ $d("s7").innerhtml=""; } if(f.checkcode.value==""){ f.checkcode.focus(); $d("s11").innerhtml=""+errimg+" 对不起,请输入验证码。"; return false; }else{ $d("s11").innerhtml=""; } } function checkusername(v){ if(v.trim!=""){ createajax(); ajax.open("get","checkusername.asp?u="+v+"&rnd="+math.random(),true); ajax.onreadystatechange = function(){ if(ajax.readystate==4&&ajax.status==200) { $d("s1").innerhtml=ajax.responsetext; } }; ajax.send(null); } } function checklogin(f){ if(f.username.value==""){ alert("请输入您的登录名!"); f.username.focus(); return false; } if(f.password.value==""){ alert("请输入您的登录密码!"); f.password.focus(); return false; } } function checkupwd(f){ if(f.oldpwd.value==""){ f.oldpwd.focus(); $d("s1").innerhtml=""+errimg+" 对不起,原密码不能为空。"; return false; }else{ $d("s1").innerhtml=""; } if(f.pwd.value==""){ f.pwd.focus(); $d("s2").innerhtml=""+errimg+" 对不起,请输入新密码。"; return false; }else{ $d("s2").innerhtml=""; } if(f.pwd2.value==""){ f.pwd2.focus(); $d("s3").innerhtml=""+errimg+" 对不起,请输入确认密码。"; return false; }else{ $d("s3").innerhtml=""; } if(f.pwd2.value!=f.pwd.value){ f.pwd2.focus(); $d("s3").innerhtml=""+errimg+" 对不起,两次密码输入不一致,请重新输入。"; return false; }else{ $d("s3").innerhtml=""; } }