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 openonce;

var switchpage = function(o, n, p){
	var ol = $(o+p);
	var cl = $(o+n);
	ol.style.display="none";
	cl.style.display="";
}
var toggle = function(bool) {
	var so = document.getElementById("Notice");
	so.style.top = "200px"; 
	var v = ((bool || (so.style.visibility == "hidden")) ? "visible" : "hidden");
	so.style.visibility = v; 
}
var p1 = 1;
function page1(num){
   var ifin = document.getElementById("iframetoggle");   
   var label = new Array('<span class=hot>11</span>','ABCD','EFGH','IJKL','MNOP','QRST','WXYZ');
   var length = label.length;
   var bl = new Array();
   p1 = num;
   ifin.src="http://feature.mmosite.com/templates/gamelist.html?page=" + num;
   
}
function win_open_bug(){
	var toUrl = 'http://report.help.mmosite.com/bug_report.htm?backurl='+escape(top.window.location.href);
	window.open(toUrl);
}
function announcement() {
	$('announcement').innerHTML = '<marquee style="filter:progid:DXImageTransform.Microsoft.Alpha(startX=0, startY=0, finishX=10, finishY=100,style=1,opacity=0,finishOpacity=100); margin: 0px 8px" direction="left" scrollamount="2" scrolldelay="1" onMouseClick="this.stop();" onMouseOut="this.start();">' +
		$('announcement').innerHTML + '</marquee>';
	$('announcement').style.display = 'block';
}
function $(id) {
	return document.getElementById(id);
}

var nowPages=1;
function showpages(num){
	var old_layer    = document.getElementById("pages"+nowPages);
	var current_layer= document.getElementById("pages"+num);
	old_layer.style.display="none";
	current_layer.style.display="";
	nowPages=num;
}

function switchmenu(obj){
        if(document.getElementById){
        var el = document.getElementById(obj);
        var ar = document.getElementById("maindiv").getElementsByTagName("span"); 
                if(el.style.display != "block"){
                        for (var i=0; i<ar.length; i++){
                                if (ar[i].className=="submenu") 
                                ar[i].style.display = "none";
                        }
                        el.style.display = "block";
                }else{
                        el.style.display = "none";
                }
        }
}
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);   
  }   
  }   
 
function highjs(which2){
theobject=which2
if(isIE){
highlighting=setInterval("highlightitjs(theobject)",10)
}else{
highlighting=setInterval("highlightitjs(theobject)",250)
}
}
function highlightitjs(cur2){

if(isIE){
if(div.filters.alpha.opacity>=80){showif();}
}else{
if(cur2.style.MozOpacity>=0.8){showif();}
}

if(isIE){
if (cur2.filters.alpha.opacity<80)
cur2.filters.alpha.opacity+=8
else if (window.highlighting)
clearInterval(highlighting)

}else{
if (cur2.style.MozOpacity<0.8)
cur2.style.MozOpacity+=0.4
else if (window.highlighting)
clearInterval(highlighting)
}

}
function showif(){
//alert('!!');
if (openonce != true){
if(isIE){

var bott = document.createElement('<iframe width="750" height="800" frameborder="0" src="http://feature.mmosite.com/templates/gamelist.html" allowtransparency="true" id="iframetoggle" style="height:800px"></iframe>');
$('iframeout').insertBefore(bott);
}else{
iframe = document.createElement("iframe");
iframe.setAttribute("src",'http://feature.mmosite.com/templates/gamelist.html');
iframe.setAttribute("id",'iframetoggle');
iframe.setAttribute("allowtransparency",'true');
iframe.setAttribute("width",'750');
iframe.setAttribute("height",'800');
iframe.setAttribute("frameborder",'0');
//div = document.createElement("iframe");
$('iframeout').appendChild(iframe);
}
$('load').style.display = ""
}
openonce=true;
}
function hideqlist(){
$('Notice').style.visibility="hidden";
if(!div || !div.parentNode) return;
div.parentNode.removeChild(div)
}
function showqlist(){
$('Notice').style.visibility="";
div = document.createElement("DIV");
div.className = "allbg";
highjs(div);
showif();
div.style.height = document.body.offsetHeight;	
div.onclick = function(){hideqlist();}
$('Notice').onclick = function(){hideqlist();}
document.body.appendChild(div);
showFlash('load','http://images.mmosite.com/feature/images/loadding.swf','52','50','1');
}
function showFlash(ID,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 wmode="transparent" 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>';

$(ID).innerHTML=flash; 
//alert(flash);
}






