﻿//--------------常量----------------------------
var siteUrl="http://gm.91.com";
var imgPrex="http://image.91.com/gm91/images/081124/";
var currentPage = 1;

//--------------91空间----------------------------
var nonavspace = " ";
//--------------用户协议----------------------------
var navUser =
'    <div id="childmenu" style="display:none; z-index:-999;">'+
'      <div class="child" id="child1">'+
'       <table border="0" cellspacing="0" cellpadding="0" width="100" class="quicktd1"><tr><td><a href="https://aq.91.com/WebStaticPage/xieyi.html" Target="_blank">91网</a></td></tr>'+
'       <tr><td><a href="http://my.91.com/reg/xieyi.shtml" Target="_blank">魔域</a></td></tr>'+
'       <tr><td><a href="http://jz.91.com/guide/intro/agreement.shtml" Target="_blank">机战</a></td></tr>'+
'       <tr><td><a href="http://tmz.91.com/guide/intro/agreement.shtml" Target="_blank"">投名状OL</a></td></tr>'+
'       <tr><td><a href="http://yx.91.com/templates/agreement.shtml" Target="_blank">英雄无敌在线</a></td></tr>'+
'       <tr><td><a href="http://reg.zf.91.com/common/read.htm" Target="_blank">征服</a></td></tr>'+
'       <tr><td><a href="http://kx.91.com/content/2007-12-21/20071221034208018.shtml" Target="_blank">开心</a></td></tr>'+
'       <tr><td><a href="http://hl.91.com/pass/" Target="_blank">幻灵</a></td></tr></table>'+
'     </div>'+
'    </div>';

//--------------玩家论坛二级菜单 add by zbtlzy 08.12.09----------------------------
var navPlayer =
'    <div id="PlayerMenu" style="display:none;">'+
'      <div class="child" id="child1">'+
'       <a href="http://91bbs.91.com/Start/Index.aspx" Target="_blank">91论坛</a>'+
'       <a href="http://bbs.vip.91.com/Start/Index.aspx" Target="_blank">VIP客户论坛</a>'+
'     </div>'+
'    </div>';

//--------------快速入口菜单----------------------------
var navQuick =
'   <div id="quickServiceChild" style="display:none;">\n'+
'	<table  border="0" cellspacing="0" cellpadding="0" id="menuitems" class="child">\n'+
'      <tr>\n'+
'        <td><img src="/downmenu_1.gif" width="180px;" height="9" /></td>\n'+
'      </tr>\n'+
'      <tr>\n'+
'        <td align="center" >\n'+
'			<table width="95%" border="0" cellspacing="0" cellpadding="0">\n'+
'			<tr align="center">\n'+
'			<td valign="top" class="tit" style="height:30px;"><a href="/Member/PersonCenter.aspx" class="alert">我的通行证</a></td>\n'+
'			</tr>\n'+
'          <tr align="center">\n'+
'			<td align="center"><img src="'+ imgPrex +'downmenu_break.gif" width="150" height="1" /></td></tr>\n'+
'			<tr>\n'+
'            <td valign="top" class="tit"><a href="/MyQuestion/OnlineService.aspx" class="alert">问题在线提交</a></td>\n'+
'		  	 </tr>\n'+
'			<tr>\n'+
'           <td align="left" valign="top">\n'+
'				<table width="95%"  border="0" cellspacing="0" cellpadding="3" align="center" class="quicktd">\n'+
'					<tr>\n'+
'						<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=1000" >充值专区</a></td>\n'+
'						<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=1100">包子铺专区</a></td>\n'+
'					</tr>\n'+
'					<tr>\n'+
'           <td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=110">魔域专区</a></td>\n'+
'						<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=111">机战专区</a></td>\n'+
' 					</tr>\n'+
'					<tr>\n'+
' 				 		<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=112">开心专区</a></td>\n'+
' 				 		<td nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=113">投名状OL专区</a></td>\n'+
'					</tr>\n'+
'					<tr>\n'+
' 					<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=114">英雄无敌在线专区</a></td>\n'+
'						<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=105">信仰专区</a></td>\n'+
'          			</tr>\n'+
'					<tr>\n'+
' 						<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=99">幻灵专区</a></td>\n'+
'						<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=104">征服专区</a></td>\n'+
'          			</tr>\n'+
'					<tr>\n'+
' 					<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=118">YY仙战专区</a></td>\n'+
' 					<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=117">天元专区</a></td>\n'+
'          			</tr>\n'+
'					<tr>\n'+
' 					<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=119">梦幻迪士尼专区</a></td>\n'+
' 					<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=121">策马三国专区</a></td>\n'+
'          			</tr>\n'+
'					<tr>\n'+
' 					<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=120">王者重生专区</a></td>\n'+
' 					<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/MyQuestion/OnlineService.aspx?action=questionadd&GameCode=122">欢乐镜花缘专区</a></td>\n'+
'          			</tr>\n'+
'				</table>\n'+
'			</td></tr>\n'+
'			<tr align="center">\n'+
'				<td><img src="'+ imgPrex +'downmenu_break.gif" width="150" height="1" /></td>\n'+
'			</tr><tr>\n'+
'				<td align="left" valign="middle" class="tit"><a href="https://aq.91.com/NDUser_Login.aspx" target="_blank" class="alert">帐号信息</a></td>\n'+
'				</tr><tr>'+
'				<td align="left" valign="middle" >'+
'					<table width="95%"  border="0" cellspacing="0" cellpadding="3" align="center" class="quicktd">\n'+
'					<tr>'+
'						<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="https://aq.91.com/WebStaticPage/LostPassword.html" target="_blank">密码找回</a></td>\n'+
'						<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="https://aq.91.com/NDUser_Login.aspx" target="_blank">帐号管理</a></td>\n'+
'					</tr><tr>\n'+
'						<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="http://shop.91.com/VIP_area/index.html" target="_blank">VIP服务</a></td>\n'+
'					</tr><tr>\n'+
'          </tr> </table></td></tr>\n'+
'          <tr>\n'+
'			<td align="center" valign="top" class="alert"><img src="'+ imgPrex +'downmenu_break.gif" width="167" height="1" /></td></tr>\n'+
'          <tr><td align="left" valign="middle" class="tit"><a href="http://shop.91.com/Pay/index.html" target="_blank" class="alert">充值管理</a></td></tr>\n'+
'			<tr>'+
'				<td align="left" valign="middle" >'+
'					<table width="95%"  border="0" cellspacing="0" cellpadding="3" align="center" class="quicktd">\n'+
'					<tr>'+
'						<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="https://shop.91.com/Pay/index.html"  target="_blank">游戏充值</a></td>\n'+
'						<td width="50%" nowrap ><img src="'+ imgPrex +'downmenu_arrow.gif" width="9" height="5" /><a href="/Member/PersonCenter.aspx">帐户查询</a></td>\n'+
'          			</tr></table><br></td></tr>\n'+
'			<tr><td><img src="'+ imgPrex +'downmenu_3.gif" width="191" height="3"/></td></tr>\n'+
' 			</table></td></tr></table>\n'+
'	</div>';

//--------------页面特效相关----------------------------
//显示隐藏列表
function showhidetool(objname,type)
{

	if(document.getElementById(objname))
	{
		var obj=document.getElementById(objname);
		obj.style.display = type;
	}
}

//GM2.1共用输出头部
function newInitHeader()
{
    //定义导航条的菜单项
    var items=
    [
        {Name:"首页",        Url:""+ siteUrl +"/Default.aspx"                   ,Target:"_self"      ,Style:"on"      ,     SubId:null,       SubMenus:null},   //首页 0
        {Name:"快捷服务",    Url:"#"                                            ,Target:"_self"      ,Style:""        ,     SubId:"quickServiceChild",       SubMenus:navQuick}, //快捷服务 1
        {Name:"个人中心",    Url:siteUrl+"/Member/PersonCenter.aspx"            ,Target:"_self"      ,Style:""        ,     SubId:null,       SubMenus:null}, //个人中心 2
        {Name:"用户协议",    Url:"#"                                            ,Target:"_self"      ,Style:""        ,     SubId:"childmenu",       SubMenus:navUser},//用户协议 3			
        {Name:"帐号丢失帮助",Url:"http://www.91.com/gm91/zhuanti/acchelp/"  	,Target:"_blank"     ,Style:""        ,     SubId:null,       SubMenus:null}//帐号丢失帮助 4
    ];
   
    var url = document.location.href.toLowerCase();
    if(url.indexOf("personcenter.aspx")!=-1 || url.indexOf("securitycenter.aspx")!=-1 || url.indexOf("securityguide.aspx")!=-1)
    {
        items[0].Style = "";
        items[2].Style = "on";
    }
    //登录登出
    var nickName = GetCookie("GM91NickName");
    if(nickName) //已登录		
		login = '<h1 class="logo" ><a class="textHide" href="/Default.aspx" Target="_self">91客服中心</a></h1>'+
	            '<div class="login_status"><ul><li><span class="nickname">' + nickName + '</span>   欢迎您91客服中心！</li><li><a href="javascript:loginout();">[退出]</a></li><li> <a href="https://aq.91.com/NDUser_Register.aspx?url=http://gm.91.com"  target="_top" >[注册]</a></li></ul></div>';
	else
		login =  '<h1 class="logo" ><a class="textHide" href="/Default.aspx" Target="_self">91客服中心</a></h1>'+
	            '<div class="login_status"><ul><li>欢迎您光临91客服中心！</li><li><a href="javascript:validatePage();" ><span id="loginTips">[登录]</span></a> </li><li><a href="https://aq.91.com/NDUser_Register.aspx?url=http://gm.91.com" target="_top" >[注册]</a></li></ul></div>';
    //导航菜单
	var navmenu = '<div class="nav">'+
		              '<ul>';
	for(var i=0; i<items.length; i++)
	{
		if(items[i].SubId=="quickServiceChild")
	    {
	    	var newstr="<div style='position:absolute;left:620px; width:28px; height:11px;z-index:999;overflow:hidden;'><img src='http://image.91.com/www91/gm91/images/new081112.gif' border=0></div>"
            navmenu = navmenu + '<li onmouseover="showhidetool(\''+ items[i].SubId +'\',\'block\')" onmouseout="showhidetool(\''+ items[i].SubId +'\',\'none\')" ><a  href="'+ items[i].Url +'"  target="'+ items[i].Target  +'">'+ items[i].Name +'</a>'+ newstr+items[i].SubMenus +'</li>';	    			
	    }
	    else if(items[i].SubId=="childmenu")
	    {
            navmenu = navmenu + '<li onmouseover="showhidetool(\''+ items[i].SubId +'\',\'block\')" onmouseout="showhidetool(\''+ items[i].SubId +'\',\'none\')" ><a  href="'+ items[i].Url +'"  target="'+ items[i].Target  +'">'+ items[i].Name +'</a>'+ newstr+items[i].SubMenus +'</li>';
	    }
	    else
	    {
	        navmenu = navmenu + '<li class="'+items[i].Style+'"><a href="'+ items[i].Url +'"  target="'+ items[i].Target  +'">'+ items[i].Name +'</a></li>';
	    }
	}
	
	navmenu = navmenu + '</ul>'+
              '</div>';
    var header91 ='<script language="javascript" type="text/javascript">topMenu("91资讯中心 官方网站 gm.91.com 天晴数码娱乐公司","http://gm.91.com","_blank",2);</script>';
              
    var str='<div id="g_91nav">'+
            header91+
             '</div><div id="g_header_nav">'+
            login +
            navmenu +
            '<script language="javascript" type="text/javascript">loginTips_show();</script></div>';
    document.write(str);
}


//输出头部
function initHeader()
{
    //定义导航条的菜单项
    var items=
    [
        {Name:"首页",        Url:""+ siteUrl +"/Default.aspx"                   ,Target:"_self"             ,SubId:null,               SubMenus:null},   //首页 0
        {Name:"快捷服务",    Url:"#"                                            ,Target:"_self"             ,SubId:"quickServiceChild",SubMenus:navQuick}, //快捷服务 1
        {Name:"个人中心",    Url:siteUrl+"/Member/PersonCenter.aspx"            ,Target:"_self"             ,SubId:null,               SubMenus:null}, //个人中心 2
        {Name:"用户协议",    Url:"https://aq.91.com/WReg/Register1.aspx"       ,Target:"_self"             ,SubId:"childmenu",        SubMenus:navUser},//用户协议 3			
        {Name:"91问吧",      Url:"http://wb.91.com/"                            ,Target:"_blank"            ,SubId:null,               SubMenus:null},   //91问吧 4
        {Name:"91空间",      Url:"http://space.91.com/"                         ,Target:"_blank"            ,SubId:"spacemenu_no",     SubMenus:nonavspace},   //91空间 7				
        {Name:"玩家论坛",    Url:"#"           									,Target:"_self"            	,SubId:"PlayerMenu",       SubMenus:navPlayer},//玩家论坛 5			
        {Name:"帐号丢失帮助",Url:"http://www.91.com/gm91/zhuanti/acchelp/"  		,Target:"_blank"            ,SubId:null,               SubMenus:null}//帐号丢失帮助 6
    ];
    
    
    //登录登出
    var nickName = GetCookie("GM91NickName");
    if(nickName) //已登录		
		login = '<div class="logo" title="91客服中心"><a href="/Default.aspx" Target="_self"></a></div>'+
	            '<div class="welcome"><span class="nickname">' + nickName + '</span>   欢迎您光临91客服中心！<a href="javascript:loginout();">[退出]</a> <a href="https://aq.91.com/Wreg/Register3.aspx?url=http://gm.91.com"  target="_top" >[注册]</a></div>'+
	            '<div class="clear"></div>\n';
	else
		login = '<div class="logo" title="91客服中心"><a href="/Default.aspx" Target="_self"></a></div>'+
	            '<div class="welcome">欢迎您光临91客服中心！<a href="javascript:validatePage();" ><span id="loginTips">[登录]</span></a> <a href="https://aq.91.com/NDUser_Register.aspx?url=http://gm.91.com" target="_top" >[注册]</a></div>'+
	            '<div class="clear"></div>\n';
	
	
	//导航菜单
	var navmenu = '<div class="nav">'+
	                '<div class="navcon">'+
		              '<ul>';
	for(var i=0; i<items.length; i++)
	{
	    if(items[i].SubMenus == null)
	    {
	        navmenu = navmenu + '<li><a href="'+ items[i].Url +'" target="'+ items[i].Target  +'">'+ items[i].Name +'</a></li>';
	    }
	    else
	    {
		    var newstr="<div style='position:absolute; top:0px; left:65px; width:19px; height:9px;z-index:999;overflow:inherit'><img src='http://image.91.com/www91/gm91/images/new081112.gif' border=0></div>"
		    var newstr2="<div style='position:absolute; top:0px; left:50px; width:19px; height:9px;z-index:999;overflow:inherit'><img src='http://image.91.com/www91/gm91/images/new081112.gif' border=0></div>"
    		
		    if(items[i].SubId=="quickServiceChild")
		    {
	            navmenu = navmenu + '<li class="father" onmouseover="showhidetool(\''+ items[i].SubId +'\',\'block\')" onmouseout="showhidetool(\''+ items[i].SubId +'\',\'none\')" ><a  href="#" >'+ items[i].Name +'</a>'+newstr+ items[i].SubMenus +'</li>';	    			
		    }
		    else if(items[i].SubId=="spacemenu_no")
		    	{
	            navmenu = navmenu + '<li class="father" onmouseover="showhidetool(\''+ items[i].SubId +'\',\'block\')" onmouseout="showhidetool(\''+ items[i].SubId +'\',\'none\')" ><a  href="'+ items[i].Url +'" target="'+ items[i].Target  +'">'+ items[i].Name +'</a>'+newstr2+ items[i].SubMenus +'</li>';		    	
		    	}
		    else
		    {
	            navmenu = navmenu + '<li class="father" onmouseover="showhidetool(\''+ items[i].SubId +'\',\'block\')" onmouseout="showhidetool(\''+ items[i].SubId +'\',\'none\')" ><a  href="#" >'+ items[i].Name +'</a>'+ items[i].SubMenus +'</li>';	    			
		    }
	    }
	}
	
	navmenu = navmenu + '</ul>'+
		            '<div class="clear"></div>'+
	              '</div>'+
              '</div>';
    var header91 ='<script language="javascript" type="text/javascript">topMenu("91资讯中心 官方网站 gm.91.com 天晴数码娱乐公司","http://gm.91.com","_blank",2);</script>';
              
    var str= header91 + '<div id="all">\n'+ 
    '<div id="header" class="wapper">\n'+
            login +
            navmenu +
            '</div>' +
            '</div><script language="javascript" type="text/javascript">loginTips_show();</script>';
    
    document.write(str);
}
var loginstatus = 0;
//设置登陆提示
function loginTips_show()
{
    var timeid
    if(!GetCookie("GM91NickName"))
    {
        if(loginstatus==0)
        {
            document.getElementById("loginTips").style.cssText = "color:red;font-weight:bold;" ;
            loginstatus = 1;
        }
        else
        {
            document.getElementById("loginTips").style.cssText = "color:black;font-weight:bold;" ;
            loginstatus = 0;
        }
        timeid = setTimeout("loginTips_show()", 3000);
    }
    else
    {
        clearTimeout(timeid);
    }
}

//退出GM站点
 function loginout()
 {         
     top.location.href="/Member/LoginAction.aspx?action=loginout";
 }
//输出底部
function initFooter()
{
    publicBottom(site.www, 750, "_blank");
	var strStat='<div style="display:none;">'
			   +'<script type="text/javascript" language="javascript" src="http://js.aiya.com.cn/stat.js"></script>'	
			   +'<noscript><img src="http://logs.aiya.com.cn/a?ci=nd" alt="" /></noscript>'
			   +'</div>';
	document.write(strStat);
}
//弹出参与共建的窗口
function popSuggest()
{     
    winEntry = _window.Open("[url]/Suggest/AddSuggest.aspx","邀您参与共建计划","width=500, height=490");
}

//--------------登陆信息提示---------------------------
function getLoginStateTip()
{
    var loginState = '';
    var nickName = GetCookie("GM91NickName");
    if(nickName)
    {
        loginState = '<b>'+ nickName +'</b>,欢迎您进入个人中心';
    }
    else
    {
        loginState = '<b>您还未登录</b>，请您点击<a href="javascript:validatePage();"><span style="color:red;font-size:18px;font-weight:bold;">登录</span></a>体验更多服务！';
    }
    document.write(loginState);
}

//--------------cookie相关-----------------------------
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;
}
function getCookieVal(offset)
{
	var endstr = document.cookie.indexOf(";",offset);
	{
		if(endstr == -1)
			endstr = document.cookie.length;
		return  decodeURI(document.cookie.substring(offset,endstr));
	}
}
//-------------－验证登陆中转页面--------------------------

//所有页首登陆中转
function validatePage()
{
    var localUrl = document.URL.toLowerCase();
    localUrl = localUrl.substring(localUrl.lastIndexOf("/")+1);
    var currentlen = localUrl.indexOf("?");
    if(currentlen<1)
        currentlen = localUrl.length;
        
    var currentPage = localUrl.substring(0,currentlen);
    if(currentPage !=null && currentPage !="")
    {
        currentPage = currentPage.toLowerCase();
    }
    
    var returnUrl = "";
    switch(currentPage)
    {
        case "onlineservice.aspx":
            returnUrl = getReturnUrl();
            break;
        case "servicelist.aspx":
            returnUrl = siteUrl+"/MyQuestion/OnlineService.aspx?action=onlineservice";
            break;
        case "serviceintro.aspx":
            returnUrl = siteUrl+"/MyQuestion/OnlineService.aspx?action=contact";
            break;
        default:
            returnUrl = document.URL.toLowerCase();
            break;
    }    
    top.location.href = "/Login.aspx?Type=1&ReturnUrl=" + escape(returnUrl);
}

//判断返回地址操作
function getReturnUrl()
{
    var localUrl = document.URL.toLowerCase();
    var localLen = localUrl.indexOf("?");
    if(localLen<1)
        localLen =  localUrl.length;
    localUrl = localUrl.substring(0,localLen);
    
    var frameDocumentSrc=document.getElementById("contentFrame").contentWindow.document.URL.toLowerCase();
    var folder =  frameDocumentSrc.substring(0,frameDocumentSrc.lastIndexOf("/"));
    folder = folder.substring(folder.lastIndexOf("/")+1);
    var currentUrl = frameDocumentSrc.substring(frameDocumentSrc.lastIndexOf("/")+1);
    
    var currentlen = currentUrl.indexOf("?");
    if(currentlen<1)
        currentlen = currentUrl.length;
         
    var currentPage = currentUrl.substring(0,currentlen);
    if(currentPage !=null && currentPage !="")
    {
        currentPage = currentPage.toLowerCase();
    }
    var returnUrl;
    switch(currentPage)
    {
        case "servicelist.aspx":
            var gamecode = QueryStringbyUrl("GameCode",frameDocumentSrc);
            if(gamecode!=null && gamecode!="")
            {
                gamecode = "?action=questionadd&GameCode=" + gamecode;
            }
            else
            {
                gamecode = "?action=onlineservice";
            }
            returnUrl =  localUrl + gamecode;
            break;
        case "questionquery.aspx":
            returnUrl =  localUrl + "?action=questionquery";
            break;
        case "gmassistantlist.aspx":
            returnUrl =  localUrl + "?action=punishquery&GameCode=110";
            break;
        case "gmassistantlistjz.aspx":
            returnUrl =  localUrl + "?action=punishquery&GameCode=111";
            break;
        case "serviceintro.aspx":
            returnUrl =  localUrl + "?action=contact";;
            break;
        case "serverstate.aspx":
            returnUrl =  localUrl + "?action=serverstate"
            break;
        case "telprogram.aspx":
            returnUrl =  localUrl + "?action=telservice"
            break;
        default:
            returnUrl =  localUrl + "?action=onlineservice"
            break;
    }
    return returnUrl;
}

function initClubArea(){
    var uid = GetCookie("GM91UID");
    if(uid==null){
        var clubHtml=    
        '<div class="clubtitle"><span>推荐公会</span><span class="more"><a target="_blank" href="'+ClubConfigObj.ClubListUrl+'">更多>></a></span></div>'+
        '<div class="content">'+
        '    <ul>';
        var num=ClubObj.bestClub.length,it;
        if(num>5) num=5;
        for(var i=0;i<num;i++){
            it=ClubObj.bestClub[i];
            clubHtml+=
        '        <li '+(i==num-1?'class="noborder"':'')+'><a target="_blank" href="'+it.url+'">'+it.name+'</a></li>';
        }
        clubHtml+=
        '    </ul>'+
        '</div>';
        document.write(clubHtml);
    }else{
        //include("http://192.168.30.102:93/ClubApi/UserClubList.ashx?uin=47002716");
        include("http://gh.kx.91.com/clubapi/userclublist/"+uid+".js");
        writeMyClub();
    }
}

var G_DELAY=0;
function writeMyClub(){
    if(typeof myClubList == 'undefined' && G_DELAY < 50){
        setTimeout("writeMyClub()",10);
        G_DELAY+=10;
        return;
    }
    var clubHtml=    
    '<div class="clubtitle"><span>我的公会</span><span class="more"><a target="_blank" href="'+ClubConfigObj.ClubListUrl+'">更多>></a></span></div>'+
    '<div class="content">'+
    '    <ul>';
    var numMy=0,it;
    if(G_DELAY<=50 && typeof myClubList != 'undefined' && myClubList.length>0){
        numMy=myClubList.length;
        if(numMy>5) numMy=5;
        for(var i=0;i<numMy;i++){
            it=myClubList[i];
            clubHtml+=
        '        <li '+(i==4?'class="noborder"':'')+'><a target="_blank" href="'+it.url+'">'+it.name+'</a></li>';
        }
    }
    if(numMy<5){
        var num=5-numMy;
        var numBest=ClubObj.bestClub.length;
        if(numBest<num) num=numBest;
        for(var i=0;i<num;i++){
            it=ClubObj.bestClub[i];
            clubHtml+=
        '        <li '+(i==num-1?'class="noborder"':'')+'><a target="_blank" href="'+it.url+'">'+it.name+'</a></li>';
        }
    }
    clubHtml+=
    '    </ul>'+
    '</div>';
    document.getElementById("divClub").innerHTML=clubHtml;
}
function include(fileName){
	var w = window, x = w.XMLHttpRequest, da;
	if (x && w.opera) {
		x = new XMLHttpRequest();
		x.open('GET', u, false);
		x.async = false;
		x.send('');
		da = x.responseText;

		// Evaluate script
		if (!w.execScript) {
			try {
				eval.call(w, da);
			} catch (ex) {
				eval(da, w); // Firefox 3.0a8
			}
		} else
			w.execScript(da); // IE
	} else{
		document.write('<script type="text/javascript" src="'+fileName+'"></script>');
    }
}
