<script language="javascript" type="text/javascript"> <!-- var msg ; var li_ok='images/li_ok.gif'; //用于显示正确的图标 var li_err='images/li_err.gif' //用于显示错误时的图标 var bname_m=false; msg=new Array( "请输入4-20位字符,英文、数字的组合。", "请输入6位以上字符,不允许空格。", "请重复输入上面的密码。", "请输入您的真实姓名", "请输入电话号码", "请输入电子邮箱", "请输入左边的验证码", "您必须同意注册条款" ) //定义一个消息数组,用于显示提示信息 var xmlHttp = false; try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) {
xmlHttp = false; } } if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
xmlHttp = new XMLHttpRequest(); } //建立xmlhttp实现浏览器的兼容 function show(){
if (document.getElementById("country").value=="China"){
document.getElementById("probince").style.display="" }else {
document.getElementById("probince").style.display="none" } } //显示隐藏的国家信息对应的地区信息 function GetCookie(sName) {
// cookies are separated by semicolons var aCookie = document.cookie.split("; "); for (var i=0; i < aCookie.length; i++) {
// a name/value pair (a crumb) is separated by an equal sign var aCrumb = aCookie[i].split("="); if (sName == aCrumb[0]) return unescape(aCrumb[1]); } // a cookie with the requested name does not exist return null; } //用JS读取cookies function on_input(objname){
var strtxt; var obj=document.getElementById(objname); //obj.className="d_on"; //alert(objname); switch (objname){
case "d_username": strtxt=msg[0]; break; case "d_pass": strtxt=msg[1]; break; case "d_pass2": strtxt=msg[2]; break; case "d_truename": strtxt=msg[3]; break; case "d_phone": strtxt=msg[4]; break; case "d_email": strtxt=msg[5]; break; case "d_code": strtxt=msg[6]; break; } obj.innerHTML=strtxt; } //做鼠标放文框时的提示信息 function callServer() {
var u_name = document.getElementById("user_name").value; if ((u_name == null) || (u_name == "")||(u_name.length<4)||(u_name.length>20)) {
d_username.className="d_err"; d_username.innerHTML=msg[0]; chk=false return chk;}; xmlHttp.open("POST", "user/checkuser.asp", true); xmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded'); xmlHttp.onreadystatechange = updatePage; xmlHttp.send("username="+escape(u_name)); }
function updatePage() {
if (xmlHttp.readyState < 4) {
d_username.innerHTML="loading..."; } if (xmlHttp.readyState == 4 && 200==xmlHttp.status) {
var response = xmlHttp.responseText; if (response==1) {
d_username.className="d_ok"; d_username.innerHTML='恭喜用户名可以使用。'; } else{
d_username.className="d_err"; d_username.innerHTML="用户名已占用,请重新注册"; } } } //检测用户名是否可用 function out_pass(){
var obj=document.getElementById("d_pass"); var str=document.getElementById("password").value; var chk=true; if (str=='' || str.length<6 || str.length>18){chk=false;} if (chk){
obj.className="d_ok"; obj.innerHTML='密码已经输入。'; }else{
obj.className="d_err"; obj.innerHTML=msg[1]; } return chk; } //检查密码是否输入 function out_pass2(){
var obj=document.getElementById("d_pass2"); var str=document.getElementById("password2").value; var chk=true; if (str=='' || str!=document.getElementById("password").value){chk=false;} if (chk){
obj.className="d_ok&#