////////////////////////////////////////////////////////////////////////////////// tab.js////////////////////////////////////////////////////////////////////////////////////
var $ = function(i){return document.getElementById(i);}
var ua = navigator.userAgent.toLowerCase();
var isIE = (ua.indexOf("msie") > -1),isIE7 = (ua.indexOf("msie 7") > -1),isOpera = (ua.indexOf("opera") > -1),isSafari = (ua.indexOf("webkit") != -1 || ua.indexOf("khtml") != -1),isGecko = (!isSafari && ua.indexOf("gecko") > -1);


/*变换连接*/
function setTab(m,n){
var tli=document.getElementById("tabmenu"+m).getElementsByTagName("li");
var mli=document.getElementById("tabmains"+m).getElementsByTagName("ul");
for(i=0;i<tli.length;i++){

   try { mli[i].style.display= i==n?"block":"none";} catch(err) { }

   tli[i].className= i==n?'on':'none';
   
  
}
}


/////////////////////////////////////////////////////////////////////////left_menu.js//////////////////////////////////////////////////////////////////////////////////
  <!--   
  function   myAddPanel(title,url,desc)   
  {   
  if   ((typeof   window.sidebar   ==   'object')   &&   (typeof   window.sidebar.addPanel   ==   'function'))//Gecko   
  {   
  window.sidebar.addPanel(title,url,desc);   
  }   
  else//IE   
  {   
  window.external.AddFavorite(url,title);   
  }   
  }   
  //--> 

///////////////////////////////////////////////////////////////////////tab_other.js//////////////////////////////////////////////////////////////////////////////////

var $ = function(i){return document.getElementById(i);}
var ua = navigator.userAgent.toLowerCase();
var isIE = (ua.indexOf("msie") > -1),isIE7 = (ua.indexOf("msie 7") > -1),isOpera = (ua.indexOf("opera") > -1),isSafari = (ua.indexOf("webkit") != -1 || ua.indexOf("khtml") != -1),isGecko = (!isSafari && ua.indexOf("gecko") > -1);


var switchpage = function(o, n, p){
   var ol = $(o+p);
   var cl = $(o+n);
   ol.style.display="none";
   cl.style.display="";
}

var p1 = 1;
function page1(num){   
   switchpage("p1_", num, p1);
   p1 = num;
}
var p2 = 1;
function page2(num){   
   switchpage("p2_", num, p2);
   p2 = num;
}
var p3 = 1;
function page3(num){   
   switchpage("p3_", num, p3);
   p3 = num;
}

///////////////////////////////////////////////////////////////////////////////////////mymenu.js///////////////////////////////////////////////////////////////////////////////////////////
//* top menu related js*//
function videoHeader(){
mmoHeader()
}
function videoFooter(){
mmoFooter()
}
//* top menu related js*//



/*****************************************************
 * mySlideOutMenu
 * http://mySlideOutMenus.sourceforge.net/
 * 
 * a nice little script to create exclusive, slide-out
 * menus for ns4, ns6, mozilla, opera, ie4, ie5 on 
 * mac and win32. I've got no linux or unix to test on but 
 * it should(?) work... 
 *
 * Licensed under AFL 2.0
 * http://www.opensource.org/licenses/afl-2.0.php
 *
 * Revised: 
 * - 08/29/2002 : added .hideAll()
 * - 04/15/2004 : added .writeCSS() to support more 
 *                than 30 menus.
 *
 * --youngpup--
 *****************************************************/

mySlideOutMenu.Registry = []
mySlideOutMenu.aniLen = 250
mySlideOutMenu.hideDelay = 500
mySlideOutMenu.minCPUResolution = 10

// constructor
function mySlideOutMenu(id, dir, left, top, width, height)
{
	this.ie  = document.all ? 1 : 0
	this.ns4 = document.layers ? 1 : 0
	this.dom = document.getElementById ? 1 : 0
	this.css = "";

	if (this.ie || this.ns4 || this.dom) {
		this.id			 = id
		this.dir		 = dir
		this.orientation = dir == "left" || dir == "right" ? "h" : "v"
		this.dirType	 = dir == "right" || dir == "down" ? "-" : "+"
		this.dim		 = this.orientation == "h" ? width : height
		this.hideTimer	 = false
		this.aniTimer	 = false
		this.open		 = false
		this.over		 = false
		this.startTime	 = 0

		// global reference to this object
		this.gRef = "mySlideOutMenu_"+id
		eval(this.gRef+"=this")

		// add this menu object to an internal list of all menus
		mySlideOutMenu.Registry[id] = this

		var d = document

		var strCSS = "";
		strCSS += '#' + this.id + 'Container { visibility:hidden; '
		strCSS += 'left:' + left + 'px; '
		strCSS += 'top:' + top + 'px; '
		strCSS += 'width:' + width + 'px; '
		strCSS += 'height:' + height + 'px; '		
		strCSS += 'overflow:hidden; z-index:10000; }'
		strCSS += '#' + this.id + 'Container, #' + this.id + 'Content { position:absolute; '
		strCSS += '}'

		this.css = strCSS;

		this.load()
	}
}

mySlideOutMenu.writeCSS = function() {
	document.writeln('<style type="text/css">');

	for (var id in mySlideOutMenu.Registry) {
		document.writeln(mySlideOutMenu.Registry[id].css);
	}

	document.writeln('</style>');
}

mySlideOutMenu.prototype.load = function() {
	var d = document
	var lyrId1 = this.id + "Container"
	var lyrId2 = this.id + "Content"
	var obj1 = this.dom ? d.getElementById(lyrId1) : this.ie ? d.all[lyrId1] : d.layers[lyrId1]
	if (obj1) var obj2 = this.ns4 ? obj1.layers[lyrId2] : this.ie ? d.all[lyrId2] : d.getElementById(lyrId2)
	var temp

	if (!obj1 || !obj2) window.setTimeout(this.gRef + ".load()", 100)
	else {
		this.container	= obj1
		this.menu		= obj2
		this.style		= this.ns4 ? this.menu : this.menu.style
		this.homePos	= eval("0" + this.dirType + this.dim)
		this.outPos		= 0
		this.accelConst	= (this.outPos - this.homePos) / mySlideOutMenu.aniLen / mySlideOutMenu.aniLen 

		// set event handlers.
		if (this.ns4) this.menu.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
		this.menu.onmouseover = new Function("mySlideOutMenu.showMenu('" + this.id + "')")
		this.menu.onmouseout = new Function("mySlideOutMenu.hideMenu('" + this.id + "')")

		//set initial state
		this.endSlide()
	}
}
	
mySlideOutMenu.showMenu = function(id)
{
	var reg = mySlideOutMenu.Registry
	var obj = mySlideOutMenu.Registry[id]
	
	if (obj.container) {
		obj.over = true

		// close other menus.
		for (menu in reg) if (id != menu) mySlideOutMenu.hide(menu)

		// if this menu is scheduled to close, cancel it.
		if (obj.hideTimer) { reg[id].hideTimer = window.clearTimeout(reg[id].hideTimer) }

		// if this menu is closed, open it.
		if (!obj.open && !obj.aniTimer) reg[id].startSlide(true)
	}
}

mySlideOutMenu.hideMenu = function(id)
{
	// schedules the menu to close after <hideDelay> ms, which
	// gives the user time to cancel the action if they accidentally moused out
	var obj = mySlideOutMenu.Registry[id]
	if (obj.container) {
		if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
		obj.hideTimer = window.setTimeout("mySlideOutMenu.hide('" + id + "')", mySlideOutMenu.hideDelay);
	}
}

mySlideOutMenu.hideAll = function()
{
	var reg = mySlideOutMenu.Registry
	for (menu in reg) {
		mySlideOutMenu.hide(menu);
		if (menu.hideTimer) window.clearTimeout(menu.hideTimer);
	}
}

mySlideOutMenu.hide = function(id)
{
	var obj = mySlideOutMenu.Registry[id]
	obj.over = false

	if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
	
	// flag that this scheduled event has occured.
	obj.hideTimer = 0

	// if this menu is open, close it.
	if (obj.open && !obj.aniTimer) obj.startSlide(false)
}

mySlideOutMenu.prototype.startSlide = function(open) {
	this[open ? "onactivate" : "ondeactivate"]()
	this.open = open
	if (open) this.setVisibility(true)
	this.startTime = (new Date()).getTime()	
	this.aniTimer = window.setInterval(this.gRef + ".slide()", mySlideOutMenu.minCPUResolution)
}

mySlideOutMenu.prototype.slide = function() {
	var elapsed = (new Date()).getTime() - this.startTime
	if (elapsed > mySlideOutMenu.aniLen) this.endSlide()
	else {
		var d = Math.round(Math.pow(mySlideOutMenu.aniLen-elapsed, 2) * this.accelConst)
		if (this.open && this.dirType == "-")		d = -d
		else if (this.open && this.dirType == "+")	d = -d
		else if (!this.open && this.dirType == "-")	d = -this.dim + d
		else										d = this.dim + d

		this.moveTo(d)
	}
}

mySlideOutMenu.prototype.endSlide = function() {
	this.aniTimer = window.clearTimeout(this.aniTimer)
	this.moveTo(this.open ? this.outPos : this.homePos)
	if (!this.open) this.setVisibility(false)
	if ((this.open && !this.over) || (!this.open && this.over)) {
		this.startSlide(this.over)
	}
}

mySlideOutMenu.prototype.setVisibility = function(bShow) { 
	var s = this.ns4 ? this.container : this.container.style
	s.visibility = bShow ? "visible" : "hidden"
}
mySlideOutMenu.prototype.moveTo = function(p) { 
	this.style[this.orientation == "h" ? "left" : "top"] = this.ns4 ? p : p + "px"
}
mySlideOutMenu.prototype.getPos = function(c) {
	return parseInt(this.style[c])
}

// events
mySlideOutMenu.prototype.onactivate		= function() { }
mySlideOutMenu.prototype.ondeactivate	= function() { }

/*trans*/
function picon(id){
var ie=document.all?true:false;
if(ie){
id.filters.alpha.opacity=0
}else{
id.style.MozOpacity=0
}
}
function picoff(id){
var ie=document.all?true:false;
if(ie){
id.filters.alpha.opacity=100
}else{
id.style.MozOpacity=1
}
}




///////////////////////////////////////////////////////////////////////mmosite.com.public.js////////////////////////////////////////////////////////////////////////////
/*  
Toplink Offical JS for MMOsite
Use for: mmosite.com
Version: 3.0
Date: 2007/10/14 11:49:00
Author: 33
*/


//Get the document id
function getId(id) {
	return document.getElementById(id);
}

//bugreport
function winOpenBug(){
	var toUrl = 'http://report.help.mmosite.com/bug_report.htm?backurl='+escape(top.window.location.href);
	window.open(toUrl);
}

//mmoPop
function mmoPop(num){
	if (num ==1){
	document.getElementById("moregbi").style.display = "block"
	}else{
	document.getElementById("moregbi").style.display = "none"
	}
}

//Add to favorite
function myAddPanel(homeName, homePage){
	if((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))//Gecko
		window.sidebar.addPanel(homeName,homePage,"");
	else//IE
		window.external.AddFavorite(homePage,homeName);
}

//setHomePage
function setHomePage(obj,siteUrl)
{
	var ua = navigator.userAgent.toLowerCase();
	var isIE = (ua.indexOf("msie") > -1),isIE7 = (ua.indexOf("msie 7") > -1),isOpera = (ua.indexOf("opera") > -1),isSafari = (ua.indexOf("webkit") != -1 || ua.indexOf("khtml") != -1),isGecko = (!isSafari && ua.indexOf("gecko") > -1);

  if(isIE){
	  var strHref=window.location.href;obj.style.behavior='url(#default#homepage)';obj.setHomePage(siteUrl);
  }else{
		  if(window.netscape){
			  try {  
				  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
			  }  catch (e)  {  
				  alert("Dear user,the copy function fails under firefox browser!\nPlease input 'about:config? in the browser address\n and press enter and set \n'[signed.applets.codebase_principal_support]' to 'true'.");  
			  }
		  }
			  var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
			  prefs.setCharPref('browser.startup.homepage',siteUrl);
          }
		  
}


//ShowFlash
function showFlash(iUrl,iWidth,iHeight,iWmode)
{
	var flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ iWidth +'" height="' + iHeight +'" />';
	flash = flash + '<param name="movie" value="'+ iUrl +'" />';
	flash = flash + '<param name="quality" value="high" />';
	flash = flash + '<param name="menu" value="false" />';
	if (iWmode == 1) {
	   flash = flash + '<param name="wmode" value="transparent" />';      
	}
	flash = flash + '<embed src="' + iUrl + '" width="'+ iWidth +'" height="'+ iHeight +'" menu="false" quality="high" ';
	if (iWmode == 1) {
	   flash = flash + 'wmode="transparent" ';      
	}
	flash = flash + ' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" mwode="transparent"></embed>';
	flash = flash + '</object>';
	
	document.writeln(flash); 
	//alert(flash);
}

/*Bg links*/
function bgclick(absoluteleft,id,bgheight,linkurl,fscroll,dtd,adddiv){

	var ua = navigator.userAgent.toLowerCase();
	var isIE = (ua.indexOf("msie") > -1),isIE7 = (ua.indexOf("msie 7") > -1),isOpera = (ua.indexOf("opera") > -1),isSafari = (ua.indexOf("webkit") != -1 || ua.indexOf("khtml") != -1),isGecko = (!isSafari && ua.indexOf("gecko") > -1);
 
	var  str =  document.createElement("div");   
	if(dtd == 1){
	  var allwidth = document.documentElement.clientWidth-1002;
	}else{
	  var allwidth = document.body.clientWidth-1002;
	}
	
	if( document.body.clientWidth > 990 ) document.body.style.overflowX = "hidden";
	if( isIE ){ 
		var bgwidth = allwidth / 2; 
	}  else{ 
		var bgwidth = allwidth / 2 - 10; 
	}
	
	
	if( absoluteleft == "rightwidth"){
	  absoluteleft  = allwidth - bgwidth + 1002  + "px";
	}
	str.id   =   id;
	str.style.cursor = "pointer";
	str.style.position   =   "absolute";
	str.style.top = '0px';
	str.style.left = absoluteleft; 
	if(bgwidth > 0){ 
		str.style.width = bgwidth -4 + "px"; 
	} 
	str.style.height = bgheight + "px";  
	str.style.cursor = "pointer";
	//str.style.border = "1px solid #000";
	str.onclick=function()  { window.open (linkurl);}
	
	if(adddiv){
		document.getElementById(adddiv).appendChild(str);
	} else {
		document.body.appendChild(str);
	}

 }


//mmoHeader
function autoBgHeight(){
	docbody = document.body;
	Elebody = document.documentElement;
  if( getId('flashdiv1'))	{  	 
	  if(docbody.scrollHeight != 'undefined'){	
		  getId('flashdiv1').style.height =  docbody.scrollHeight  - 2 + "px"
		  getId('flashdiv2').style.height =  docbody.scrollHeight - 2 + "px"		    			
	  }else{
		  getId('flashdiv1').style.height =  Elebody.scrollHeight  - 2 + "px"
		  getId('flashdiv2').style.height =  Elebody.scrollHeight - 2 + "px" 
	  }
  }	 
}

//mmoHeader
function mmoHeader(){


	var tp = [];
	tp[0] = '<style type="text/css">#top_cute_menu li a { font-size:11px; font-family: arial, verdana, sans-serif; font-weight:normal }#top_cute_menu { width:100%; height:28px; text-align:center; background:url(http://images.mmosite.com/www/toplink/bg2.gif) repeat-x top left; border-top:1px solid #aca889; }#top_cute_menu .smenu { width:1002px; position:relative; margin-left:auto; margin-right:auto; }#top_cute_menu .smenu ul { padding:0; margin:0; margin-left:4px; list-style-type:none; float:left; position:relative; }#top_cute_menu .smenu ul li { float:left; position:relative; display:inline; background:url(http://images.mmosite.com/www/toplink/bgd.gif) no-repeat bottom right;letter-spacing: 0px; }#top_cute_menu .smenu ul li a, #top_cute_menu .smenu ul li a:visited { float:left; display:block; text-decoration:none; color:#000; color:#666; padding:0px 12px 0 12px;line-height:26px; height:28px; letter-spacing: 0px; font-size:11px; }#top_cute_menu .smenu ul li a:hover { letter-spacing: 0px;color:#06f; background: transparent url(http://images.mmosite.com/www/toplink/bg2.gif) top left repeat-x; background-position:0 -26px; }#top_cute_menu #home { width:90px; }#top_cute_menu #home a, #top_cute_menu #home a:visited {  width:40px; padding: 0px 0px 0 4px;background:url(http://images.mmosite.com/www/set_home.gif) no-repeat 3px 50%; padding-left:25px!important;padding-left:25px; font-weight:bold; font-family:tahoma; }#top_cute_menu #home a:hover { background:url(http://images.mmosite.com/www/set_home.gif) no-repeat 3px 50%; }#top_cute_menu .smenu ul li.bgnone{background:none}#top_cute_menu .smenu ul li.topmore{ background:url(http://images.mmosite.com/www/toplink/more.gif) no-repeat 0 5px; width:58px; height:22px; padding-left:9px;position:relative}#top_cute_menu .smenu ul li.topmore a:hover{ background:none; }.moregbi{border:1px solid #ADADAD; width:63px; left:-5px;;top:25px; position:absolute; background:#fff; display:none;overflow:hidden; z-index:10000}.moregbi a{ display:block; border-bottom:1px solid #ccc; padding:0; margin:0;}';	
	if (document.compatMode == "BackCompat") {
	tp[0] += '.moregbi a{width:40px!important;width:63px}';
	}else{
	tp[0] += '.moregbi a{width:40px;}'	
	}
	tp[0] += '</style>'	

	tp[1] = '<div id="menu_container"><div id="top_cute_menu">  <div class="smenu"><ul><li id="home"><a href="http://www.mmosite.com/" title="Back to MMOsite home!">MMOsite</a></li><li><a href="http://answer.mmosite.com/">Answer</a></li><li><a href="http://my.mmosite.com/" style="color:#CC0000;font-size:11px">Blog</a></li><li><a href="http://contest.mmosite.com/">Contest</a></li><li><a href="http://db.mmosite.com/">DataBase</a></li><li><a href="http://download.mmosite.com/">Download</a></li><li><a href="http://feature.mmosite.com/">Feature</a></li><li><a href="http://forum.mmosite.com/">Forum</a></li><li><a href="http://gamelist.mmosite.com/">Gamelist</a></li><li><a href="http://accounts.mmosite.com" style="color:#CC0000;font-size:11px">MyCenter</a></li><li><a href="http://mygame.mmosite.com/">MyGame</a></li><li><a href="http://news.mmosite.com/">News</a></li><li><a href="http://photo.mmosite.com/">Photo</a></li><li><a href="http://shop.mmosite.com/" style="color:#CC0000;font-size:11px">Shop</a></li><li  class="bgnone"><a href="http://video.mmosite.com/">Video</a></li><li class="topmore"><a href="#" onmouseover="mmoPop(1)" onmouseout="mmoPop(0)">More</a><div class="moregbi" id="moregbi" onmouseover="mmoPop(1)" onmouseout="mmoPop(0)"><a href="http://top100.mmosite.com/">Top 100</a><a href="http://company.mmosite.com/">Company</a><a href="http://vote.mmosite.com/">Vote</a><a href="http://help.mmosite.com/">Help</a><a href="http://search.mmosite.com/">Search</a><a href="http://webgame.mmosite.com/">WebGame</a></div></li></ul></div></div></div>';

	return document.writeln(tp.join(''));

};


//Footer
function mmoFooter(){
	var cs = [];
	cs[0] = "<style>#mmo_bottom{width:100%; text-align:center; font-size:12px; font-family:Tahoma}#mmo_bottom .copyright{ width:490px; float:left; padding-top:6px;}#mmo_bottom .logo{ width:50px; height:41px; float:left;}html>body #mmo_bottom .logo{background:url(\"http:\/\/images.mmosite.com\/www\/mmologo.png\") no-repeat;}* html #mmo_bottom .logo {filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src=\"http:\/\/images.mmosite.com\/www\/mmologo.png\");background:none;}<\/style>";
	cs[1] = "<div id=\"mmo_bottom\"><div style=\"width: 95%; font-weight:bold;text-align:right;position:relative\"><div style=\"z-index:1;position:absolute;right:40px;top:15px\"><A onclick=scroll(0,0) href=\"#\" id=\"scalltotop\"><img src=\"http://images.mmosite.com/www/images/totop.gif\" border=\"0\" class=\"mmototop\"> Top</a></div></div><div style=\"width:600px; margin-left:auto; margin-right:auto\"><div class=\"logo\"><\/div><div class=\"copyright\">2005-2008 MMOsite.com All Rights Reserved <br \/><a href=\"http:\/\/www.mmosite.com\/about\/sitemap.shtml\" target=\"_blank\"><strong>Site   Map<\/strong><\/a> | <a href=\"http:\/\/www.mmosite.com\/about\/contact.shtml\" target=\"_blank\"><strong>Contact Us<\/strong><\/a> | <a href=\"http:\/\/www.mmosite.com\/about\/index.shtml\" target=\"_blank\"><strong>About US<\/strong><\/a> | <a href=\"http:\/\/www.mmosite.com\/about\/useragreement.shtml\" target=\"_blank\"><strong>User Agreement<\/strong><\/a> | <a href=\"http:\/\/www.mmosite.com\/about\/adsolution.shtml\" target=\"_blank\"><strong>Advertise<\/strong><\/a> | <a href=\"http:\/\/www.mmosite.com\/service\" target=\"_blank\"><strong>Service<\/strong><\/a><\/div><\/div><\/div>";
//aiya start
	cs[2] = "<div style=\"display:none\"><scr"+"ipt language='javascript' src='http://js.aiya.com.cn/stat.js'></scr"+"ipt><noscript><img src=\"http://logs.aiya.com.cn/a?ci=mmosite\" alt=\"\"><\/noscript><\/div>";
//aiya end
	return document.writeln(cs.join(""));
	
   //Script for bglink
   autoBgHeight();
	
}
 		 


