// Google ADS
google_ad_client = "pub-3970610279159213";
/* 吐球网Play页 728x90, 创建于 09-12-9 */
google_ad_slot = "2549004755";
google_ad_width = 690;
google_ad_height = 90;
document.writeln("<script type=\"text\/javascript\"");
document.writeln("src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\"><\/script>");

// 吐球网 Floating
document.write("<div id='AdLayer1' style='position: absolute;visibility:hidden;z-index:1;width:75px;display:none;'>");
document.write("<img onclick='controlAd()' id='switch1' src='/banner/Floating/close.gif' width='75px'/>");
document.write("<div id='adimg1'>");
document.write("<a href='#' target='_blank'><img  src='.gif' width='75' height='300' border='0'></a>");
document.write("</div></div>");
document.write("<div id='AdLayer2' style='position:absolute;visibility:hidden;z-index:1;width:100px;'>");
document.write("<img onclick='controlAd()' id='switch2'  src='/banner/Floating/close.gif' width='75px'/>");
document.write("<div id='adimg2'>");
document.write("<a href='/e/public/ClickAd?adid=1' title='最流行的小游戏' target='_blank'><img src='/banner/img/home-web-20100705.gif' alt='最流行的小游戏' border='0' height='300' width='100' /></a>");
document.write("</div></div>");

<!--
var m_layer1,m_layer2;
function initMove() {
 m_layer1=document.getElementById("AdLayer1");
 m_layer2=document.getElementById("AdLayer2");
 m_layer1.style.top = "-200px";
 m_layer1.style.visibility = 'visible'
 m_layer2.style.top = "-200px";
 m_layer2.style.visibility = 'visible'
 MoveLayers();
 window.onscroll=MoveLayers;
}
function MoveLayers() {
 var x = 5; // 左右边距
 var y = 100; // 顶距
 var st=document.documentElement.scrollTop;
 var cw=document.documentElement.clientWidth;
 var y = st + y;
 m_layer1.style.top = y+"px";
 m_layer1.style.left = x+"px";
 m_layer2.style.top = y+"px";
 m_layer2.style.left = cw-m_layer2.clientWidth-x+"px";
}

//关闭广告
function hide()  
{   
document.getElementById('adimg1').style.display="none"; 
document.getElementById('adimg2').style.display="none";
document.getElementById('switch1').src='/banner/Floating/open.gif';
document.getElementById('switch2').src='/banner/Floating/open.gif';
}
//显示广告
function showAd()
{
document.getElementById('adimg1').style.display=""; 
document.getElementById('adimg2').style.display="";
document.getElementById('switch1').src='/banner/Floating/close.gif';
document.getElementById('switch2').src='/banner/Floating/close.gif';
}

if(null==GetCookie('flag'))
{
	SetCookie('flag',1);
}

//控制广告显示的函数
function controlAd()
{
var flag=GetCookie('flag');

if(flag==1){
	hide();
	SetCookie('flag',0);
	}
	else
	{
	showAd();
	SetCookie('flag',1);
	}
}

function checkFlag()
{
	if(GetCookie('flag')==0)
	{
		hide();
	}
}

function GetCookieVal(offset)
//获得Cookie解码后的值
{
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function SetCookie(name, value)
//设定Cookie值
{
var expdate = new Date();
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
if(expires!=null) expdate.setTime(expdate.getTime() + ( expires * 1000));
document.cookie = name + "=" + escape (value) +((expires == null) ? "" : ("; expires="+ expdate.toGMTString()))
+((path == null) ? "" : ("; path=" + path)) +((domain == null) ? "" : ("; domain=" + domain))
+((secure == true) ? "; secure" : "");
}
function DelCookie(name)
//删除Cookie
{
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires="+ exp.toGMTString();
}
function GetCookie(name)
//获得Cookie的原始值
{
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen)
{
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return GetCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}

checkFlag();
window.setTimeout("initMove()",600);
//-->