/*首页图片轮播*/
function showpicplay(){
	var focus_width=426;
	var focus_height=193;
	var text_height=0;
	var swf_height = focus_height+text_height;
	var pics=static_file+'/images/v2/Index/zhongqiu.jpg|'+static_file+'/images/v2/Index/servencup.jpg|'+static_file+'/images/v2/Index/newoperate.jpg|'+static_file+'/images/v2/Index/shijinsai.jpg|'+static_file+'/images/v2/Index/ftxadvice.jpg';
	var links='http://www.ftxgame.com/show_newinfo.html?tId=1283854285912070|http://www.ftxgame.com/show_newinfo.html?tId=1282898796776781|http://www.ftxgame.com/show_newinfo.html?tId=1282892727809748|http://www.ftxgame.com/show_newinfo.html?tId=1282037614855064|http://www.ftxgame.com';
	var texts='||';
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
	document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="'+static_file+'/images/flash01.swf"><param name="quality" value="high"><param name="bgcolor" value="#000000">');
	document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
	document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
	document.write('<embed src="'+static_file+'/images/flash01.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#000000" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');		
	document.write('</object>');
}
//顶部菜单样式1
function showmainmenu(obj,type,name){
	if(type==1){
		$(obj).children().addClass("move");
		$("#"+name).show();
	}
	else{
		$(obj).children().removeClass("move");
		$("#"+name).hide();
	}
}
//顶部菜单样式2
function showmenu(obj,code,flag){
	$(obj).parent().children(".menu"+code).find("a").each(function(){
		if(flag==1){
			$(obj).show();
			$(this).addClass("over"+code);
		}	
		else{
			$(obj).hide();
			$(this).removeClass("over"+code);
		}
	})
}

//显示经理排行
function showUserTop(obj,name){
	$(obj).parent().parent().find("li span").attr("class","bg");
	obj.className="red";
	var sid=$("#shards").val();
	$("#"+name+sid).parent().find(".cont").hide();
	$("#"+name+sid).show();
}
//显示每日一星，一衰
function showTodayStarBad(obj,n1,n2){
	$(obj).parent().parent().find("li span").attr("class","bg");
	obj.className="red";
	$("#"+n1).parent().find(".membinfo").hide();
	$("#"+n1).show();
	$("#"+n2).parent().find(".score").hide();
	$("#"+n2).show();
}
//显示赛程
function showrace(obj,name){
	$(obj).parent().parent().find("li span").attr("class","bg");
	obj.className="red";
	$("#"+name).parent().find(".cont").hide();
	$("#"+name).show();
}
//显示新闻公告
function shownewdiv(obj,name){
	$(obj).parent().parent().find("li span").attr("class","");
	obj.className="bg";
	$("#"+name).parent().find(".cont").hide();
	$("#"+name).show();
	$("#"+name+"href").parent().find("span").hide();
	$("#"+name+"href").show();
}
function shownewcontent(obj){
	$(obj).siblings().children(".Detailed").hide();
	$(obj).children(".Detailed").show();
}
//论坛热贴，玩家攻略
function showtopic(obj,name){
	$(obj).parent().parent().find("li span").attr("class","");
	obj.className="bg";
	$("#"+name).parent().find("div").hide();
	$("#"+name).show();
	$("#"+name+"href").parent().find("span").hide();
	$("#"+name+"href").show();
}

/*******范特西五大特色上下滚动 begin*******/
var ad={
	o:null,// 存放滚动的UL
	cloneImg:null,//克隆UL的第一个图片
	adY:0,//滚动值
	distan:0,//每个图片的高度
	init:function(obj){
		if(!obj.style.top){
			obj.style.top = '0px';
		}
		this.cloneImg = obj.firstChild.cloneNode(true);//克隆第一个节点
		if(this.cloneImg.nodeType == 3) this.cloneImg = obj.firstChild.nextSibling.cloneNode(true);//除IE外第一个节点为文本节点,这里做点调整,让克隆节点还是指向第一个元素
		obj.appendChild(this.cloneImg);//让克隆的节点放入最后
		this.adY = parseInt(obj.style.top);
		this.o = obj;
		this.distan = this.cloneImg.offsetHeight;//获取高度
		this.moveCtrl();
	},
	moveCtrl:function(){
		if(Math.abs(this.adY) == this.o.offsetHeight - this.distan)
			this.adY = 0;//当到达底部,让滚动直接跳回最上面
		if(Math.abs(this.adY)%this.distan==0){
			setTimeout('ad.moveCtrl()',3000);//对每个图片做停留,也就是延迟函数的循环
		}else{
			setTimeout('ad.moveCtrl()',10);//运动循环
		}
		--this.adY;
		ad.o.style.top = this.adY + 'px';
	}
}

window.onload = function(){
	var obj = document.getElementById('adul');
	ad.init(obj);//直接把UL放入类里,就可以用了,类已基本封装好
	
	//var ru=getHost(document.referrer);
	//设置cookie
	//wCookie("user_source",ru,1);
	
	var str = new StringBuffer();
	var val = new StringBuffer();
	for(p in shardObject){
		str.append(shardObject[p][1]+",");
		val.append(shardObject[p][0]+",");
	}
	init_select("shards",str.toString(),val.toString(),1);
	selShard($("#shards").val());
	
	init_select("shards1",str.toString(),val.toString(),1);
	selShard1($("#shards1").val());
	
	ceshiCanvas('myCanvas');
	drawCanvas(items,'myCanvas',sums);
	
	
	

	
}

//按分区查看排行
function selShard(shardid){
	$("#shardId"+shardid).parent().find("div").hide();
	$("#shardId"+shardid).show();
	showUserTop(document.getElementById("zhanjiSpan"),"allDiv");
}

//按分区查看球员黑市
function selShard1(shardid){
	$("#tread"+shardid).parent().find("div").hide();
	$("#tread"+shardid).show();
}
/*******范特西五大特色上下滚动 end*******/