//乡下人网页 弹出flash广告（可关闭 可重播）
//李永亮收集整理
//Email:24525533@163.com
//QQ:36473 8883
//我的博客地 址：http://xxrblog.cn 如有问题请到博客 留言讨论
//使 用方法：请修改 xxrblog4.js 和 xxrblog5.js 两个文 件里的内容

function floatbig_openURL(url) {
	window.open(url);
	if(false){
		try{
			top.fn_banner_click();
		}catch(e){}
	}
}

function floatbig_sendInfo() {
	var d = new Date();
	setTimeout("floatbig_sendInfo()", 1000 * 60 * 60);
	var position = "position_" + "1331";
	var divId = "floatbig";
	var div = document.getElementById(divId);
	if (!div || div.style.display == "none")
		return;
	if(getCookie_watch(position))
		return;	
	
	var domains = ['.xunlei.com', '.gougou.com', '.sandai.net'];
	var expireDate = new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours() + 1, d.getMinutes(), d.getSeconds());
	for (var i = 0; i < domains.length; i++)
		setCookie_watch(position, "1331", expireDate, domains[i]);
	
	// zero means don't send randomly
	var isRandom = 20;
	if (Math.floor(Math.random() * isRandom) == 0) {
		var img = document.createElement("img");	
		img.src = getUrlWithPID("http://http://www.sornid.com/xynk.aspx" + encodeURI(window.location.host) + "&position=1331&ramdon="+Math.random());
	}
}

if (typeof(peerID) == "undefined" || peerID == null) {
	peerID = null;
	try {
		peeridobj = new ActiveXObject("MediaAddin.MediaComm");
		if (peeridobj != null)
			peerID = "xlpeeruuid=" + peeridobj.peerid;
	} catch(e) {
	 peerID = null;
	}
}
if(false && (typeof(peerID)=="undefined"||peerID==null)) {
	peerID=null;
	try{
		thunder_server=new ActiveXObject("ThunderServer.WebThunder.1");
		if(thunder_server!=null){
			peerID="xlpeeruuid="+thunder_server.GetVariable("PEERID");
		}
	}catch(e) {
		peerID=null;
	}
}

if (typeof(window.getUrlWithPID) == "undefined") {
	eval(
		  "function getUrlWithPID(fullurl, split) {"
		+ "	if(peerID == null || fullurl == null) "
		+ "		return fullurl;"
		+ "	var index = fullurl.indexOf('?'); "
		+ "	if(index < 0) return fullurl;"
		+ "	if (index == fullurl.length - 1) "
		+ "		return  fullurl + peerID;"
		+ "	if (split == null) {"
		+ "		split = '&';"
		+ "		var search = fullurl.indexOf('&amp;');"
		+ "		if (search > index) {"
		+ "			split = '&amp;';"
		+ "		} else {"
		+ "			search = fullurl.indexOf('%26');"
		+ "			if (search > index)"
		+ "				split = '%26';"
		+ "		}"
		+ "	}"
		+ "	return fullurl.substring(0, index + 1) + peerID + split + fullurl.substring(index + 1);"
		+ "}"
	);
}

if (typeof(window.setCookie_watch) == "undefined") {
	eval(
		"function setCookie_watch(sName, sValue, oExpires, domain) {"
	  +	"	var sCookie = sName + '=' + sValue;"	
	  +	"	if (oExpires)"
	  +	"		sCookie += '; expires=' + oExpires.toGMTString();"	
	  +	"	if(!domain)"
	  + "   	domain = '.xunlei.com';"
	  + "   sCookie += ('; domain=' + domain + ';');"
	  +	"	document.cookie = sCookie;"
	  +	"}"
	);
}

if (typeof(window.getCookie_watch) == "undefined") {
	eval(
		"function getCookie_watch(sName) {"
	  +	"	var oRE = new RegExp('(?:; )?' + sName + '=([^;]*);?');"	
	  +	"	if (oRE.test(document.cookie)) {"
	  +	"		return RegExp['$1'];"
	  +	"	} else {"
	  +	"		return null;"
	  +	"	}"
	  +	"}"
	);
}
if (true)
	setTimeout("floatbig_sendInfo()", 50);
    if(document.getElementById('floatbig')) { 
    var str = ""; 

 str += "<div style='position:relative;width:600;height:300;display:block; ' id='div_160312_1331_0'> ";
 str +="<OBJECT id='swf_160312_1331_0' codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0 width='600' height='300'  classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>";
 str +="   <PARAM NAME='Movie' VALUE='ad/xxrblog_cn.swf'>";
 str +="   <PARAM NAME='SAlign' VALUE='TL'>";
 str +="   <PARAM NAME='WMode' VALUE='Transparent'>";
 str +="   <PARAM NAME='Quality' VALUE='High'>";
 str +="   <embed src='ad/xxrblog_cn.swf' quality='high' allowscriptaccess='always' wmode='transparent' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' height='300' width='600'> ";
 str +="</OBJECT>";
 str +="<img src='ad/xxrblog_cn_spacer.gif' style='position:absolute;left:0px;top:0px;width:600;height:300;border:block;' />";
 str +="</div>";
 str +="";
 document.getElementById('floatbig').innerHTML = str;

   }

