//
//
var userID = '';
//
var _dialog=$('#dialog');
//
var access_control = $.parseJSON('{"vcode_length":"4","vcode_resetps_email":"1","vcode_email_graph":"0","vcode_fontsize":"12","vcode_color1":"#FFF","vcode_sms_graph":"0","vcode_reg_sms":"0","vcode_limit_time":"60","vcode_color2":"#0060ca","vcode_login_graph":"0","verification_login":"0","vcode_reg_graph":"0","vcode_font":"Arial","verification_ip_reg_limit":"5","vcode_color3":"#0060ca","verification_manual":"0","vcode_reg_email":"0","vcode_color0":"#FFF","vcode_resetps_sms":"1","verification_order":"0"}');
//
var swin = $("#swin"), suwin = $("#suwin");
if (userID != '') {
//
$(".userBox dt").html(' ' +
' 帐户充值' +
' 退出登录' +
'');
$('#mlogin ul').html('
管理中心 退出登录');
//
}
$('#nav li').each(function(i) {
var _nav_a=$(this).find('a'),
_nav_url=_nav_a.attr('href');
if(location.href.indexOf(_nav_url)>-1)
{
_nav_a.addClass('on').siblings().removeClass('on');
}
});
function userLogin(action, rurl) {
if (rurl == '') rurl = top.location.toString();
if (rurl.length > 3 && rurl.substring(0, 3) == '?c=') rurl = 'process.aspx?c=go&url=' + escape(rurl);
if (action == 0) {
tip_ui(0,0,'加载数据...');
var imgUrl = 'page.aspx?c=imgcode&t=login';
var str = '';
dialog_ui(str,500);
_dialog.find('#ccImg').click(function () { $(this).attr('src', imgUrl + '&' + new Date()); });
}
else
{
var cform = $("#lform");
var delay = 0;
var cmd = 0,rwidth=300;
$.post('process.aspx?c=login', cform.serialize(), function (rdata) {
tip_ui(0,0,'正在登录,请稍候...',0,300);
var rmsg = rdata.split('|');
if (rmsg[0] == "0") {
userID = 1;
rwidth=200;
rdata = '登录成功!';
delay = 800;
if (rurl.length > 4 && rurl.substring(0, 4) == 'cmd:') {
tip_ui(rurl,1,rdata,300,rwidth);
}
else tip_ui('cmd:reload',1,rdata,300,rwidth);;
} else {
switch (rmsg[0]) {
case "Invalid_username": rdata = "您输入的用户名无效!"; break;
case "Invalid_checkCode": rdata = "您输入的验证码错误!"; break;
case "Invalid_password": rdata = "您输入的密码无效!"; break;
case "IP_blocked": rdata = "您的IP地址已被禁止访问!"; break;
case "Invalid_email": rdata = "请输入正确的电子邮箱地址!"; break;
case "Account_pending_verification": rdata = "您的帐户需要通过人工审核后才能登录,请耐心等待!如需帮助,请联系客服!"; break;
case "Account_suspended": rdata = "您的帐户已被禁用,请与客服联系!"; break;
}
cmd='cmd:userLogin(0,\''+rurl+'\')';
tip_ui(cmd,2,rdata,300,300);
}
});
return false;
}
}