/*
	jHeader.js 页首 及 基本常用函数
	For 50018.COM\NET
	Philson Xu 2009.05.30
*/

var game_path;

game_path = game.path;
if(game.sale==0) {
	game_path = "/ticai/d11/";
}

var game_open;
game_open = game.path + "zjgg/";
if(game.id>3000) {
	game_open = "/fucai/ssq/zjgg/";
}

var game_win;
game_win = "/ticai/d11/wintop.aspx";
if(game.sale!=0) {
	game_win = game.path + "wintop.aspx";
}

/* LOGO与主要菜单 */

if(IsHome()) {

channel_href = "http://www.50018.com";

document.write("<table width=\"918\" cellspacing=\"0\" cellpadding=\"0\">");   
document.write("<tr height=\"38\" valign=\"bottom\">");   
document.write("<td width=154 style=\"padding-bottom:6px;\"><a href=\"http://www.50018.com/\" target=\"_self\"><img src=\"http://www.50018.com/images/logo.gif\" width=\"148\" height=\"38\" alt=\"幸运之门彩票网50018.COM\"></a></td>"); 
  
document.write("<td style=\"font-size:20px;font-family:黑体;color:#4A6A0A\;\" align=left>|" + channel_name + "</td>");   

document.write("<td width=\"48\" valign=bottom>");
if(channel_name=="首页")
	document.write("<span class=\"TopSpan3\"><b><a href=\"http://www.50018.com/\" style=\"color:#FFFFFF\" target=\"_self\">首页</a></b></span>");   
else
	document.write("<span class=\"TopSpan4\"><b><a href=\"http://www.50018.com/\" style=\"color:#4A6A0A\" target=\"_self\">首页</a></b></span>");   
document.write("</td>");

if(channel_name=="用户中心")
document.write("<td width=\"86\" valign=bottom><span class=\"TopSpan1\"><b><a href=\"/member/\" style=\"color:#FFFFFF\" target=\"_self\">用户</a></b>┊<b><a href=\"/bank/\" style=\"color:#FFFFFF\" target=\"_self\">账户</a></b></span></td>");   
else
document.write("<td width=\"86\" valign=bottom><span class=\"TopSpan2\"><b><a href=\"/member/\" style=\"color:#4A6A0A\" target=\"_self\">用户</a></b>┊<b><a href=\"/bank/\" style=\"color:#4A6A0A\" target=\"_self\">账户</a></b></span></td>");   

if(channel_name=="合买代购")
document.write("<td width=\"86\" valign=bottom><span class=\"TopSpan1\"><b><a href=\"" + channel_href + game_path + "\" style=\"color:#FFFFFF\" target=\"_self\">代购</a></b>┊<b><a href=\"/hemai/\" style=\"color:#FFFFFF\">合买</a></b></span></td>");   
else
document.write("<td width=\"86\" valign=bottom><span class=\"TopSpan2\"><b><a href=\"" + channel_href + game_path + "\" style=\"color:#4A6A0A\" target=\"_self\">代购</a></b>┊<b><a href=\"/hemai/\" style=\"color:#4A6A0A\">合买</a></b></span></td>");   

if(channel_name=="图表工具")
document.write("<td width=\"86\" valign=bottom><span class=\"TopSpan1\"><b><a href=\"http://zoushitu.50018.com\" style=\"color:#FFFFFF\" target=\"_self\">走势</a></b>┊<b><a href=\"http://tubiao.50018.com\" style=\"color:#FFFFFF\" target=\"_self\">图表</a></b></span></td>");   
else
document.write("<td width=\"86\" valign=bottom><span class=\"TopSpan2\"><b><a href=\"http://zoushitu.50018.com\" style=\"color:#4A6A0A\" target=\"_self\">走势</a></b>┊<b><a href=\"http://tubiao.50018.com\" style=\"color:#4A6A0A\" target=\"_self\">图表</a></b></span></td>");   

if(channel_name=="开奖中奖")
document.write("<td width=\"86\" valign=bottom><span class=\"TopSpan1\"><b><a href=\"http://kj.50018.com\" style=\"color:#FFFFFF\" target=\"_self\">开奖</a></b>┊<b><a href=\"http://yuce.50018.com\" style=\"color:#FFFFFF\" target=\"_self\">预测</a></b></span></td>");   
else
document.write("<td width=\"86\" valign=bottom><span class=\"TopSpan2\"><b><a href=\"http://kj.50018.com\" style=\"color:#4A6A0A\" target=\"_self\">开奖</a></b>┊<b><a href=\"http://yuce.50018.com\" style=\"color:#4A6A0A\" target=\"_self\">预测</a></b></span></td>");   

if(channel_name=="赔率竞猜")
document.write("<td width=\"86\" valign=bottom><span class=\"TopSpan1\"><b><a href=\"http://www.funnylott.com/\" style=\"color:#FFFFFF\">套餐</a></b>┊<b><a href=\"/service/sms.aspx\" style=\"color:#FFFFFF\" target=\"_self\">推荐</a></b></span></td>");   
else
document.write("<td width=\"86\" valign=bottom><span class=\"TopSpan2\"><b><a href=\"http://www.funnylott.com/\" style=\"color:#4A6A0A\">套餐</a></b>┊<b><a href=\"/service/sms.aspx\" style=\"color:#4A6A0A\" target=\"_self\">推荐</a></b></span></td>");   

if(channel_name=="新闻中心")
document.write("<td width=\"86\" valign=bottom><span class=\"TopSpan1\"><b><a href=\"http://news.50018.com/\" style=\"color:#FFFFFF\" target=\"_blank\">资讯</a></b>┊<b><a href=\"http://zimi.50018.com/\" style=\"color:#FFFFFF\" target=\"_blank\">字谜</a></b></span></td>");   
else
document.write("<td width=\"86\" valign=bottom><span class=\"TopSpan2\"><b><a href=\"http://news.50018.com/\" style=\"color:#4A6A0A\" target=\"_blank\">资讯</a></b>┊<b><a href=\"http://zimi.50018.com/\" style=\"color:#4A6A0A\" target=\"_blank\">字谜</a></b></span></td>");   

if(channel_name=="彩票论坛")
document.write("<td width=\"46\" valign=bottom><span class=\"TopSpan2\"><b><a href=\"http://bbs.50018.com/\" target=_blank style=\"color:#FFFFFF\" target=\"_blank\">论坛</a></b></span></td>");   
else
document.write("<td width=\"46\" valign=bottom><span class=\"TopSpan4\"><b><a href=\"http://bbs.50018.com/\" target=_blank style=\"color:#4A6A0A\" target=\"_blank\">论坛</a></b></span></td>");   

document.write("</tr>");   
document.write("</table>");
}

/* 代购奖项 */
document.write("<table width=\"918\" height=\"29\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-size:12px;font-family:宋体;background-color:#4A6A0A;color:#E6F3C8;padding-top:2px;\">");   
document.write("<tr height=\"29\">");   
document.write("<td width=8></td>");   
document.write("<td width=\"36\">高频:</td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/ticai/d11/\" style=\"color:#FFF5C7;\" target=\"_self\">11选5</a></td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/fucai/ssc/\" style=\"color:#FFF5C7;\" target=\"_self\">时时彩</a></td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/fucai/ssl/\" style=\"color:#FFF5C7;\" target=\"_self\">时时乐</a></td>");   
document.write("<td width=\"36\">福彩:</td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/fucai/ssq/\" style=\"color:#FFF5C7;\" target=\"_self\">双色球</a></td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/fucai/3d/\" style=\"color:#FFF5C7;\" target=\"_self\">福彩3D</a></td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/fucai/qlc/\" style=\"color:#FFF5C7;\" target=\"_self\">七乐彩</a></td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/fucai/15x5/\" style=\"color:#FFF5C7;\" target=\"_self\">15选5</a></td>");   
document.write("<td width=\"36\">体彩:</td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/ticai/cjdlt/\" style=\"color:#FFF5C7;\" target=\"_self\">大乐透</a></td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/ticai/p3/\" style=\"color:#FFF5C7;\" target=\"_self\">排列3</a></td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/ticai/p5/\" style=\"color:#FFF5C7;\" target=\"_self\">排列5</a></td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/ticai/qxc/\" style=\"color:#FFF5C7;\" target=\"_self\">七星彩</a></td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/ticai/22x5/\" style=\"color:#FFF5C7;\" target=\"_self\">22选5</a></td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/ticai/31x7/\" style=\"color:#FFF5C7;\" target=\"_self\">31选7</a></td>");   
document.write("<td width=\"36\">足彩:</td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/zucai/zc14/\" style=\"color:#FFF5C7;\" target=\"_self\">胜负彩</a></td>");   
document.write("<td width=\"59\"><a href=\"" + channel_href + "/zucai/zc9/\" style=\"color:#FFF5C7;\" target=\"_self\">任九场</a></td>");   
document.write("<td style=\"padding-right:4px;\">");
document.write("<select id=idGameList name=idGameList class=xz style=\"width:90px;background-color:#4A6A0A;color:#FFFFFF;\" onchange=\"ChangeTopGame()\">");
document.write("<option value=\"/ticai/d11/\">山东11选5</option>");
document.write("<option value=\"/fucai/ssc/\">重庆时时彩</option>");
document.write("<option value=\"/fucai/ssl/\">上海时时乐</option>");
document.write("<option value=\"/fucai/ssq/\">双色球</option>");
document.write("<option value=\"/fucai/3d/\">福彩3D</option>");
document.write("<option value=\"/fucai/qlc/\">七乐彩</option>");
document.write("<option value=\"/ticai/cjdlt/\">超级大乐透</option>");
document.write("<option value=\"/ticai/p3/\">排列三</option>");
document.write("<option value=\"/ticai/p5/\">排列五</option>");
document.write("<option value=\"/ticai/qxc/\">七星彩6+1</option>");
document.write("<option value=\"/ticai/22x5/\">体彩22选5</option>");
document.write("<option value=\"/ticai/31x7/\">体彩31选7</option>");
document.write("<option value=\"/ticai/zc14/\">足彩胜负彩14场</option>");
document.write("<option value=\"/ticai/zc9/\">足彩任选9场</option>");
document.write("<option value=\"/ticai/zc6/\">足彩6场半</option>");
document.write("<option value=\"/ticai/zc4/\">足彩4场进球彩</option>");
document.write("<option value=\"/fucai/3d1j1q/\">福彩3D(1机1球)</option>");
document.write("<option value=\"/fucai/3d1j2q/\">福彩3D(1机2球)</option>");
document.write("<option value=\"/fucai/3d2j1q/\">福彩3D(2机1球)</option>");
document.write("<option value=\"/fucai/3d2j2q/\">福彩3D(2机2球)</option>");
document.write("<option value=\"/fucai/df6j1/\">东方6+1</option>");
document.write("<option value=\"/fucai/15x5/\">华东六省15选5</option>");
document.write("<option value=\"/fucai/ygc22x5/\">云贵川福彩22选5</option>");
document.write("<option value=\"/fucai/bjlbc/\">北京福彩两步彩</option>");
document.write("<option value=\"/fucai/4d/\">天天彩4D</option>");
document.write("<option value=\"/fucai/tj15x5/\">天津福彩15选5</option>");
document.write("<option value=\"/fucai/cq20x5/\">重庆福彩20选5</option>");
document.write("<option value=\"/fucai/gdfc36x7/\">广东福彩36选7</option>");
document.write("<option value=\"/fucai/gd26x5/\">广东福彩26选5</option>");
document.write("<option value=\"/fucai/sz35x7/\">深圳风采35选7</option>");
document.write("<option value=\"/fucai/ln35x7/\">辽宁福彩35选7</option>");
document.write("<option value=\"/fucai/qlfc23x5/\">山东福彩23选5</option>");
document.write("<option value=\"/fucai/hun22x5/\">湖南福彩22选5</option>");
document.write("<option value=\"/fucai/ljfc36x7/\">黑龙江福彩36选7</option>");
document.write("<option value=\"/fucai/ljfc22x5/\">黑龙江福彩22选5</option>");
document.write("<option value=\"/fucai/ljfcp62/\">黑龙江福彩P62</option>");
document.write("<option value=\"/fucai/hb22x5/\">湖北福彩22选5</option>");
document.write("<option value=\"/fucai/ah25x5/\">安徽福彩25选5</option>");
document.write("<option value=\"/fucai/gx24x7/\">广西福彩24选7</option>");
document.write("<option value=\"/fucai/hb20x5/\">河北福彩20选5</option>");
document.write("<option value=\"/fucai/hbp5/\">河北福彩排列5</option>");
document.write("<option value=\"/fucai/hbp7/\">河北福彩排列7</option>");
document.write("<option value=\"/fucai/hen22x5/\">河南福彩22选5</option>");
document.write("<option value=\"/fucai/sx21x5/\">山西福彩21选5</option>");
document.write("<option value=\"/fucai/nmg22x5/\">内蒙古福彩22选5</option>");
document.write("<option value=\"/fucai/xj35x7/\">新疆福彩35选7</option>");
document.write("<option value=\"/fucai/xj18x7/\">新疆福彩18选7</option>");
document.write("<option value=\"/fucai/xjqwc710/\">新疆福彩趣味彩</option>");
document.write("<option value=\"/fucai/xj25x7/\">新疆福彩25选7</option>");
document.write("<option value=\"/ticai/bj36x7/\">北京体彩36选7</option>");
document.write("<option value=\"/ticai/tj6j1/\">天津体彩6+1</option>");
document.write("<option value=\"/ticai/gdtc36x7/\">广东体彩36选7</option>");
document.write("<option value=\"/ticai/js6j1/\">江苏体彩6+1</option>");
document.write("<option value=\"/ticai/js5j1/\">江苏体彩5+1</option>");
document.write("<option value=\"/ticai/zj20x5/\">浙江体彩20选5</option>");
document.write("<option value=\"/ticai/zj29x7/\">浙江体彩29选7</option>");
document.write("<option value=\"/ticai/zj31x7/\">浙江体彩31选7</option>");
document.write("<option value=\"/ticai/zj6j1/\">浙江体彩6+1</option>");
document.write("<option value=\"/ticai/fj36x7/\">福建体彩36选7</option>");
document.write("<option value=\"/ticai/fj31x7/\">福建体彩31选7</option>");
document.write("<option value=\"/ticai/fj22x5/\">福建体彩22选5</option>");
document.write("<option value=\"/ticai/hlj6j1/\">黑龙江体彩6+1</option>");
document.write("<option value=\"/ticai/bj33x7/\">北京体彩33选7</option>");
document.write("</select>");
document.write("</td>");   
document.write("<td> </td>");   
document.write("</tr>");   
document.write("</table>");

document.write("<span id=\"HeaderUserSpan\"></span>");   
if(IsHome()) 
{
	document.write("<span id=\"ads_top\">");
	document.write("<a href=\"http://www.50018.com/service/ads.aspx?slot=945\"><img src=\"http://image.50018.com/images/year.gif\" style=\"margin-bottom:4px;\"></a>");
	document.write("</span>");
}

var mouse_fly_distance = 0;
document.onmouseover = function ()
{
	if(mouse_fly_distance<20) {
		mouse_fly_distance++;
		if(mouse_fly_distance==20) {
			var mobj = document.getElementById("ads_top");
			if(mobj!=null) mobj.innerHTML = "";
		}
	}
}

/* 确定用户信息部分的显示内容 */
function HeaderUserInfo()
{
	var rsl = "";
	if(user.id==0) {
		rsl += "<span id=\"LoginInfo\">";
		rsl += "<table width=\"918\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-size:12px;background-color:#EFF8DB;color:#4A6A0A;margin-bottom:1px;border:solid 1px #B2CC7D;border-top:solid 0px #B2CC7D;text-align:center;\">";
		rsl += "<form id=\"frmLogin_Small\" name=\"frmLogin_Small\" action=\"/Member/_LoginPrc.aspx\" method=\"post\" target=\"_self\">";
		rsl += "<tr height=\"32\">";
		rsl += "<td width=\"20\" align=\"center\"><img src=\"http://www.50018.com/images/arrow.gif\" width=\"14\" height=\"14\"></td>";
		rsl += "<td width=\"28\">登录<span id=\"SubmitRequired\"></span><span id=\"UserCash\" style=\"display:none;\">0</span></td>";
		rsl += "<td width=\"60\">用户名:</td>";
		rsl += "<td width=\"82\"><input type=\"text\" id=\"cNickname\" name=\"cNickname\" value=\"\" style=\"border: 1px solid #A9AEA8;font-size:12px;width:80px;height:15px;border-collapse:collapse;\"></td>";
		rsl += "<td width=\"40\">密码:</td>";
		rsl += "<td width=\"82\"><input type=\"password\" id=\"cPassword\" name=\"cPassword\" value=\"\" style=\"border: 1px solid #A9AEA8;font-size:8px;width:80px;height:15px;border-collapse:collapse;\"></td>";
		rsl += "<td width=\"54\" align=center><img src=\"http://www.50018.com/images/user-login.gif\" width=\"50\" height=\"19\" onclick=\"smallLoginClick();\"></td>";                                   
		rsl += "<td width=\"70\">&bull;<a href=\"http://www.50018.com/member/\" style=\"color:#4A6A0A;cursor:hand;\">免费注册</a></td>";
		rsl += "<td width=\"70\">&bull;<a href=\"http://www.50018.com/member/query.aspx\" style=\"color:#4A6A0A;cursor:hand;\">忘记密码?</a></td>";
		rsl += "<td align=\"right\">";
		rsl += "[<a href=\"http://www.50018.com/youxi/winnow.aspx\" style=\"color:#EC0000\">高手中奖</a>] ";
		rsl += "[<a href=\"http://www.50018.com/service/CookieClear.aspx\" style=\"color:#EC0000\" title=\"幸运之门每天将对图表及投注平台进行最及时的算法更新及号码匹配等进程，如果您无法正常打开图表或进行投注，请强制〖刷新〗页面，或按以下步骤清除缓存，以便接收到最新页面：在IE浏览器窗口点击“工具”-->>选择“internet 选项”-->>在“常规”中分别点击“删除cookies”和“删除文件”-->>点击{确定}按钮-->>重新打开窗口\">缓存</a>] ";
		rsl += "[<a href=\"javascript:window.external.addFavorite('http://www.50018.com/','50018.COM')\" style=\"color:#990000\">收藏</a>] ";
		rsl += "未成年人禁止购买彩票!&nbsp;";
		rsl += "</td>";
		rsl += "</tr>";
		rsl += "</form>";
		rsl += "</table>";
		rsl += "</span>";
	}
	else {
		rsl += "<table width=\"918\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-size:12px;background-color:#EFF8DB;color:#4A6A0A;margin-bottom:1px;border:solid 1px #B2CC7D;border-top:solid 0px #B2CC7D;text-align:left;\">";
		rsl += "<tr height=\"32\">";
		//rsl += "<td width=\"20\" align=\"center\"><img src=\"http://www.50018.com/images/arrow.gif\" width=\"14\" height=\"14\"></td>";
		rsl += "<td>&nbsp;";
		rsl += "ID:<b>" + user.id + "</b> ";
		rsl += "用户名:<b>" + user.cNickname + "</b> ";
		rsl += "余额:<b><span id=\"UserCash\">" + user.fMoney + "</span></b> 元[<a href=\"http://www.50018.com/bank/history.aspx\">明细</a>/<a href=\"/Bank/Draw.aspx\" target=\"_self\"><font style=\"color:#4A6A0A;cursor:hand;\">提款</font></a>] ";
		rsl += "幸运币:<b><span id=\"UserLuck\">" + user.iLuck + "</span></b> 个[<a href=\"http://www.50018.com/bank/luckhistory.aspx\">?</a>] ";
		rsl += "积分:<b><span id=\"UserScore\">" + user.iScore + "</span></b> 分[<a href=\"http://www.50018.com/bank/scorehistory.aspx\">?</a>] ";
		rsl += "&bull;<a href=\"/Member/Logout.aspx\" target=\"_self\">退出</a> ";
		rsl += "</td>";                                   
		rsl += "<td align=\"right\">";
		rsl += "[<a href=\"http://www.50018.com/youxi/winnow.aspx\" style=\"color:#EC0000\">中奖</a>] ";
		rsl += "[<a href=\"http://www.50018.com/service/CookieClear.aspx\" style=\"color:#EC0000\" title=\"幸运之门每天将对图表及投注平台进行最及时的算法更新及号码匹配等进程，如果您无法正常打开图表或进行投注，请强制〖刷新〗页面，或按以下步骤清除缓存，以便接收到最新页面：在IE浏览器窗口点击“工具”-->>选择“internet 选项”-->>在“常规”中分别点击“删除cookies”和“删除文件”-->>点击{确定}按钮-->>重新打开窗口\">缓存</a>] ";
		rsl += "[<a href=\"javascript:window.external.addFavorite('http://www.50018.com/','50018.COM')\" style=\"color:#990000\">收藏</a>] ";
		rsl += "未成年人禁止购买彩票!&nbsp;";
		rsl += "</td>";
		rsl += "</tr>";
		rsl += "</table>";
	}
	return rsl;
}

//document.all.HeaderUserSpan.innerHTML = HeaderUserInfo();

/* 登录提交 */
function smallLoginClick()
{
	if(document.all.cNickname.value!="" && document.all.cPassword.value!="") {
		if(!SubmitBefore(document.frmLogin_Small)) { return false; }
		document.frmLogin_Small.submit();
		return true;
	}
	return false;
}

/* 用户切换玩法的事件 */
function ChangeTopGame()
{
	this.location = document.all.idGameList.value;
}

var ThisBrowser = {};
var ua = navigator.userAgent.toLowerCase();
var s;
(s = ua.match(/msie ([\d.]+)/)) ? ThisBrowser.ie = s[1] :
(s = ua.match(/firefox\/([\d.]+)/)) ? ThisBrowser.firefox = s[1] :
(s = ua.match(/chrome\/([\d.]+)/)) ? ThisBrowser.chrome = s[1] :
(s = ua.match(/opera.([\d.]+)/)) ? ThisBrowser.opera = s[1] :
(s = ua.match(/version\/([\d.]+).*safari/)) ? ThisBrowser.safari = s[1] : 0;

/* 重新获取用户信息 */
function HeaderReload()
{
	/*
	if(user.id==0 && (this_host=="www.50018.com" || this_host=="zoushitu.50018.com" || this_host=="ssq.50018.com"
		|| this_host=="dlt.50018.com" || this_host=="kj.50018.com" || this_host=="cp.50018.com" 
		|| this_host=="3d.50018.com" || this_host=="ssl.50018.com" || this_host=="p5.50018.com"
		|| this_host=="wap.50018.com" || this_host=="qxc.50018.com" || this_host=="ssc.50018.com"
		|| this_host=="all.50018.com" || this_host=="p3.50018.com" || this_host=="qlc.50018.com"
		|| this_host=="d11.50018.com" || this_host=="yuce.50018.com" || this_host=="tubiao.50018.com")) {
	*/
		if(parseFloat(ThisBrowser.ie)<6.1) 
			var ulist = AjaxPost("/Include/Member.aspx");
		else
			var ulist = AjaxBase("/Include/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();
