function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var mainTableTdWidth=""; //每个TD的宽度，调整主导航内容间距
var mainTableBorder=0; //调整主导航表格边框宽度
var mainTableCellspacing=0; //调整主导航表格Cellspacing
var mainTableCellpadding=1; //调整主导航表格Cellpadding
var mainTableBgcolor=""; //调整主导航表格背景色
var mainTableBordercolor=""; //调整主导航表格编框颜色
var mainTableBackgroundImg=""; //调整主导航表格背景图片url地址
var hrefClassName="link" //调整url风格样式
var mainTableTdBgcolor=""; //调整主导航表格Td色
var mainTableIcofile="/images/topmenu_dot.gif"; 

MM_preloadImages(mainTableIcofile);

var menuitem0=new Array();
var menuitem0url=new Array();

var menuitem1=new Array('热点新闻','游戏公告','服务器状态','新闻提交');
var menuitem1url=new Array('/7/1003/59/column214445962.shtml','/service/bulletin/bulletin.php','javascript:;','javascript:;');

var menuitem2=new Array('游戏特点','背景故事','种族','技能','道具','任务','竞技','擂台','魔物','教派','地图','阵法','格斗技巧');
var menuitem2url=new Array('/game/index.shtml','/game/background.shtml','/game/race.shtml','/game/skill_ren.shtml','/game/item.shtml','/game/mission.shtml','/game/arena.shtml','/game/leitai.shtml','/game/monster.shtml','javascript:;','/game/map.shtml','/game/formation.shtml','javascript:;');

var menuitem3=new Array('等级帮助','常见问题','战斗','技能','属性','道具','社会关系','快捷键','聊天快捷符');
var menuitem3url=new Array('index.shtml','/guide/faq.shtml','/guide/fight.shtml','/guide/skill.shtml','/guide/property.shtml','/guide/prop.shtml','/guide/relation.shtml','/guide/system.shtml','/guide/key.shtml','/guide/talk_key.shtml');

var menuitem4=new Array();
var menuitem4url=new Array();

var menuitem5=new Array('常见问题','客服公告','服务流程','防盗防骗','停权名单','联系方式');
var menuitem5url=new Array('/service/faq/faq.php','/service/bulletin/bulletin.php','javascript:;','/service/protect.shtml','javascript:;','/service/contact.shtml');

var menuitem6=new Array();
var menuitem6url=new Array();

var menuitem7=new Array('客户端/补丁','游戏影音','游戏截图','桌面壁纸','手机铃声','手机图片','手机动画','网站素材');
var menuitem7url=new Array('/download/list1.php?sort=1&subsort=6','/download/list1.php?sort=2&subsort=8','http://club.sde.sohu.com/pic_up/download_pic.php?pic_game=bo','/download/list4.php?sort=4&subsort=18','http://mms.sohu.com/seek.php?key_words=%B5%B6%BD%A3&kind=ring&project=sohu&imageSubmit.x=15&imageSubmit.y=11','http://mms.sohu.com/pic/2457/2/001.html','http://mms.sohu.com/ani/2458/2/001.html','javascript:;');

var menuitem8=new Array('上手指南','高手进阶','心情故事');
var menuitem8url=new Array('/game/','javascript:;','/7/1003/89/column214448945.shtml');

var menuitem9=new Array('刀剑总坛','武技交流','教派分坛');
var menuitem9url=new Array('http://bbs.bo.sohu.com','http://bbs.bo.sohu.com/list_art_sub.org.php?b=bo_wg','javascript:;');

var menuitem10=new Array();
var menuitem10url=new Array();

var menuitem11=new Array();
var menuitem11url=new Array();

function showmenu(obj,menunum)
{
	mitem=eval("menuitem"+menunum);
	mitemurl=eval("menuitem"+menunum+"url");

	var mcontent = "";
	var mcount = "";
	if (mitem.length!=0)
	{
		var tmp_mlength=0;
		for (var i=0;i<mitem.length;i++)
		{
			var urltarget="";
			if (mitemurl[i]!="javascript:;")
				var urltarget="target=_blank";
			mcontent+= "&nbsp;<img border=0 width=7 height=7 src="+mainTableIcofile+">&nbsp;<a href="+mitemurl[i]+" "+urltarget+" onclick=setmenu("+menunum+")>"+mitem[i]+"</a>&nbsp;";
			tmp_mlength = tmp_mlength + 24 + (12*mitem[i].length);
		}
		//alert(tmp_mlength);
		//alert(mcount);
	}
	
	if (menunum<5){
		mlength=60*(menunum-2);
	}
	else{
		mlength=710-tmp_mlength;
	}
	mtabhead="<table border=0 cellspacing=1 cellpadding=2><tr>"
	mtableft="<td width="+mlength+"> </td>";
	mtabright="<td Height=20>";
      	mtabbottom="</td></tr></table>";
      	
      	obj.innerHTML=mtabhead+mtableft+mtabright+mcontent+mtabbottom;
      	
}

function setmenu(menunum)
{
	var menu_cookie="bo_menu="+ escape(menunum);
	document.cookie=menu_cookie;
}

function getmenu()
{
	if(document.cookie=='')
		return 1;
	else
		//return document.cookie;
		return WM_getCookieValue('bo_menu');
}

function WM_getCookieValue(name)
{

	// Declare variables.
	var firstChar,lastChar;
	// Get the entire cookie string.
	// (This may have othername=value pairs in it.)

	var theBigCookie = document.cookie;

	// Grab just this cookie from theBigCookie string.

	// Find the start of 'name'.

	firstChar = theBigCookie.indexOf(name);

	// If you found it,

	if(firstChar != -1)
	{
	// skip 'name' and '='.
		firstChar +=name.length + 1;
	// Find the end of the value string (i.e. the next';').
		lastChar = theBigCookie.indexOf(';', firstChar);
	
		if(lastChar == -1) lastChar = theBigCookie.length;
	// Return the value.
		return theBigCookie.substring(firstChar, lastChar);
	}
	else
	{
	// If there was no cookie, return false.
		return 0;
	}
}

function menuover(menunum)
{
	mitem=eval("menuline"+menunum);
	mitem.className="topmenu_line2";
}

function menuout(menunum)
{
	mitem=eval("menuline"+menunum);
	mitem.className="topmenu_line1";
}