document.write('<script src="http://res.5pk.com/www/templates/js/sso.js" type="text/javascript"></script>');
document.write('<style type="text/css">');
document.write('.p-banner{font-size:12px;background:url(http://res.5pk.com/public/templates/images/toolsbanner_back.gif) repeat-x;height:44px;overflow:hidden;width:100%;}.p-banner div{height:44px;}');
document.write('.p-text{margin:15px auto auto 5px;display:block;float:left;}.p-text2{margin:15px auto auto 0;display:block;float:left;}.p-banner a{color:#8D8D8D;text-decoration:none;cursor:pointer;}.p-banner a:hover{color:#FF6600}.p-left{display:block;float:left;}');
document.write('.p-icon{margin-top:15px;>margin-top:14px;}.p-icon2{margin-top:13px;>margin-top:12px;margin-left:8px;}');
document.write('.ssoClass{ margin:15px 10px 0px 10px; float:left; color:#8D8D8D; font-weight:bold;}');
document.write('.ssoClass span{ margin:auto 5px; color:#ff6666; }');
document.write('.ssoButton { background:url(http://res.5pk.com/public/templates/images/index_13.gif);border:0;margin-top:11px;>margin-top:10px;color:#FF6600;font-weight:bold;height:23px;width:83px;cursor:pointer; }');
document.write('</style>');

document.write('<div class="p-banner">');
document.write('<div style="margin:0 auto;width:980px;vertical-align:middle;">');
if(typeof hidelogo == 'undefined')
document.write('<a href="http://www.5pk.com" target="_blank"><img src="http://res.5pk.com/public/templates/images/logo02.gif" class="p-left"/></a>');
document.write('<span class="p-text" style="color:#FF6600;font-weight:bold;">推荐游戏:</span>');
document.write('<a href="http://wq.5pk.com" target="_blank" class="p-left" style="height:44px;" title="王权"><img width="38" height="33" src="http://res.5pk.com/public/templates/images/wq.gif" class="p-left" style="margin:5px auto auto 8px;" alt="王权"/></a>');
document.write('<a href="http://2z.5pk.com" target="_blank" class="p-left" style="height:44px;" title="二战风云"><img width="90" height="33" src="http://res.5pk.com/public/templates/images/2z.gif" class="p-left" style="margin:5px auto auto 8px;" alt="二战风云"/></a>');
document.write('<a href="http://hdw.5pk.com" target="_blank" class="p-left" style="height:44px;" title="海盗王血契"><img width="90" height="33" src="http://res.5pk.com/public/templates/images/hdw.gif" class="p-left" style="margin:5px auto auto 8px;" alt="海盗王血契"/></a>');
document.write('<a href="http://www.my.5pk.com" target="_blank" class="p-left" style="height:44px;" title="命运"><img width="70" height="42" src="http://res.5pk.com/public/templates/images/my.gif" class="p-left" style="margin:2px auto auto 8px;" alt="命运"/></a>');
document.write('<div style="float:right;">');
document.write('<div id="_ssoPassport" class="ssoClass"></div>');
document.write('<input type="button" id="_ssoButton" value="注册帐号" class="p-left ssoButton" onclick="window.open(\'http://passport.5pk.com/register.php\')" />');
document.write('<a href="http://passport.5pk.com" target="_blank" class="p-left" style="height:44px;"><img width="18" height="18" class="p-left p-icon2" src="http://res.5pk.com/public/templates/images/index_16.gif"/><span class="p-text2">管理</span></a>');
document.write('<a href="http://bbs.5pk.com" target="_blank" class="p-left" style="height:44px;"><img width="18" height="18" class="p-left p-icon2" src="http://res.5pk.com/public/templates/images/index_16-09.gif"/><span class="p-text2">论坛</span></a>');
document.write('<a href="http://pay.5pk.com" target="_blank" class="p-left" style="height:44px;"><img width="18" height="18" class="p-left p-icon2" src="http://res.5pk.com/public/templates/images/index_16-10.gif"/><span class="p-text2">充值</span></a>');
document.write('</div>');
document.write('</div>');
document.write('</div>');
if( typeof frombbs === 'undefined' ){
	$(function(){
		var _A, _B, _callFn;
		_A = $('#_ssoPassport');
		_B = $('#_ssoButton');
		_callFn = function( bool ){
			bool = bool ? true : false;
			_B.unbind('click');
			_B.removeAttr('onclick');
			if( bool === true ){
				_A.html('尊敬的<span>' + ssoCls.data.NAME + '</span> 欢迎回来!');
				_A.css('display', '');
				_B.val('退出登录');
				_B.bind('click', function(){ ssoCls.logout(); });
			}else{
				_A.css('display', 'none');
				_B.val('注册帐号');
				_B.bind('click', function(){ window.open('http://passport.5pk.com/register.php'); });
			}
		}
		_callFn(false);
		if( ssoCls ){
			ssoCls.callFn = function(){
				if( ssoCls.data ){
					_callFn(true);
				}
			}
			ssoCls.isLogin();
		}
	});
}