var loginStatus = {"type":0,"username":"","userid":0,"notice":0},sns = "http://www.yyge.com",urs = "http://urs.yyge.com/cgi-bin",imageUrl = "/static/spring/images", domain = "yyge.com";	if (top.location != location) top.location.href = location.href;		var islogin = (typeof(loginStatus)=="undefined")?0:(loginStatus.type);
	  	var noticelen = (typeof(loginStatus)=="undefined")?0:(loginStatus.notice);
		if(islogin == 1){
			if($('#topnav')[0]){
				$('#topnav').html('<li><a alt="退出社区" href="'+sns+'/index.php/account:logout">退出</a></li></ul></div>'+
					'<li><a alt="客服" href="http://kf.yyge.com">客服</a></li>'+
					'<li id="fridButton">'+
					'	<a href="'+sns+'/index.php/friend/view/online" class="left friend">好友</a>'+
					'	<div id="Tabp_frid" class="topTablist tab2" style="width:160px;margin-left:-55px;">'+
					'		<div class="list_container">'+
					'		<div style="display:block; height:33px; overflow:hidden;">'+
					'			<div class="friend_tab1 on" id="myftab">我的好友</div>'+
					'			<div class="friend_tab2" id="gameftab">在线用户</div>'+
					'		</div>'+
					'		<div id="myfriend" class="friend_list">'+
					'			<div class="friendgroup" id="myfriendgroup">'+
					'			</div>'+
					'		</div>'+
					'		<div id="gamefriend" class="friend_list">'+
					'			<div class="friendgroup" id="gamefriendgroup">'+
					'				<div id="group_online"></div>'+
					'			</div>'+
					'		</div>'+
					'		</div>'+
					'	</div>'+
					'</li>'+
					'<li><a href="#" id="topbar_News">消息</a> </li>'+
					'<li id="myliButton">'+
					'<a href="'+sns+'/index.php/profile/id/'+loginStatus.userid+'">'+loginStatus.username+'</a>'+
						'<div id="Tabp_myli" class="topTablist tab2" style="margin-left:-6px;">'+
							'<div class="list_container">'+
								'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
									'<tr><td><a href="'+sns+'/index.php/profile/id/'+loginStatus.userid+'">我的主页</a></td></tr>'+
									'<tr><td><a href="'+sns+'/index.php/user:profile">我的资料</a></td></tr>'+
									'<tr><td><a href="'+sns+'/index.php/user:password">修改密码</a></td></tr>'+
									'<tr><td><a href="'+sns+'/index.php/user:safe">安全设置</a></td></tr>'+
									'<tr><td><a href="'+sns+'/index.php/user:creditChange">积分兑换</a></td></tr>'+
								'</table>'+
							'</div>'+
						'</div>'+
					'</li></ul>'
					);

				$('#login_news').click(function () {//显示所有公告
					var iframeurl = sns + "/index.php/message/view/notice";
					foot.modal(this, iframeurl);
					return false;
				});
				
				var foot = {
					modal : function (self) {
						var url = '';
						if (arguments[1]) {
							url = arguments[1];
						} else {
							url = $(self)[0].id.substr(4) + ':add/fajax/1';
						}
						if( url.indexOf("://")>0){
							url = url;
						}else{
							url = "/index.php/" + url;
						}
						var iframe = $(self)[0].id + 'Iframe';
						if ($('#' + iframe).length == 0) {
							$('#footModal').html("<iframe id='" + iframe + "' src='" + url + "' frameborder='no'></iframe>");
						}
						$('#' + iframe).dialog({
							bgiframe: true,
							resizable: true,
							title: $(self).text(),
							modal: true,
							width: 660,
							height: 400,
							close: function () {
								$(this).remove();
							},
							closeOnEscape: false
						})
						$('#' + iframe).css({width:'660px', height:'350px', 'overflow-x':'hidden'});
						return false;
					}
				}
				
				var time = 0;
				function flashNews(len) {//消息闪烁效果
					if (len > 0){//新通知
						var style = "";
						if(time==0){
							style=" style='color:#f00;'";
							time=1;
						}else{
							style=" style='color:#fff;'";
							time=0;
						}
						$('#login_news').show().html("<a href='' "+style+">您有(<span id='NewsLen'>"+len+"</span>)条新消息！</a><span class='pipe'>|</span>");
					} else {
						$('#login_news').show().html("");
					}
				}
				setInterval(function(){
					if($('#NewsLen')[0]){
						noticelen = $('#NewsLen').html();
					}
					flashNews(noticelen);
				},1000);	
			}	
		}else{
			if($('#topnav')[0]){
				$('#topnav').html('<li><a href="http://kf.yyge.com" alt="客服">客服</a></li>'+
                '<li><a href="'+sns+'/fish.php/account:login" alt="登录">登陆</a></li>'+
                '<li><a href="'+sns+'/fish.php/account:register/" alt="注册">注册</a></li>');
			}
		}		if($('#myGamelist')[0]){
			$('#myGamelist').html("<tr><td>你还未登陆社区，请登录社区后查看</td></tr>");
		}
		if($('#ComGamelist')[0]){
			$('#ComGamelist').html("<tr><td width='50%' ><a href='http://tq.yyge.com' target='_blank' ><img class='gIco' src='http://www.yyge.com/static/spring/images/games/app/tq_icon.gif' /><b class='left'>天启传说-<cite style='color:black;'>期待中！</cite></b></a></td><td width='50%' ><a href='http://zsg.yyge.com' target='_blank''><img class='gIco' src='http://www.yyge.com/static/spring/images/games/app/zsg_icon.gif' 																																																																										/><b class='left'>最三国-<cite style='color:black;'>最新！</cite></b></a></td></tr><tr><td width='50%' ><a href='http://wlyz.yyge.com' target='_blank' ><img class='gIco' src='http://www.yyge.com/static/spring/images/games/app/wlyz_icon.gif' /><b class='left'>武林Y传-<cite style='color:black;'>最新！</cite></b></a></td><td width='50%' ><a href='http://fswd.yyge.com' target='_blank''><img class='gIco' src='http://www.yyge.com/static/spring/images/games/app/fswd_icon.gif' 																																																																										/><b class='left'>封神无敌-<cite style='color:black;'>最新！</cite></b></a></td></tr><tr><td width='50%' ><a href='http://xz.yyge.com' target='_blank' ><img class='gIco' src='http://www.yyge.com/static/spring/images/games/app/xz_icon.gif' /><b class='left'>修真-<cite style='color:red;'>最热！</cite></b></a></td><td width='50%' ><a href='http://xtl.yyge.com' target='_blank''><img class='gIco' src='http://www.yyge.com/static/spring/images/games/app/xtl_icon.gif' 																																																																										/><b class='left'>玄天录-<cite style='color:red;'>最热！</cite></b></a></td></tr><tr><td width='50%' ><a href='http://sml.yyge.com' target='_blank' ><img class='gIco' src='http://www.yyge.com/static/spring/images/games/app/sml_icon.gif' /><b class='left'>神魔令2-<cite style='color:red;'>最热！</cite></b></a></td><td width='50%' ><a href='http://pm.yyge.com' target='_blank''><img class='gIco' src='http://www.yyge.com/static/spring/images/games/app/pmsg_icon.gif' 																																																																										/><b class='left'>泡面三国-<cite style='color:red;'>最热！</cite></b></a></td></tr><tr><td width='50%' ><a href='http://hero.yyge.com/' target='_blank' ><img class='gIco' src='http://www.yyge.com/static/spring/images/games/app/hero_icon.gif' /><b class='left'>武林英雄</b></a></td><td width='50%' ><a href='http://ceo.yyge.com/' target='_blank''><img class='gIco' src='http://www.yyge.com/static/spring/images/games/app/ceo_icon.gif' 																																																																										/><b class='left'>商业大亨</b></a></td></tr><tr><td width='50%' ><a href='http://wdfs.yyge.com' target='_blank' ><img class='gIco' src='http://www.yyge.com/static/spring/images/games/app/wdfs_icon.gif' /><b class='left'>问鼎封神</b></a></td><td width='50%' ><a href='http://jjzz.yyge.com/' target='_blank''><img class='gIco' src='http://www.yyge.com/static/spring/images/games/app/jjzz_icon.gif' 																																																																										/><b class='left'>机甲战争-<cite style='color:black;'>最新！</cite></b></a></td></tr>");
		}
		
		if($('#myBbslist')[0]){
			$('#myBbslist').html("<tr><td>你还未登陆社区，请登录社区后查看</td></tr>");
		}
		if($('#ComBbslist')[0]){
			$('#ComBbslist').html("<tr><td width='48%'><a href='http://www.yyge.com/index.php/forum/id/269' target='_blank'><b> • 天启传说（期待中）</b></a></td><td width='48%'><a href='http://www.yyge.com/index.php/forum/id/268' target='_blank'><b> • 最三国（最新！）</b></a></td></tr><tr><td width='48%'><a href='http://www.yyge.com/index.php/forum/id/162' target='_blank'><b> • 修真（最热！）</b></a></td><td width='48%'><a href='http://www.yyge.com/index.php/forum/id/254' target='_blank'><b> • 玄天录（最热！）</b></a></td></tr><tr><td width='48%'><a href='http://www.yyge.com/index.php/forum/id/263' target='_blank'><b> • 神魔令2（最热！）</b></a></td><td width='48%'><a href='http://www.yyge.com/index.php/forum/id/267' target='_blank'><b> • 武林Y传（最新！）</b></a></td></tr><tr><td width='48%'><a href='http://www.yyge.com/index.php/forum/id/266' target='_blank'><b> • 封神无敌（最新！）</b></a></td><td width='48%'><a href='http://www.yyge.com/index.php/forum/id/34' target='_blank'><b> • 泡面三国（最热！）</b></a></td></tr><tr><td width='48%'><a href='http://www.yyge.com/index.php/forum/id/208' target='_blank'><b> • 商业大亨</b></a></td><td width='48%'><a href='http://www.yyge.com/index.php/forum/id/197' target='_blank'><b> • 武林英雄</b></a></td></tr><tr><td width='48%'><a href='http://www.yyge.com/index.php/forum/id/264' target='_blank'><b> • 机甲战争</b></a></td><td width='48%'><a href='http://www.yyge.com/index.php/forum/id/261' target='_blank'><b> • 问鼎封神</b></a></td></tr>");
		}		var refer 	= encodeURIComponent(document.referrer);
		expires = new Date(); 
		expires.setTime(expires.getTime() + (1000 * 86400 * 365)); 
		document.cookie = "refer="+ refer +"; expires=" + expires.toGMTString() + "; path=/; domain=" + domain; 
		$('head').append('<script src="'+sns+'/index.php/p3p:pass" ></script>');		if($('#footnav')[0]){
			$('#footnav').empty().html('<div class="foot_wrap"><ul class="foot_link"><li><a href="'+sns+'/about/">关于我们</a><span class="pipe">|</span></li>'+
				'<li><a href="'+sns+'/about/sitemap.html">网站地图</a><span class="pipe">|</span></li>'+
				'<li><a href="'+sns+'/about/youlink.html">友情链接</a></li></ul>'+
				'<div class="foot_info">'+
         		'<ul class="left">'+
                '<!--<li>办公地址：广州市天河区天河工业园科韵路26号禾田大厦一楼北102A </li>-->'+
                '<li>客服邮箱：cs@yoyigame.com    客服电话：020-85573306 ICP粤B2-20080030</li>'+
           		'</ul>'+
            	'<p class="left"><a href="http://210.76.65.188/index.jsp" target="_blank"><img src="'+sns+imageUrl+'/cyberpolice.gif" /></a></p></div></div>');
		}