
String.prototype.replaceAll = function(s1,s2)
{    
	return this.replace(new RegExp(s1,"gm"),s2);    
}

var bindex = 0;
var tpage = location.href;
if(tpage.indexOf("?")>=0) {
	tpage = tpage.substr( 0, tpage.indexOf("?"));
}
tpage = tpage.replace("http://forum.50018.com", "");
tpage = tpage.replaceAll("/", "_");
tpage = tpage.replaceAll("-", ".");
if(tpage.length>4) {
	var rslIndex = AjaxPost("/include/board.aspx?path=" + tpage);
	bindex = parseInt(rslIndex,10);
}

document.write("&bull; <a href=\"/help/2010.aspx\">2010版本论坛特色功能</a><br>");   
document.write("<hr noshade size=1 color=\"#88CC88\">");   
document.write("<span style=\"display:block;\">");
document.write("<img src=\"/images/open.gif\" style=\"margin-bottom:-1px;\" onclick=\"CommandSelect(this,2)\"> <b>我的论坛：</b><br>");     
document.write("<span id=\"Cmd_2\" class=\"Command\" style=\"display:inline;\">");
if(user.id>0) {
	document.write("&bull; <a href=\"/member/" + user.id + "/\">我的帖子</a><br>");   
	document.write("&bull; <a href=\"/reply/" + user.id + "/\">我回复过的帖子</a><br>");   
	document.write("&bull; <a href=\"/member/score.aspx\">我的积分</a><br>");   
	document.write("&bull; <a href=\"/member/circles.aspx\">彩票圈子</a> | <a href=\"javascript:PopupShow('circle',0);\">创建圈子</a><br>");   
	document.write("&bull; <a href=\"/member/friends.aspx\">我的好友</a><br>");  
	// 2010-7-13关闭消息
	//document.write("&bull; <a href=\"javascript:PopupShow('show',0);\">我的消息</a> | <a href=\"javascript:PopupShow('message',0);\">发消息</a><br>");   
	document.write("&bull; <a href=\"/member/odds.aspx\">我的赔率投注</a><br>");   
	document.write("&bull; <a href=\"/member/face.aspx\">我的头像与属地</a><br>");   
}
else {
	document.write("&bull; <a href=\"javascript:PopupShow('regist',0)\">免费注册</a><br>");   
	document.write("&bull; <a href=\"javascript:PopupShow('login',0)\">会员登录</a><br>");   
	document.write("&bull; 如果是注册会员可以：<br>");   
	document.write("&bull; 我的帖子<br>");   
	document.write("&bull; 我回复过的帖子<br>");   
	document.write("&bull; 我的积分<br>");   
	document.write("&bull; 彩票圈子 | 创建圈子<br>");   
	document.write("&bull; 我的好友<br>");   
	//document.write("&bull; 我的消息 | 发短消息<br>");   
	document.write("&bull; 我的赔率投注<br>");   
	document.write("&bull; 我的头像与属地<br>");   
}
document.write("</span>");
document.write("</span>");

document.write("<span style=\"display:block;\">");
document.write("<img src=\"/images/open.gif\" style=\"margin-bottom:-1px;\" onclick=\"CommandSelect(this,4)\"> <b>其他功能：</b><br>");   
document.write("<span id=\"Cmd_4\" class=\"Command\">");
document.write("&bull; <a href=\"/member/circles.aspx\">彩票圈子</a><br>");   
document.write("&bull; <a href=\"/member/vip.aspx\">版主/嘉宾列表与积分榜</a><br>");   
document.write("&bull; <a href=\"/member/score.aspx\">积分榜</a><br>");   
document.write("&bull; <a href=\"/member/active.aspx\">近期热心彩民榜</a><br>");   
if(bindex>100000)
	document.write("&bull; <a href=\"/member/osee.aspx?board=" + bindex + "\">版主管理入口</a><br>");   
else
	document.write("&bull; <a href=\"/member/osee.aspx\">版主管理入口</a><br>");   
document.write("&bull; <a href=\"/member/search.aspx\">搜索帖子</a><br>");   
document.write("</span>");
document.write("</span>");

document.write("<span style=\"display:block;\">");
document.write("<img src=\"/images/open.gif\" style=\"margin-bottom:-1px;\" onclick=\"CommandSelect(this,3)\"> <b>论坛规则：</b><br>");   
document.write("<span id=\"Cmd_3\" class=\"Command\">");
document.write("&bull; <a href=\"/help/\">论坛管理守则</a><br>");   
document.write("&bull; <a href=\"/help/top.aspx\">置顶帖/精华帖规则</a><br>");   
document.write("&bull; <a href=\"/help/score.aspx\">论坛积分规则</a><br>");   
document.write("&bull; <a href=\"/help/odds.aspx\">赔率投注玩法细则</a><br>");   
document.write("&bull; <a href=\"/help/vip.aspx\">版主嘉宾管理细则</a><br>");   
document.write("&bull; <a href=\"/help/group.aspx\">彩票圈子管理细则</a><br>");   
document.write("&bull; <a href=\"http://news.50018.com/news/12/36682.html\" target=_blank>购买彩票常见问题解答</a><br>");  
document.write("</span>");
document.write("</span>");

//document.write("<hr noshade size=1 color=\"#88CC88\">");   

/*
	左侧菜单切换动作的相应处理
	一是修改菜单区域的显示；二是设置页面中相应表格的宽度；
*/
function MenuAction(cmd)
{
	var obj = document.getElementById("MenuItem2");
	obj.style.display = (cmd=="1") ? "inline" : "none";
	obj = document.getElementById("MenuItem1");
	obj.style.display = (cmd=="1") ? "none" : "inline";
	
	// 调整 Google 公告天内本站信息的显示与否
	obj = document.getElementsByName("AdsExpand");
	for(var i=0; i<obj.length; i++) {
		obj[i].style.display = (cmd=="1") ? "none" : "inline";
	}

	// 调整相应帖子表格的宽度
	obj = document.getElementsByName("btitle1");
	for(var i=0; i<obj.length; i++) {
		obj[i].style.width = (cmd=="1") ? "340px" : "490px";
	}

	obj = document.getElementsByName("btitle2");
	for(var i=0; i<obj.length; i++) {
		obj[i].style.width = (cmd=="1") ? "340px" : "490px";
	}

	obj = document.getElementsByName("btitle3");
	for(var i=0; i<obj.length; i++) {
		obj[i].style.width = (cmd=="1") ? "340px" : "490px";
	}

	obj = document.getElementsByName("btitle4");
	for(var i=0; i<obj.length; i++) {
		obj[i].style.width = (cmd=="1") ? "340px" : "490px";
	}

	obj = document.getElementsByName("btitle9");
	for(var i=0; i<obj.length; i++) {
		obj[i].style.width = (cmd=="1") ? "340px" : "490px";
	}

}

/*
	设有 打开 关闭 图片的点击事件
	obj 是图片实体；idx是序号;
*/
function CommandSelect(obj,idx)
{
	var vobj = document.getElementById("Cmd_" + idx);
	if(obj.src.indexOf("close.gif")>0) {
		obj.src = obj.src.replace("close","open");
		vobj.style.display = "inline";
	}
	else {
		obj.src = obj.src.replace("open","close");
		vobj.style.display = "none";
	}
}
