checkLogin=function(){ if(document.getElementById("username_lf").value=="" || document.getElementById("pw").value==""){alert("用户名或密码不能为空..");return false;} document.getElementById("pw").value = MD5(document.getElementById("pw").value);};
document.write(
'
会员登录
' +
'' +
'' +
''
);
var login_btn21 = getDomByClass('btn2', getDomByClass('entered'))[0];
var login_btn22 = getDomByClass('btn2', getDomByClass('entered'))[1];
var username_lf = getDomById('username_lf');
var userpw_lf = getDomById('pw');
var login_btn_reg = getDomByClass('btn_register', getDomById('form1'))[0];
var login_btn_login = getDomByClass('btn_login', getDomById('form1'))[0];
addEventHandler(username_lf, 'focus', function(){
if( username_lf.value == '用户名')
{
username_lf.value = '';
}
});
addEventHandler(username_lf, 'blur', function(){
if( username_lf.value == '')
{
username_lf.value = '用户名';
}
});
addEventHandler(userpw_lf, 'focus', function(){
if( userpw_lf.value == '密 码')
{
userpw_lf.value = '';
}
});
addEventHandler(userpw_lf, 'blur', function(){
if( userpw_lf.value == '')
{
userpw_lf.value = '密 码';
}
});
addEventHandler(phone, 'focus', function(){
if( phone.value == '手机号')
{
phone.value = '';
}
});
addEventHandler(phone, 'blur', function(){
if( phone.value == '')
{
phone.value = '手机号';
}
});
addEventHandler(phone_code, 'focus', function(){
if( phone_code.value == '手机验证码')
{
phone_code.value = '';
}
});
addEventHandler(phone_code, 'blur', function(){
if( phone_code.value == '')
{
phone_code.value = '手机验证码';
}
});
addEventHandler(login_btn21, 'mouseover', function(){
addClass(login_btn21, 'btn2_hov');
});
addEventHandler(login_btn21, 'mouseout', function(){
removeClass(login_btn21, 'btn2_hov');
});
addEventHandler(login_btn22, 'mouseover', function(){
addClass(login_btn22, 'btn2_hov');
});
addEventHandler(login_btn22, 'mouseout', function(){
removeClass(login_btn22, 'btn2_hov');
});
addEventHandler(login_btn_reg, 'mouseover', function(){
addClass(login_btn_reg, 'btn_register_hov');
});
addEventHandler(login_btn_reg, 'mouseout', function(){
removeClass(login_btn_reg, 'btn_register_hov');
});
addEventHandler(login_btn_login, 'mouseover', function(){
addClass(login_btn_login, 'btn_login_hov');
});
addEventHandler(login_btn_login, 'mouseout', function(){
removeClass(login_btn_login, 'btn_login_hov');
});
var global_phone_status = 0;
function login1GetCode()
{
if(isSendingCode == 1)
{
alert("正在发送验证码,请稍后");
return false;
}
var phone = $.trim($('#phone').val());
global_phone_status = 0;
console.info(loginCheckPhone());
if(loginCheckPhone())
{
showSendCodeTime();
$.ajax({
url:'phone_code.php',
type:'POST',
dataType:'json',
data:{phone:phone},
success:function(response){
if(response.code != 1){
alert(response.msg);
}
}
});
}
}
function loginCheckPhone()
{
var phone = $.trim($('#phone').val());
var ab=/^(1)\d{10}$/;
if(phone == '手机号' || phone == '')
{
return false;
}
if(phone.length == 11 && ab.test(phone) == true)
{
return true;
}
return false;
}
var sendcodewait=60;
var isSendingCode = 0;
function showSendCodeTime() {
if (sendcodewait == 0) {
isSendingCode = 0;
$('#quickreggetcodeA').text("免费获取验证码").removeClass('bgGray');
sendcodewait = 60;
} else {
isSendingCode = 1;
var value = sendcodewait + "秒后重新获取";
$('#quickreggetcodeA').addClass('bgGray').text(value);
sendcodewait--;
setTimeout(function(){
showSendCodeTime();
},
1000);
}
}