// JavaScript Document
function Jump()
{
	var num = parseInt(jump.gameid.options[jump.gameid.selectedIndex].value);
	if(num!=0)
		jump.submit();
}
  <!--   
  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 win_open_bug(){
   window.open("http://download.mmosite.com/report/bug3.shtml", null, "height=563, width=393, status=no, toolbar=no, menubar=no, location=no");
}

function showmore(){
    var detail0    = document.getElementById("detail0");
	var detail    = document.getElementById("detail");
	var detail2    = document.getElementById("detail2");
	detail.style.display="";
	detail2.style.display="none";
	document.getElementById("line1").style.height= 460 + detail0.clientHeight -60 + "px";
	document.getElementById("morepic").innerHTML="<img src=\"http://images.mmosite.com/download/images/less.gif\" border=\"0\" onClick=\"showless();\">";
}
function showless(){
	var detail    = document.getElementById("detail");
	var detail2    = document.getElementById("detail2");
	detail.style.display="none";
	detail2.style.display="";
	document.getElementById("line1").style.height="460px";
	document.getElementById("morepic").innerHTML="<img src=\"http://images.mmosite.com/download/images/more.gif\"  border=\"0\" onClick=\"showmore();\">";
}

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;
  
   
}

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 high(which2){
theobject=which2
if(isIE){
highlighting=setInterval("highlightit(theobject)",10)
}else{
highlighting=setInterval("highlightit(theobject)",250)
}
}
function highlightit(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://download.mmosite.com/gamelist.php" allowtransparency="true" id="iframetoggle" style="height:800px"></iframe>');
$('iframeout').insertBefore(bott);
}else{
iframe = document.createElement("iframe");
iframe.setAttribute("src",'http://download.mmosite.com/gamelist.php');
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";
document.body.style.overflow = '';
if(!div || !div.parentNode) return;
div.parentNode.removeChild(div)
}
function showqlist(){
document.body.style.overflow = 'hidden';
$('Notice').style.visibility="";
div = document.createElement("DIV");
div.className = "allbg";
high(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 = '<span style="position:absolute; z-index:5000""><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></span>';

$(ID).innerHTML=flash; 
//alert(flash);
}
function switch_bg(e){ 
   this.className = (this.className == "picon") ? "picoff" : "picon"; 
   //alert(this.className);
} 

//Set pic background orange
function Menu_Init(obj){ 
   var sobj = document.getElementById(obj);
   var tds = sobj.getElementsByTagName("td"); 
    for (var i = 0; i < tds.length; i++) 
     { 
	tds[i].className="picoff";
    tds[i].onmouseover = switch_bg; 
    tds[i].onmouseout = switch_bg; 
      }
} 
function downloadHeader(){
mmoHeader()
}
function downloadFooter(){
mmoFooter()
}

function showDownByWeekly(num){
	var id = '';
	var title = '';
	var downnum = '';
	var i=0;
	
	for(i=0;i<num;i++) {
		id= down_weekly[i]['id'];
		title = down_weekly[i]['title'];
		downnum = down_weekly[i]['downnum'];
		
		var str = "";
		
		str += '<li>';
		str += '<strong class="number">' + (i+1) + '.</strong>';
		str += '<a href="http://download.mmosite.com/download.php?id=' + id + '" class="title_hot" title="' + title + '">' + title + '</a>';
		str += '<span class="download_no">' + downnum + ' downloads</span>';
		str += '</li>';

		document.write( str );
    }

}

function showDownByMonthly(num){
	var id = '';
	var title = '';
	var downnum = '';
	var i=0;
	for(i=0;i<num;i++) {
		id= down_monthly[i]['id'];
		title = down_monthly[i]['title'];
		downnum = down_monthly[i]['downnum'];
		
		var str = "";
		
		str += '<li>';
		str += '<strong class="number">' + (i+1) + '.</strong>';
		str += '<a href="http://download.mmosite.com/download.php?id=' + id + '" class="title_hot" title="' + title + '">' + title + '</a>';
		str += '<span class="download_no">' + downnum + ' downloads</span>';
		str += '</li>';

		document.write( str );
    }
}

function showDownByWeekly_v3(num){
	var id = '';
	var title = '';
	var downnum = '';
	var i=0;
	
	var str = "";
	
	str += '<ul>';
							
	for(i=0;i<num;i++) {
		id= down_weekly[i]['id'];
		title = down_weekly[i]['title'];
		downnum = down_weekly[i]['downnum'];
		img = down_weekly[i]['img'];

		if( i == 0 ){
			str += '<li>';
			str += '	<dl class="topone">';
			str += '		<dt><a href="http://download.mmosite.com/download.php?id=' + id + '" title="' + title + '">' + title + '</a></dt>';
			str += '		<dd class="pic"><a href="http://download.mmosite.com/download.php?id='+ id +'" title=""><img src="'+img+'" alt="" /></a></dd>';
			str += '		<dd class="detail">';
			str += '			<p>CT Racer is a Sports PC-Game,Mobile Planet </p>';
			str += '			<p class="stat"><em>' + downnum + '</em>download</p>';
			str += '		</dd>';
			str += '	</dl>';
			str += '</li>';
			str += '';
			str += '';
		}else{
			str += '<li><strong class="number">' + (i+1) + '</strong>' + '<a href="http://download.mmosite.com/download.php?id=' + id + '" class="title_hot" title="' + title + '">' + title + '</a>' + '<span class="download_no">' + downnum + ' downloads</span></li>';
		}
    }
	
	str += '	<br class="clear" />';
	str += '</ul>';
	document.write( str );
}

function showDownByMonthly_v3(num){
	var id = '';
	var title = '';
	var downnum = '';
	var i=0;
	
	var str = "";
	
	str += '<ul>';
	
	for(i=0;i<num;i++) {
		id= down_monthly[i]['id'];
		title = down_monthly[i]['title'];
		downnum = down_monthly[i]['downnum'];
		img = down_monthly[i]['img'];
		
		if( i == 0 ){
			str += '<li>';
			str += '	<dl class="topone">';
			str += '		<dt><a href="http://download.mmosite.com/download.php?id=' + id + '" title="' + title + '">' + title + '</a></dt>';
			str += '		<dd class="pic"><a href="http://download.mmosite.com/download.php?id=' + id + '" title=""><img src="'+img+'" alt="" /></a></dd>';
			str += '		<dd class="detail">';
			str += '			<p>CT Racer is a Sports PC-Game,Mobile Planet </p>';
			str += '			<p class="stat"><em>' + downnum + '</em>download</p>';
			str += '		</dd>';
			str += '	</dl>';
			str += '</li>';
			str += '';
			str += '';
		}else{
			str += '<li><strong class="number">' + (i+1) + '</strong>' + '<a href="http://download.mmosite.com/download.php?id=' + id + '" class="title_hot" title="' + title + '">' + title + '</a>' + '<span class="download_no">' + downnum + ' downloads</span></li>';
		}
		
    }
	
	str += '	<br class="clear" />';
	str += '</ul>';
	document.write( str );
	
}

function showVideoInfo(videoInfo) {
	var size = videoInfo.length;
	var videohost = 'http://video.mmosite.com/';
	
	document.write("<ul>\r\n");
	for(var i=0;i<size;i++) {
		document.write("<li class='pic1'><a href='"+videohost+"display.php?vid="+videoInfo[i]['vid']+"&gid="+videoInfo[i]['gid']+"' title='"+videoInfo[i]['title']+"' target='_blank'><img src='"+videoInfo[i]['picture']+"' alt='' /><span class='playon'></span></a></li>\r\n");
	}
	document.write("</ul>\r\n");
}
