/*
	jHeader.js 页首 及 基本常用函数
	For 50018.COM\NET
	Philson Xu 2009.05.30
*/

document.write("<span id=\"HeaderUserSpan\"></span>");   

/* 确定用户信息部分的显示内容 */
function HeaderUserInfo()
{
	var rsl = "";
	if(user.id==0) {
		rsl += "<span id=\"LoginInfo\">";
		rsl += "<table width=\"510\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-size:12px;background-color:#000000;color:#FFFFFF;margin-bottom:1px;text-align:left;\">";
		rsl += "<tr height=\"24\">";
		rsl += "<td>未确认您的彩票达人身份，请";
		rsl += "&bull;<span style=\"color:#FFFFFF;cursor:hand;\" onclick=\"PopupShow(0)\">[免费注册]</span> ";
		rsl += "&bull;<span style=\"color:#FFFFFF;cursor:hand;\" onclick=\"PopupShow(1)\">[立即登录]</span> ";
		rsl += "&bull;<span style=\"color:#FFFFFF;cursor:hand;\" onclick=\"PopupShow(2)\">[忘记密码]</span> ";
		rsl += "<span id=\"UserCash\" style=\"display:none\">0</span>";
		rsl += "</td></tr>";
		rsl += "</table>";
		rsl += "</span>";
	}
	else {
		rsl += "<table width=\"510\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-size:12px;background-color:#000000;color:#FFFFFF;margin-bottom:1px;text-align:left;\">";
		rsl += "<tr height=\"24\">";
		rsl += "<td>";
		rsl += "ID: " + user.id + " ";
		rsl += "用户名: " + user.cNickname + " ";
		rsl += "余额: <span id=\"UserCash\">" + user.fMoney + "</span></b> 元 ";
		rsl += "&bull;<span style=\"color:#FFFFFF;cursor:hand;\" onclick=\"PopupShow(4)\">[充值]</span> ";
		//rsl += "&bull;<span style=\"color:#FFFFFF;cursor:hand;\" onclick=\"PopupShow(5)\">[提款]</span> ";
		rsl += "&bull;<a href=\"http://www.50018.com/Bank/Draw.aspx\" target=_blank style=\"color:#FFFFFF;cursor:hand;\">[提款]</a> ";
		rsl += "&bull;<a href=\"http://www.50018.com/Bank/History.aspx\" target=_blank style=\"color:#FFFFFF;cursor:hand;\">[明细]</a> ";
		rsl += "&bull;<a href=\"/utility/_exitprc.aspx\" style=\"color:#FFFFFF;cursor:hand;\">[退出]</a> ";
		//rsl += "&bull;<span style=\"color:#FFFFFF;cursor:hand;\" onclick=\"PopupShow(3)\">[退出]</span> ";
		rsl += "</td>";                                   
		rsl += "</tr>";
		rsl += "</table>";
	}
	return rsl;
}

document.all.HeaderUserSpan.innerHTML = HeaderUserInfo();


/* 重新获取用户信息 */
function HeaderReload()
{
	var ulist = AjaxPost("/Utility/_Member.aspx");
	var uary = ulist.split(",");
	user.id = parseInt(uary[0],10);
	user.cNickname = uary[1] + "";
	user.fMoney = uary[2];
	user.iScore = uary[3];
	user.iLuck = uary[4];
	document.all.HeaderUserSpan.innerHTML = HeaderUserInfo();
}

HeaderReload();
