var cid ;
function xlwgxfk(copid) {
	cid = copid;
	var xlunParams = {};
	xlunParams.pos = "right";
	xlunParams.vpos = "bottom";
	xlunParams.topos = 5;
	xlunParams.height = 0;
	xlunParams.x = 0;
	xlunParams.y = 235 + 22;
	xlunParams.copid = copid;
	xlunParams.stype = 601;
	xlunParams.style = '<style></style>';
	xlunParams.content = '<div id="xlun_xfk_body"> <a id="aurl" href="http://webgame.xunlei.com/youxi/index.htm" style="display:none;">&nbsp;</a>      <script language="javascript">      AC_FL_RunContent(      "codebase", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0",      "width", "300",      "height", "230",      "src", "E7BD91E6B8B8TIPS",      "quality", "high",      "pluginspage", "http://www.macromedia.com/go/getflashplayer",      "align", "middle",      "play", "true",      "loop", "true",      "scale", "showall",      "wmode", "window",      "devicefont", "false",      "id", "300x230",      "bgcolor", "#000000",      "FlashVars","urltxt="+getAnchorUrl("aurl"),      "name", "xlunflash",      "menu", "true",      "allowFullScreen", "false",      "allowScriptAccess","always",      "movie", "http://cop.my.xunlei.com/webgame/images/E7BD91E6B8B8TIPS",      "salign", ""     );    </script></div>';	
	initXlunFloater(xlunParams);
	oldLoad = window.onload;
	window.onload = function() {
		if(typeof oldLoad == "function"){
			oldLoad();
		}
		locateXlunFloater(xlunParams);/*
		if(document.getElementById("aurl")){
			setURL(getAnchorUrl(document.getElementById("aurl")));
		}*/
	}
}

function thisMovie(name){
	if(navigator.userAgent.indexOf('microsoft')!=-1){
		return window[name];
	}else{
		return document[name];
	}
}

function setURL(url){
 try{
  	thisMovie('xlunflash').assignURL(url);
  }catch(e){}
}

function getAnchorUrl(aObjid) {
	var aObj = document.getElementById(aObjid);
	var link = aObj.href;
	if(link.indexOf("?") > -1 && link.indexOf("=") > link.indexOf("?")) {
		aObj.href = link + "&gid=" + cid + "&cflag=" + 601;
	} else if(link.indexOf("?") > -1) {
		aObj.href = link + "gid=" + cid + "&cflag=" + 601;
	} else {
		aObj.href = link + "?gid=" + cid + "&cflag=" + 601;
	}
	link = aObj.href;
	aObj.href = "http://analytics-union.xunlei.com/Click?uri="+encodeURIComponent("http://webgameclick2.union.xunlei.com&linkid=" + cid + "," + 601 + ",0,0," + top.document.domain + "&location=" + encodeURIComponent(link));
	return aObj.href;
}
