/*
	Title: YeGameTopBar
	Author: Andy
	Version: V1.4
	Date: 2011.12.23S
*/
var YeGameTopbar = "<style>*{margin:0; padding:0}.yegame_topbar {text-align:left; position:relative; z-index:999997; height:40px; line-height:normal; background:url(http://img.yegame.com/public/images/yegame_topbar_bg.gif)}.yegame_topbar_cont {width:1000px; margin:0 auto; font-size:12px; font-family:宋体}.yegame_topbar_cont ul {list-style:none}.Topbar_Left {float:left}.Topbar_Left h2 {float:left; height:31px; margin:4px 12px 0 0; padding-right:12px; background:url(http://img.yegame.com/public/images/yegame_topbar_line.gif) right 1px no-repeat}.Topbar_Left h2 a {float:left; width:63px; height:31px; background:url(http://img.yegame.com/public/images/yegame_topbar_logo.gif); text-indent:-9999px; overflow:hidden}.Topbar_Left h3 {float:left}.Topbar_Left h3 iframe {float:left; margin-top:9px}.Topbar_Left h3 a {float:left; width:16px; height:16px; margin:11px 5px 0 0; text-indent:-999px; overflow:hidden; background:url(http://img.yegame.com/public/images/yegame_topbar_ico.gif) -21px 0}.Topbar_Left h3 a.ttx {background-position:0 0}.Topbar_Left h4 {float:left; width:300px; height:38px; overflow:hidden; margin-left:100px; display:inline}.Topbar_Ann {float:left; width:235px; height:25px; margin-top:7px; padding-left:12px; overflow:hidden; background:url(http://img.yegame.com/public/images/yegame_topbar_ann.gif)}.Topbar_Ann div {float:left; width:220px; height:21px; margin-top:2px; overflow:hidden}.Topbar_Ann ul {float:left}.Topbar_Ann li {float:left; width:220px; height:21px; line-height:21px; white-space:nowrap; overflow:hidden}.Topbar_Ann li a,#Topbar_Ann li a:visited #Topbar_Ann li a:hover {color:#666; text-decoration:none}.Topbar_Ann li a:hover {color:#f60}.Topbar_Right {float:right}.Topbar_Right ul {float:left; margin:10px 5px 0 0}.Topbar_Right li {float:left; padding-left:22px; margin-right:8px; line-height:18px; background:url(http://img.yegame.com/public/images/yegame_topbar_ico.gif) 0 -52px no-repeat;}.Topbar_Right li a,.Topbar_Right li a:visited {color:#333; text-decoration:none}.Topbar_Right li a:hover {color:#f60; text-decoration:none}.Topbar_Right li#Topbar_User {background-position:0 -25px}#Topbar_User.this {padding:0; color:#666; background:none}#Topbar_User.this img {float:left; width:16px; height:16px; padding:1px; border:1px solid #ccc; margin-right:5px}#Topbar_User.this a.Tuser {color:#f60; text-decoration:underline; font-family:Tahoma}.Topbar_Tips {float:left; margin-top:8px; position:relative}.Topbar_Tips span {display:block; width:87px; height:23px; background:url(http://img.yegame.com/public/images/yegame_topbar_btn.gif); text-indent:-9999px; overflow:hidden; cursor:pointer}.Topbar_Tips.this span {background-position:0 -23px}.Topbar_Tips_bg {display:none; position:absolute; z-index:999998; width:406px; height:202px; right:0; top:21px; padding-top:3px; background:url(http://img.yegame.com/public/images/yegame_topbar_tips.gif) 0 3px no-repeat; filter:alpha(opacity=95); opacity:0.95}.Topbar_Tips_cont {display:none; position:absolute; z-index:999999; width:376px; height:195px; right:0; top:21px; color:#666; padding:10px 15px 0 15px;}.Topbar_Tips.this .Topbar_Tips_bg,.Topbar_Tips.this .Topbar_Tips_cont {display:block}.Topbar_Tips_cont_title {height:22px; padding:2px 0; line-height:22px; background:url(http://img.yegame.com/public/images/yegame_topbar_x.gif) left bottom no-repeat}.Topbar_Tips_cont_title p {float:left; padding-left:23px; background:url(http://img.yegame.com/public/images/yegame_topbar_ico.gif) 0 -75px no-repeat}.Topbar_Tips_cont_title a {float:right; width:38px; height:11px; margin-top:6px; text-indent:-999px; overflow:hidden; background:url(http://img.yegame.com/public/images/yegame_topbar_ico.gif) 0 -102px}.Topbar_Game {height:80px; margin:10px 0 5px 0}.Topbar_Game a {float:left; width:169px; height:74px; padding:2px; margin:0 6px; display:inline; border:1px solid #ddd}.Topbar_Game a:hover {border-color:#999}.Topbar_Game a img {display:block; width:169px; height:74px; border:none}.Topbar_Link {margin-top:10px}.Topbar_Link a,.Topbar_Link a:visited {float:left; width:66px; height:23px; margin:0 4px 0 5px; display:inline; line-height:23px; text-align:center; background:url(http://img.yegame.com/public/images/yegame_topbar_ico.gif) 0 -123px; color:#f60; text-decoration:none}</style>";

YeGameTopbar += "<div class='yegame_topbar'><div class='yegame_topbar_cont'><div class='Topbar_Left'><h2><a href='http://www.yegame.com/' target='_blank' title='《页游》平台首页'>页游平台首页</a></h2><h3><a href='http://t.qq.com/yegame2011' target='_blank' title='《页游》腾讯认证微博'>《页游》腾讯认证微博</a><a href='http://weibo.com/yegame' class='ttx' target='_blank' title='《页游》新浪认证微博'>《页游》新浪认证微博</a><iframe src='http://open.qzone.qq.com/like?url=http%3A%2F%2Fuser.qzone.qq.com%2F1310703335&type=button_num&width=105&height=23' allowtransparency='true' scrolling='no' border='0' frameborder='0' style='width:105px;height:23px;border:none;overflow:hidden;'></iframe></h3></div>";
YeGameTopbar += "<div class='Topbar_Right'><ul><li id='Topbar_User'><a href='javascript:OpenLoginYegame();'>登陆</a>/<a href='javascript:OpenRegYegame();'>注册</a></li><li><a href='http://pay.yegame.com/' target='_blank'>充值</a></li></ul><div class='Topbar_Tips' onmouseover=\"this.className='Topbar_Tips this'\" onmouseout=\"this.className='Topbar_Tips'\"><span>游戏列表</span><div class='Topbar_Tips_bg'></div><div class='Topbar_Tips_cont'><div class='Topbar_Tips_cont_title'><p>游戏列表</p><a href='#'>更多</a></div><div class='Topbar_Game'>";

YeGameTopbar += "<a href='http://xn.yegame.com/' target='_blank' title='《仙逆》'><img src='http://img.yegame.com/public/images/yegame_topbar_game_xn.jpg' /></a>";
YeGameTopbar += "<a href='http://dpcq.yegame.com/' target='_blank' title='《斗破苍穹II》'><img src='http://img.yegame.com/public/images/yegame_topbar_game_dp.jpg' /></a>";

YeGameTopbar += "</div><div class='Topbar_Tips_cont_title'><p>功能链接</p></div><div class='Topbar_Link'>";

YeGameTopbar += "<a href='http://kf.yegame.com/jiazhang/' target='_blank'>家长监护</a>";
YeGameTopbar += "<a href='http://passport.yegame.com/' target='_blank'>账号管理</a>";
YeGameTopbar += "<a href='http://pay.yegame.com/' target='_blank'>充值中心</a>";
YeGameTopbar += "<a href='http://kf.yegame.com/' target='_blank'>客服中心</a>";
YeGameTopbar += "<a href='http://bbs.yegame.com/' target='_blank'>游戏论坛</a>";

YeGameTopbar += "</div></div></div></div></div></div>";

document.write(YeGameTopbar);

function GetCookieVal(offset)
	{
		var endstr = document.cookie.indexOf(";", offset);
		if (endstr == -1)
			endstr = document.cookie.length;
		return unescape(document.cookie.substring(offset, endstr));
	}
function GetCookie(name)
	{
		var arg = name + "=";
		var alen = arg.length;
		var clen = document.cookie.length;
		var i = 0;
		while (i < clen) {
			var j = i + alen;
			if (document.cookie.substring(i, j) == arg)
				return GetCookieVal(j);
			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0)
				break;
		}
		return null;
}
var YeGame_User = GetCookie("userinfo");
if(YeGame_User!=null){
	var YeGame_User = YeGame_User.split("|");
	document.getElementById("Topbar_User").className="this";
	document.getElementById("Topbar_User").innerHTML="<img src='http://u.yegame.com/avatar.php?uid="+YeGame_User[1]+"&size=small' /><a href='http://passport.yegame.com/mgr/userindex.jsp' target='_blank' class='Tuser' target='_blank'>"+YeGame_User[0]+"</a> [<a href='http://passport.yegame.com/logout'>退出</a>]";
}
function OpenRegYegame(){
	var From = GetCookie("from");
	if (From == "null"){
		window.open("http://passport.yegame.com/reg.jsp?forward="+Forward_Url);
	}else{
		window.open("http://passport.yegame.com/reg.jsp?forward="+Forward_Url+"&from="+From);
	}
}
