//首页JS代码
function Zoom_Click()
{
	try
	{
		if( document.getElementById('SFDataAD').style.display == 'none' )
		{
			document.getElementById('SFDataAD').style.display= '';
		}
		else
		{
			document.getElementById('SFDataAD').style.display= 'none';
		}
	}
	catch(e)
	{
	}
}
function GameVote(vote)
{
	if(confirm("您确认要为该私服投上您宝贵的一票吗？"))
	{
		document.formgame.innerHTML+='<INPUT id="vid" name="vid" type="hidden" value="'+vote+'">';

		document.formgame.method="post";
		document.formgame.target="_parent";
		document.formgame.action="/GameVoteok.aspx?ChannelID=<%=Xfok.ChannelID%>";
		document.formgame.submit();
	}
}
function ClubVote(vote)
{
	document.formgame.innerHTML+='<INPUT id="vid" name="vid" type="hidden" value="'+vote+'">';
	
	document.formgame.method="post";
	document.formgame.target="_parent";
	document.formgame.action="/ClubVoteok.aspx";
	document.formgame.submit();
}
function Reader()
{
	window.location.reload();
}
function CP_QQ(QQ){
	clipboardData.setData('text',''+QQ);
	alert(QQ+'复制成功！');
}
//根据频道搜索私服
//下拉搜索
function SearchGame(obj,type)
{
	window.location.href="http://so.138sf.com/SearchGame.aspx?Key="+type+"&Field="+obj.value;
}

//根据频道搜索私服
//频道搜索
function SearchField()
{
	var type=document.getElementById("SearchSelect").value;
	var text1=document.getElementById("Searchfield").value;
	window.location.href="/SearchGame.aspx?Key="+type+"&Field="+text1;
}
function SearchField1()
{
	var type=document.getElementById("SearchSelect1").value;
	var text1=document.getElementById("Searchfield1").value;
	window.location.href="/SearchGame.aspx?Key="+type+"&Field="+text1;
}


var LastReader="";
var LastTime="";
var xmlhttp;
function Reader()
{
    try
    {
    	xmlhttp=new XMLHttpRequest();
    }
    catch(e)
    {
    	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    {
       if (4==xmlhttp.readyState)
       {
           if (200==xmlhttp.status)
           {
                LastTime=xmlhttp.responseText;
                if (LastTime == "0")
                {
                    window.location.reload();
                }
                else if (LastReader != LastTime)
                {
                    window.location.reload();
                }
           }
       }
    }
    xmlhttp.open("POST","Reader.aspx?type=0&reload="+ Math.random());
    xmlhttp.send(null);
}
// a 名称 b IP  c 时间 d 线路 e 加工的介绍 f QQ g 加工的版本 h 网站 i 加工ip j 加工网站 k ID l 加工的名字 m 背静 n 鼠标背景 o 端口
function game(a,b,c,d,e,f,h,m,n)
{
	//c=c.slice(6);//这段代码是去掉开区时间的年份
	//c.replace(/\//g,'-');  /替换成-
	var wt=d.split("网通");
	var sx=d.split("双线");
	if(wt.length=="2"||sx.length=="2")
	{
	    cr='<span style="color:blue">'+d+'</span>';
	}
	else
	{
	    cr=d;
	}
	var list="";
	list+='<tr class="game" bgcolor="'+m+'" onmouseover="this.style.backgroundColor=\''+n+'\'" onmouseout="this.style.backgroundColor=\'\'">';
	list+='<td width="110">';
	list+='<a href=\''+h+'\' target="_blank">'+a+'</a>';
	list+='</td>';
	list+='<td width="105">'+b+'</td>';
	list+='<td width="193">'+c+'</td>';
	list+='<td width="92" align="center"> '+cr+'</td>';
	list+='<td >'+e+'<font color="blue">-推荐</font></td>';
	list+='<td width="92">'+f+'</td>';
	list+='<td width="65" align="center"><a href='+h+' target=_blank>点击查看</a></td>';
	list+='</tr>';
	document.write(list);
}
// a 名称 b IP  c 时间 d 线路 e 加工的介绍 f QQ g 加工的版本 h 网站 i 加工ip j 加工网站 k ID l 加工的名字 m 背静 n 鼠标背景 o 端口
function Nowgame(a,b,c,d,e,f,h,m,n)
{
	//c=c.slice(6);//这段代码是去掉开区时间的年份
	//c.replace(/\//g,'-');  /替换成-
	var wt=d.split("网通");
	var sx=d.split("双线");
	if(wt.length=="2"||sx.length=="2")
	{
	    cr='<span style="color:blue">'+d+'</span>';
	}
	else
	{
	    cr=d;
	}
	var list="";
	list+='<tr class="game" bgcolor="'+m+'" onmouseover="this.style.backgroundColor=\''+n+'\'" onmouseout="this.style.backgroundColor=\'\'">';
	list+='<td width="110">';
	list+='<a href=\''+h+'\' target="_blank">'+a+'</a>';
	list+='</td>';
	list+='<td width="105">'+b+'</td>';
	list+='<td width="193">'+c+'</td>';
	list+='<td width="92" align="center"> '+cr+'</td>';
	list+='<td >'+e+'<font color="blue">-推荐</font></td>';
	list+='<td width="92">'+f+'</td>';
	list+='<td width="65" align="center"><a href='+h+' target=_blank>点击查看</a></td>';
	list+='</tr>';
	document.write(list);
}
var theAds=new Array();
var ii=-1;
// a 名称 b IP  c 时间 d 线路 e 加工的介绍 f QQ g 加工的版本 h 网站 i 加工ip j 加工网站 k ID l 加工的名字 m 背静 n 鼠标背景 o 端口
function Alwaysgame(a,b,c,d,e,f,h,m,n)
{
	var list="";
	list+='<tr class="game" bgcolor="'+m+'" onmouseover="this.style.backgroundColor=\''+n+'\'" onmouseout="this.style.backgroundColor=\'\'">';
	list+='<td width="110">';
	list+='<a href=\''+h+'\' target="_blank">'+a+'</a>';
	list+='</td>';
	list+='<td width="105">'+b+'</td>';
	list+='<td width="193">今日新开 好玩稳定 <strong><span class="STYLE3">精</span><span class="STYLE4">品</span><span class="STYLE6">总</span><span class="STYLE9">固</span><span class="STYLE8">顶</span></strong></td>';
	list+='<td width="92" align="center"> '+d+'</td>';
	list+='<td>'+e+'<font color="blue">-推荐</font></td>';
	list+='<td width="92">'+f+'</td>';
	list+='<td width="65" align="center"><a href='+h+' target=_blank>点击查看</a></td>';
	list+='</tr>';
	
	ii=ii+1;
	theAds[ii]=list;
}

function Shuffle(ary)
{
	for(var i=ary.length-1;i >= 0;i--)
	{
		var v = parseInt(Math.random()*(i+1));
		var tmp = ary[v];
		ary[v] = ary[i];
		ary[i] = tmp;   
	}
	return ary; 
}

function ShowAlwaysgame()
{
	var ary=Shuffle(theAds);
	for(var i=0;i<ary.length;i++)
	{
		document.write(ary[i]);
	}
}
