﻿var hk = 0;
function $(id)
{
	return document.getElementById(id);
}
function Request(Variable)
{
	var query = location.search;
	if (query != "")
	{
		query = query.split("?")[1];
		query = query.split("&");
		for (var i=0;i<query.length;i++)
		{
			var querycoll = query[i].split("=");
			if (querycoll.length == 2)
			{
				if (querycoll[0].toUpperCase() == Variable.toUpperCase())
				{
					return querycoll[1];
					break;
				}
			}
		}
	}
	return "";
}

var datahost = "data.7m.cn";

//function setFONT(value)
//{
//	document.getElementById("ls").style.fontSize = value;
//}

function Team_big(id)
{
	window.open("team.shtm?id=" + id +"&mark=big");
}

function Team_en(id)
{
	window.open("team.shtm?id=" + id +"&mark=en");
}

function Team_gb(id)
{
	window.open("team.shtm?id=" + id +"&mark=gb");
}
function Team_big_P(id)
{
	window.open("team.shtm?id=" + id +"&mark=big#team_wj");
}

function Team_en_P(id)
{
	window.open("team.shtm?id=" + id +"&mark=en#team_wj");
}

function Team_gb_P(id)
{
	window.open("team.shtm?id=" + id +"&mark=gb#team_wj");
}
function Player_big(id)
{
	window.open("member.shtm?id=" + id +"&mark=big");
}

function Player_en(id)
{
	window.open("member.shtm?id=" + id +"&mark=en");
}

function Player_gb(id)
{
	window.open("member.shtm?id=" + id +"&mark=gb");
}

function ShowAnalyse_big(id)
{
	window.open("Analyse.shtm?id=" + id +"&mark=big");
}

function ShowAnalyse_en(id)
{
	window.open("Analyse.shtm?id=" + id +"&mark=en");
}

function ShowAnalyse_gb(id)
{
	window.open("Analyse.shtm?id=" + id +"&mark=gb");
}

function ShowAnalyse_lh_big(id)
{
	location.href = "Analyse.shtm?id=" + id +"&mark=big";
}

function ShowAnalyse_lh_en(id)
{
	location.href = "Analyse.shtm?id=" + id +"&mark=big";
}

function ShowAnalyse_lh_gb(id)
{
	location.href = "Analyse.shtm?id=" + id +"&mark=gb";
}
function Odds_gb(id)
{
	//window.open("odds.shtml?id=" + id +"&mark=gb");
	location.href = "odds.shtml?id=" + id +"&mark=gb";
}

function Odds_en(id)
{
	//window.open("odds.shtml?id=" + id +"&mark=gb");
	location.href = "odds.shtml?id=" + id +"&mark=gb";
}

function Odds_big(id)
{
	//window.open("odds.shtml?id=" + id +"&mark=big");
	location.href = "odds.shtml?id=" + id +"&mark=big";
}
function O1x2_gb(id)
{
	//window.open("1x2.shtml?id=" + id +"&mark=gb");
	location.href = "1x2.shtml?id=" + id +"&mark=gb";
}

function O1x2_en(id)
{
	//window.open("1x2.shtml?id=" + id +"&mark=gb");
	location.href = "1x2.shtml?id=" + id +"&mark=en";
}

function O1x2_big(id)
{
	//window.open("1x2.shtml?id=" + id +"&mark=big");
	location.href = "1x2.shtml?id=" + id +"&mark=big";
}
function Over_gb(id)
{
	location.href = "overunder.shtml?id=" + id +"&mark=gb";
}

function Over_en(id)
{
	location.href = "overunder.shtml?id=" + id +"&mark=en";
}

function Over_big(id)
{
	location.href = "overunder.shtml?id=" + id +"&mark=big";
}
var datahost = "data2.7m.cn";


function Team_his_big(id)
{
	window.open("http://" + datahost + "/team_data/team_his_big.aspx?id=" + id);
}

function Team_his_en(id)
{
	window.open("http://" + datahost + "/team_data/team_his_big.aspx?id=" + id);
}

function Team_his_gb(id)
{
	window.open("http://" + datahost + "/team_data/team_his_gb.aspx?id=" + id);
}

function ShowDetails_big(id)
{
	window.open("detail_big.shtml?id=" + id,"","width=480,height=440,scrollbars=yes");
}

function ShowDetails_en(id)
{
	window.open("detail_big.shtml?id=" + id,"","width=480,height=440,scrollbars=yes");
}

function ShowDetails_gb(id)
{
	window.open("detail.shtml?id=" + id,"","width=480,height=440,scrollbars=yes");
}

function ShowPk_big(id)
{
	window.open("http://data.7m.hk/m_odds_analyse.htm?ecd=0&id=" + id);
}

function ShowPk_en(id)
{
	window.open("http://data.7m.hk/m_odds_analyse.htm?ecd=0&id=" + id);
}

function ShowPk_gb(id)
{
	window.open("http://data.7m.hk/m_odds_analyse.htm?ecd=1&id=" + id);
}

function Country_big(id)
{
	window.open("http://" + datahost + "/country_data/" + id + "/big/index.shtml");
}

function Country_en(id)
{
	window.open("http://" + datahost + "/country_data/" + id + "/big/index.shtml");
}

function Country_gb(id)
{
	window.open("http://" + datahost + "/country_data/" + id + "/gb/index.shtml");
}

function Stadium_big(id)
{
	window.open("http://" + datahost + "/stadium_data/" + id + "/index_big.shtml");
}

function Stadium_gb(id)
{
	window.open("http://" + datahost + "/stadium_data/" + id + "/index_gb.shtml");
}

function Stadium_en(id)
{
	window.open("http://" + datahost + "/stadium_data/" + id + "/index_gb.shtml");
}

function Referee_big(id)
{
	window.open("http://" + datahost + "/referee_data/" + id + "/index_big.shtml");
}

function Referee_en(id)
{
	window.open("http://" + datahost + "/referee_data/" + id + "/index_big.shtml");
}

function Referee_gb(id)
{
	window.open("http://" + datahost + "/referee_data/" + id + "/index_gb.shtml");
}

function t_History_OddsAway_big(path, id)
{
	window.open("http://" + datahost + "/team_history_odds_data/" + path + "/" + id + "/total/index_big.htm", "", "width=620,height=500,scrollbars=yes");
}

function t_History_OddsAway_en(path, id)
{
	window.open("http://" + datahost + "/team_history_odds_data/" + path + "/" + id + "/total/index_big.htm", "", "width=620,height=500,scrollbars=yes");
}

function t_History_OddsAway_gb(path, id)
{
	window.open("http://" + datahost + "/team_history_odds_data/" + path + "/" + id + "/total/index_gb.htm", "", "width=620,height=500,scrollbars=yes");
}

function h_History_OddsAway_big(path, id)
{
	window.open("http://" + datahost + "/team_history_odds_data/" + path + "/" + id + "/home/index_big.htm", "", "width=620,height=500,scrollbars=yes");
}

function h_History_OddsAway_en(path, id)
{
	window.open("http://" + datahost + "/team_history_odds_data/" + path + "/" + id + "/home/index_big.htm", "", "width=620,height=500,scrollbars=yes");
}

function h_History_OddsAway_gb(path, id)
{
	window.open("http://" + datahost + "/team_history_odds_data/" + path + "/" + id + "/home/index_gb.htm", "", "width=620,height=500,scrollbars=yes");
}

function a_History_OddsAway_big(path, id)
{
	window.open("http://" + datahost + "/team_history_odds_data/" + path + "/" + id + "/away/index_big.htm", "", "width=620,height=500,scrollbars=yes");
}

function a_History_OddsAway_en(path, id)
{
	window.open("http://" + datahost + "/team_history_odds_data/" + path + "/" + id + "/away/index_big.htm", "", "width=620,height=500,scrollbars=yes");
}

function a_History_OddsAway_gb(path, id)
{
	window.open("http://" + datahost + "/team_history_odds_data/" + path + "/" + id + "/away/index_gb.htm", "", "width=620,height=500,scrollbars=yes");
}

function zlk_big(id)
{
	window.open("library.shtm?id=" + id + "&mark=big");
}

function zlk_en(id)
{
	window.open("library.shtm?id=" + id + "&mark=big");
}

function zlk_gb(id)
{
	window.open("library.shtm?id=" + id + "&mark=gb");
}

function ShowRPk_big(id)
{
	window.open("http://royal.7m.cn:18000/chart.htm?ecd=0&id=" + id);
}

function ShowRPk_en(id)
{
	window.open("http://royal.7m.cn:18000/chart.htm?ecd=0&id=" + id);
}

function ShowRPk_gb(id)
{
	window.open("http://royal.7m.cn:18000/chart.htm?ecd=1&id=" + id);
}

function ShowCPk_big(id)
{
	window.open("http://67.215.229.69/chart.htm?ecd=0&id=" + id);
}

function ShowCPk_en(id)
{
	window.open("http://67.215.229.69/chart.htm?ecd=0&id=" + id);
}

function ShowCPk_gb(id)
{
	window.open("http://67.215.229.69/chart.htm?ecd=1&id=" + id);
}

function ShowLBPk_big(id)
{
	window.open("http://data.7m.hk/lb_odds_analyse.htm?ecd=0&id=" + id);
}

function ShowLBPk_gb(id)
{
	window.open("http://data.7m.hk/lb_odds_analyse.htm?ecd=1&id=" + id);
}

function Show1x2_big(id)
{
	window.open("1x2.shtml?id=" + id +"&mark=big");
}

function Show1x2_gb(id)
{
	window.open("1x2.shtml?id=" + id +"&mark=gb");
}

function ShowOdds_big(id)
{
	window.open("odds.shtml?id=" + id +"&mark=big");
}

function ShowOdds_gb(id)
{
	window.open("odds.shtml?id=" + id +"&mark=gb");
}

function MC_big(id)
{
	window.open("http://wlive.taobao.7m.cn/t_live_big.shtml?id=" + id);
}

function MC_gb(id)
{
	window.open("http://wlive.taobao.7m.cn/t_live_gb.shtml?id=" + id);
}

function ChgLan(curr,lng)
{
	if(location.href.indexOf('mark=') == -1)
	{
		if(location.href.indexOf('?') == -1)
		{
			location.href = location.href + "?mark=" + lng;
		}
		else
		{
			location.href = location.href + "&mark=" + lng;
		}
	}
	else
	{
		location.href = location.href.replace("mark="+ curr, "mark=" + lng);
	}
}

function NumFormat(num)
{
	if(num <= 9)
	{
		return "0" + parseFloat(num);
	}
	return num;
}

//时间格式化
function SetTimeFormat(strTime)
{
	var times = strTime.split(',');
	if(times.length >= 6)
	{
		return times[0] + '-' + NumFormat(times[1]) + '-' + NumFormat(times[2]) + ' ' + NumFormat(times[3]) + ':' + NumFormat(times[4]) + ':' + NumFormat(times[5]);
	}
	else
	{
		return "";
	}
}

function IsStart(strTime){
	if(strTime == '')
		return false;
	var times = strTime.split(',');
	var date = new Date(times[0],parseFloat(times[1]) - 1,times[2],parseFloat(times[3]) + 2,times[4],times[5]);
	return false;
	//if(serverdate > date){
//		return false;
//	}else{
//		return true;
//	}
}

function SetTimeFormat0(strTime)
{
	var times = strTime.split(',');
	var date = new Date(times[0],parseFloat(times[1]) - 1,times[2],times[3],times[4],times[5]);
	if(times.length >= 6)
	{
		return date.getFullYear() + '-' + NumFormat(date.getMonth() + 1) + '-' + NumFormat(date.getDate()) + ' ' + NumFormat(date.getHours()) + ':' + NumFormat(date.getMinutes()) + ':' + NumFormat(date.getSeconds());
	}
	else
	{
		return "";
	}
}
function SetTimeFormat7(strTime)
{
	if(strTime == ""){return "";}
	var times = strTime.replace(/-/g,",").replace(/:/g,",").replace(/ /g,",").split(',');
	var date = new Date(times[0],parseFloat(times[1]) - 1,times[2],parseFloat(times[3])+8,times[4],times[5]);
	if(times.length >= 6)
	{
		return date.getFullYear() + '-' + NumFormat(date.getMonth() + 1) + '-' + NumFormat(date.getDate()) + ' ' + NumFormat(date.getHours()) + ':' + NumFormat(date.getMinutes()) + ':' + NumFormat(date.getSeconds());
	}
	else
	{
		return "";
	}
}

function SetTimeFormat1(strTime)
{
	var times = strTime.split(',');
	if(times.length >= 6)
	{
		return times[0] + '-' + NumFormat(times[1]) + '-' + NumFormat(times[2]);
	}
	else
	{
		return "";
	}
}

function GetHM(strTime){
	if(strTime == '')return strTime;
	var ts = strTime.replace(/-/g,",").replace(/:/g,",").replace(/ /g,",").split(',');
	if(ts.length == 6){
		strTime = ts[3] +":"+ ts[4];
	}
	return strTime;
}

