
function getGametype() {
	var gtp		= document.getElementById('selectLeague');
	var vs		= document.getElementById('selectVS');
	var date	= document.getElementById('date_txt');
	$.post("/odds/vs?action=getlevel2&riqi="+date.value,{},function(rsp){
			var cache=eval(rsp);
			
			///*
			if(cache.length==1) {
				gtp.options[0]=new Option("无比赛信息",-1);
				gtp.length=1;
			} else {
				gtp.options[0]=new Option("请选择联赛",-1);
				gtp.length=1;
				for(var i=0;i<cache.length-1;i+=2){
					gtp.options[gtp.length]=new Option(cache[i+1],cache[i]);
				}
			}
			//*/
	});
}

function getVsList() {
	var gtp		= document.getElementById('selectLeague');
	var vs		= document.getElementById('selectVS');
	var date	= document.getElementById('date_txt');
	vs.length = 1;
	$.post("/odds/vs?action=getlevel3&riqi="+date.value+"&gametypeID="+gtp.value,{},function(rsp){
		var cache=eval(rsp);
		vs.length=1;
		for(var i=0;i<cache.length-1;i+=2){
			vs.options[vs.length]=new Option(cache[i+1],cache[i]);
		}
	});
}
		function changeurl(val){
			var url = "http://www.1soccer.com/info/index/id/"+val;
			window.location.href = url;
		}
		function changeurl_1(val){
			var url = "/shtml/info/index/"+format_num(val)+'/'+val+".shtml";
			window.location.href = url;
		}
		
	function format_num(n){
		var b=parseInt(n).toString();
		var len=b.length;
		if(len<=3){return '';}
		var r=len%3;
		return r>0?b.slice(0,r)+"/"+b.slice(r,len).match(/\d{3}/g).join("/"):b.slice(r,len).match(/\d{3}/g).join("/");
	}	
function jump(url){
	if (!url) url="/odds/detail/id/"+document.getElementById('selectVS').value; 
	url=url.replace(/\game\id=(\d)*/g,"gameid="+document.getElementById('selectVS').value);
	window.open(url);
}
function jump_static(url){
	var id=document.getElementById('selectVS').value;
	if (!url) url="/shtml/odds/detail/"+format_num(id)+'/'+id+".shtml";
	url=url.replace(/\game\id=(\d)*/g,"gameid="+document.getElementById('selectVS').value);

	window.open(url);
}

