// 

﻿
function redfixed(){$.ajax({type:"post",dataType:"json",url:"Ajax/ajax.aspx",data:"_type=list&type=4&r="+Math.random(),complete:function(){$("#gamelist img").hide();},error:function(msg){},success:function(data){var str="";if(data!=null){$.each(data.json,function(i,item){str+=gettr(i,item,"redfixed")});}
$("#redfixed").replaceWith(str);}});}
function redrandom(){$.ajax({type:"post",dataType:"json",url:"Ajax/ajax.aspx",data:"_type=list&type=5&r="+Math.random(),complete:function(){$("#gamelist img").hide();},error:function(msg){},success:function(data){var str="";if(data!=null){$.each(data.json,function(i,item){str+=gettr(i,item,"redrandom")});}
$("#redrandom").replaceWith(str);}});}
function bluefixed(){$.ajax({type:"post",dataType:"json",url:"Ajax/ajax.aspx",data:"_type=list&type=3&r="+Math.random(),complete:function(){$("#gamelist img").hide();},error:function(msg){},success:function(data){var str="";if(data!=null){$.each(data.json,function(i,item){str+=gettr(i,item,"bluefixed")});}
$("#bluefixed").replaceWith(str);}});}
function bluerandom(){$.ajax({type:"post",dataType:"json",url:"Ajax/ajax.aspx",data:"_type=list&type=6&r="+Math.random(),complete:function(){$("#gamelist img").hide();},error:function(msg){},success:function(data){var str="";if(data!=null){$.each(data.json,function(i,item){str+=gettr(i,item,"bluerandom")});}
$("#bluerandom").replaceWith(str);}});}
function common_ing(){$.ajax({type:"post",dataType:"json",url:"Ajax/ajax.aspx",data:"_type=gamelist&type=1&day=0&hour=0&r="+Math.random(),complete:function(){$("#gamelist img").hide();},error:function(msg){},success:function(data){var str="";if(data!=null){$.each(data.json,function(i,item){str+=gettr(i,item,"common_ing")});}
$("#common_ing").replaceWith(str);}});}
function common_random(){$.ajax({type:"post",dataType:"json",url:"Ajax/ajax.aspx",data:"_type=gamelist&type=2&day=0&hour=0&r="+Math.random(),complete:function(){$("#gamelist img").hide();},error:function(msg){},success:function(data){var str="";if(data!=null){$.each(data.json,function(i,item){str+=gettr(i,item,"common_random")});}
$("#common_random").replaceWith(str);}});}
function common_yet(){$.ajax({type:"post",dataType:"json",url:"Ajax/ajax.aspx",data:"_type=gamelist&type=3&day=0&hour=0&r="+Math.random(),complete:function(){$("#gamelist img").hide();},error:function(msg){},success:function(data){var str="";if(data!=null){$.each(data.json,function(i,item){str+=gettr(i,item,"common_yet")});}
$("#common_yet").replaceWith(str);}});}
function common_no(){$.ajax({type:"post",dataType:"json",url:"Ajax/ajax.aspx",data:"_type=gamelist&type=4&day=0&hour=0&r="+Math.random(),complete:function(){$("#gamelist img").hide();},error:function(msg){},success:function(data){var str="";if(data!=null){$.each(data.json,function(i,item){str+=gettr(i,item,"common_no")});}
$("#common_no").replaceWith(str);}});}
function tomorrow(){$.ajax({type:"post",dataType:"json",url:"Ajax/ajax.aspx",data:"_type=gamelist&type=5&day=-1&hour=0&r="+Math.random(),complete:function(){$("#gamelist img").hide();},error:function(msg){},success:function(data){var str="";if(data!=null){$.each(data.json,function(i,item){str+=gettr(i,item,"tomorrow")});}
$("#tomorrow").replaceWith(str);}});}
function later(){$.ajax({type:"post",dataType:"json",url:"Ajax/ajax.aspx",data:"_type=gamelist&type=5&day=-2&hour=0&r="+Math.random(),complete:function(){$("#gamelist img").hide();},error:function(msg){},success:function(data){var str="";if(data!=null){$.each(data.json,function(i,item){str+=gettr(i,item,"later")});}
$("#later").replaceWith(str);}});}
function yesterday(){$.ajax({type:"post",dataType:"json",url:"Ajax/ajax.aspx",data:"_type=gamelist&type=5&day=1&hour=0&r="+Math.random(),complete:function(){$("#gamelist img").hide();},error:function(msg){},success:function(data){var str="";if(data!=null){$.each(data.json,function(i,item){str+=gettr(i,item,"yesterday")});}
$("#yesterday").replaceWith(str);}});}
function before(){$.ajax({type:"post",dataType:"json",url:"Ajax/ajax.aspx",data:"_type=gamelist&type=5&day=2&hour=0&r="+Math.random(),complete:function(){$("#gamelist img").hide();},error:function(msg){},success:function(data){var str="";if(data!=null){$.each(data.json,function(i,item){str+=gettr(i,item,"before")});}
$("#before").replaceWith(str);}});}
function gettr(i,item,id){var str="";str+="<tr onmouseover=\"javascript:this.className='"+id+"_over'\" onmouseout=\"javascript:this.className='"+id+"_out'\" class=\""+id+"\" id=\""+id+"\">\n";str+="<td class=\""+id+"server\"><a href=\"/go.htm?url="+item.url+"\" target=\"_blank\" title=\""+item.servers+"\">"+item.servers.substring(0,12)+"</a></td>\n";str+="<td class=\""+id+"ip\"><a href=\"/go.htm?url="+item.url+"\" target=\"_blank\" title=\""+item.ip+"\">"+item.ip.substring(0,10)+"</a></td>\n";str+="<td class=\""+id+"time\">"+item.opentime.substring(0,16)+"</td>\n";str+="<td class=\""+id+"line\">"+item.line+"</td>\n";str+="<td class=\""+id+"version\"><p title=\""+item.versions+"\">"+item.versions.substring(0,22)+"</p></td>\n";str+="<td class=\""+id+"\"><a href=tencent://message/?uin="+item.qq+"&Site=&Menu=yes><img src=\"images/7_online.gif\" alt=\"点击交谈\" style=\"border:0px;\" /></a></td>\n";str+="<td class=\""+id+"intro\"><a href=\"/Game/"+item.id+"/\">详细介绍</a></td>\n";str+="<td class=\""+id+"star\">"+getstart(item.star)+"</td>\n";str+="</tr>\n";return str;}
function getstart(n){var str="";for(var i=1;i<=n;i++){str+="<img src=\"/images/xx.gif\" width=\"19\" height=\"22\" />";}
return str;}
$(function(){redfixed();redrandom();bluefixed();bluerandom();common_ing();common_random();common_yet();common_no();tomorrow();later();yesterday();before();var now=new Date();var year=now.getFullYear();var month=now.getMonth();var day=now.getDate();$("#mr").html(new Date(year,month,day+1).toLocaleDateString());$("#hr").html(new Date(year,month,day+2).toLocaleDateString());$("#zr").html(new Date(year,month,day-1).toLocaleDateString());$("#qr").html(new Date(year,month,day-2).toLocaleDateString());});function refresh(){$("table #redfixed").not(":first").remove();redfixed();$("table #redrandom").not(":first").remove();redrandom();$("table #bluefixed").not(":first").remove();bluefixed();$("table #bluerandom").not(":first").remove();bluerandom();$("table #common_ing").not(":first").remove();common_ing();$("table #common_random").not(":first").remove();common_random();$("table #common_yet").not(":first").remove();common_yet();$("table #common_no").not(":first").remove();common_no();$("table #tomorrow").not(":first").remove();tomorrow();$("table #later").not(":first").remove();later();$("table #yesterday").not(":first").remove();yesterday();$("table #before").not(":first").remove();before();}
setInterval('refresh()',600000);