var _GPublic_ = {
Text : '',
loader : function(){
this.Text = '';
this.Text +='\
';
this.Text +='';
$("body").prepend(this.Text);
$('div.public_member_login').css('top',($(window).height()-$('div.public_member_login').height())/2);
if (_GPublic_.getCookie('_name_')){
$('.public_header_toolbar .public_header_toolbar_r').html('Hi, '+_GPublic_.URLdecode(_GPublic_.getCookie('_name_'))+' | 退出');
}
$('.public_member_login .pml_close').click(function(){
$('.public_member_container').hide();
});
$('.public_header_toolbar .public_header_toolbar_r a:first[data-key="login"]').click(function(){
$('.public_member_container').show();
});
},
Form : function(form){
var form = $(form);
var p = {
'username' : form.find(':text[name="username"]').val(),
'password' : form.find(':password[name="password"]').val(),
};
form.find('.pml_msg').html('');
if (p['username']==''){
form.find('.pml_msg').html('请输入正确的账户!');return false;
} else if (!/^([a-zA-Z0-9]|[._-]){4,20}$/.test(p['password'])){
form.find('.pml_msg').html('请输入正确的密码!');return false;
}
form.find(":submit").attr('disabled','disabled');
$.post("//atlanta168.com/login",p,function(data){
try{
if (data.state == 'y'){
if (typeof(data.ajaxlink) != 'undefined') {
$('.public_member_login').html('数据处理中,请稍候...
');
$("").attr({ src: data.ajaxlink, type: 'text/javascript', id: 'loadscript' }).appendTo($('head'));
setTimeout(function(){window.location.reload();},3500);
}
} else {
form.find('.pml_msg').html('账户或密码错误!');
form.find(":submit").removeAttr('disabled');
return false;
}
}catch{}
});
return false;
},
getCookie : function(name){
if (!document.cookie.length) return null;
var icookie = document.cookie.split('; ');
for(key in icookie){
if (icookie[key].indexOf(name+'=')!=-1){
return icookie[key].substr(icookie[key].indexOf(name+'=')+(name+'=').length);
}
}
return null;
},
URLdecode : function(str) {
var ret = "";
for(var i=0;i0x7f) {
ret += decodeURI("%"+ str.substring(i+1,i+9));
i += 8;
}else {
ret += String.fromCharCode(parseInt("0x"+asc));
i += 2;
}
}else {
ret += chr;
}
}
return ret;
}
}
$(function(){
_GPublic_.loader();
});