var cookieKey = 'LOTTERY-WEB-COOKIE-KEY';

// 用户状态
// 1 错误代码 错误代码为1时，表示操作成功
// 2 网站用户名 网站用户名
// 3 绑定投注卡号 用户所绑定的投注卡号，当为空字符时，表示未绑定投注卡号
// 4 绑定手机号码 用户绑定的投注卡号所绑定的手机号码，当为空字符时，表示未绑定手机号码
// 5 用户状态 -1表示未注册 1表示注册 2注册且购卡 3注册购卡且卡已开户
// 6 用户电子邮箱 当为空字符时，表示未设置
// 7 用户身份证号码 当为空字符时，表示未设置
// 8 用户大奖通知电话 当为空字符时，表示未设置
// 9 投注卡本金余额 只有在绑定投注卡时，才有效，默认为0
// 10 投注卡奖金余额 只有在绑定投注卡时，才有效，默认为0

// 用户是否已登录
function userIsLogon() {
  return (getCookie(cookieKey+1)==1);
}

// 获取用户类型 1=网站注册用户
function getUserType() {
  return getCookie(cookieKey+0);
}

// 获取用户名
function getUserName() {
  return getCookie(cookieKey+2);
}

// 获取电话投注卡卡号
function getCardId() {
  return getCookie(cookieKey+3);
}

// 获取手机号码
function getMobilePhone() {
  return getCookie(cookieKey+4);
}

// 获取用户状态
function getUserStatus() {
  return getCookie(cookieKey+5);
}

// 获取电子邮箱
function getEmail() {
  return getCookie(cookieKey+6);
}

// 获取身份证号
function getIdentity() {
  return getCookie(cookieKey+7);
}

// 获取大奖通知电话
function getTel() {
  return getCookie(cookieKey+8);
}

// 获取本金
function getMoneyBalance() {
  return getCookie(cookieKey+9);
}

// 获取奖金
function getMoneyBonus() {
  return getCookie(cookieKey+10);
}

//判断用户是否是银行卡用户
function isBankCardUser() {
  return (getCookie(cookieKey+11) != '');
}

// 获取操作消息
function getProcessMessage(key) {
  var message = key;
  $each(arrayProcessMessage,function(value, k){
    if(k==key){
      message = value;
    }
  });
  return message;
}

// 测试
//setTimeout(test,500);

function test() {
  try{ $('txtLoginUserId').value='A200607'; } catch(e) {}
  try{ $('txtLoginPassword').value='aaaaaa'; } catch(e) {}
  try{ $('txtRechargeUserName').value = '30939067'; } catch(e) {}
  try{ $('selRechargeMoney').selectedIndex = 2; } catch(e) {}
  try{ new Element('input').setStyle('position','absolute').setProperties({value:' Show Cookies ',type:'button'}).addEvent('click',function(){alert(document.cookie)}).injectAfter($('divLoginBox')); } catch(e) {}
  try{ $('txtPassword').setProperty('type','password'); } catch(e) {}
  try{ $('txtUserId').value = 'A'+new Date().toTimeString().replace(':','').replace(':',''); } catch(e) {}
  try{ $('txtPassword').value = 'aaaaaa'; } catch(e) {}
  try{ new Element('input').setStyles({border:'0px'}).setProperty('value','密码是6个a').injectAfter($('txtPassword')); } catch(e) {}
  try{ $('txtConfirmPassword').value = 'aaaaaa'; } catch(e) {}
  try{ $('txtEmail').value = 'wantiegang@szhelper.com'; } catch(e) {}
  try{ $('txtCode').value = 'afaq'; } catch(e) {}
}