﻿var bfRefreshTime = 2000;
var pkRefreshTime = 8000;
var setRefreshValue = false;
var reflag = 0;
var oldxml = "";
var old_Pk_xml = "";
var EndGamebh = "";
var GoalSound = false;
var RedSound = false;
var ErrorGoalSound = false;
var SelectGoalSound = true;
var SelectGoalTips = true;
var chkpksound = false;
var chkswsound = false;
var jqsy = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='1' HEIGHT='1'><param name='movie' value='http://en2.7m.cnsound/default.swf'><param name='quality' value='high'><param name='wmode' value='transparent'><embed src='sound/default.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='1' height='1'></embed></object>";
var redsy = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='1' HEIGHT='1'><param name='movie' value='http://en2.7m.cnsound/red.swf'><param name='quality' value='high'><param name='wmode' value='transparent'><embed src='sound/red.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='1' height='1'></embed></object>";
var errjqsy = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='1' HEIGHT='1'><param name='movie' value='http://en2.7m.cnsound/error.swf'><param name='quality' value='high'><param name='wmode' value='transparent'><embed src='sound/error.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='1' height='1'></embed></object>";
var rqsound = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='1' HEIGHT='1'><param name='movie' value='http://en2.7m.cnsound/s1.swf'><param name='quality' value='high'><param name='wmode' value='transparent'><embed src='sound/s1.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='1' height='1'></embed></object>";
var swsound = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='1' HEIGHT='1'><param name='movie' value='http://en2.7m.cnsound/s2.swf'><param name='quality' value='high'><param name='wmode' value='transparent'><embed src='sound/s2.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='1' height='1'></embed></object>";
var hideCount = 0;
var laT1 = new Array(), laT2 = new Array(), lbT1 = new Array(), lbT2 = new Array(), pkT = new Array(), aswT1 = new Array(), aswT2 = new Array(), bswT1 = new Array(), bswT2 = new Array();
var sPopupS;
var TipsPopupS;
var GoalTips = "", GoalTips_Count = 0;
var tipswidth = 0, tipsheight = 0;
var loader = false;
var voi_lng = LANGUAGE_INDEX;
var speak_away = 0;
var speak_red = 0;
var speak_all = 0;
var order_type = "";
var default_speak = "sOFF";
if (LANGUAGE_INDEX == 0 || LANGUAGE_INDEX == 1) //big,gb
{
	if (document.cookie.indexOf("speak_all=") != -1)
	{
		speak_all = getCookie("speak_all");
		if (speak_all == 1)
			default_speak = "sON";
	}
}

function $(obj)
{
	return document.getElementById(obj);
}

function showListMatch(obj)
{
	if ($('listMatch').style.display == 'block') {
		$('listMatch').style.display = 'none';
		$('hlistMatch').className = 'lM_down';
		$('hlistMatch').title = OPENMATCHLIST;
	} else {
		$('listMatch').style.display = 'block';
		$('hlistMatch').className = 'lM_up';
		$('hlistMatch').title = CLOSEMATCHLIST;
	}
}

function setTab(m,n)
{
	var tli = $("tabMenu" + m).getElementsByTagName("li");
	var mli = $("tabDiv" + m).getElementsByTagName("div");
	for (i=0; i<tli.length; i++) {
		tli[i].className = i == n ? "select" : "";
		mli[i].style.display = i == n ? "block" : "none";
	}
}

function setCSS(n1)
{
	$('liveCSS').href = 'http://en2.7m.cn/css/live' + n1 + '.css';
	if ($('liveCSS2') != null)
	{
		if (LANGUAGE_INDEX == 0 || LANGUAGE_INDEX == 1) //big,gb
			$('liveCSS2').href = 'http://en2.7m.cn/css/live' + n1 + 's.css';
		else
			$('liveCSS2').href = 'http://en2.7m.cn/css/live' + n1 + '_en.css';
	}
	SetCookie("7mskin", n1);
}

function loadCSS(sp)
{
	var n1 = getCookie("7mskin");
	if (n1 == "")
		n1 = (LANGUAGE_INDEX == 5) ? "1" : "2";
	document.write('<link href="http://en2.7m.cn/css/live' + n1 + '.css" type="text/css" rel="stylesheet" id="liveCSS" />')
	if (LANGUAGE_INDEX == 0 || LANGUAGE_INDEX == 1) //big,gb
	{
		if (sp)
			document.write('<link href="http://en2.7m.cn/css/live' + n1 + 's.css" type="text/css" rel="stylesheet" id="liveCSS2" />')
	}
	else
		document.write('<link href="http://en2.7m.cn/css/live' + n1 + '_en.css" type="text/css" rel="stylesheet" id="liveCSS2" />')
}

function setFONT(sz)
{
	$('ls').style.fontSize = sz;
	if (LANGUAGE_INDEX == 0 || LANGUAGE_INDEX == 1) //big,gb
		SetCookie("lsfont", sz);
	else
		SetCookie("lsfont_en", sz);
}

function set_Attribute(bh, obj, attribute, val)
{
	if (typeof(live_f.ObjArr) == "object" && typeof(live_f.ObjArr[bh]) == "object")
		eval("if (live_f.ObjArr[" + bh + "]." + obj + " != null){live_f.ObjArr[" + bh + "]." + obj + "." + attribute + " = '" + val + "';}");
}

function getCookie(Name)
{
	var search = Name + "=";
	if(document.cookie.length > 0)
	{
		offset = document.cookie.indexOf(search);
		if(offset != -1)
		{
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if(end == -1)
				end = document.cookie.length;
			return unescape(document.cookie.substring(offset, end));
		}
		else
		{
			return "";
		}
   }
   return "";
}

function GetWeather(wi)
{
	if (!isNaN(wi) && wi > 0 && wi < 30)
	{
		return WEATHER_ARR[wi];
	}
	return;
}

function SetSoundCookie(v)
{
	var exp = new Date();
	exp.setTime(exp.getTime() + (30*24*60*60*1000));
	document.cookie = "7mSound=" + v + "{7mSound};expires=" + exp.toGMTString();
	jqsy = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'><param name='movie' value='http://en2.7m.cn/sound/" + v + ".swf'><param name='quality' value='high'><param name='wmode' value='transparent'><embed src='http://en2.7m.cn/sound/" + v + ".swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='1' height='1'></embed></object>";
	PlaySound();
}

function ApplySound()
{
	var v = $("select_sound").value;
	if (v != "none")
	{
		SetSoundCookie(v);
		SelectGoalSound = (v != 'no');
		resetSound2($("sound"));
	}
}

function ApplyOddsSound()
{
	var v = $("select_Odds_sound").value;
	if (v != "none")
	{
		var exp = new Date();
		exp.setTime(exp.getTime() + (30*24*60*60*1000));
		document.cookie = "7mOddsSound=" + v + "{7mOddsSound};expires=" + exp.toGMTString();
		swsound = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='1' HEIGHT='1'><param name='movie' value='http://en2.7m.cn/sound/" + v + ".swf'><param name='quality' value='high'><param name='wmode' value='transparent'><embed src='http://en2.7m.cn/sound/" + v + ".swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='1' height='1'></embed></object>";
		$("sw").innerHTML = swsound;
	}
}

function resetSound()
{
	if ($("select_sound").value == "no")
	{
		$("select_sound").value='default';
		SetSoundCookie($("select_sound").value);
	}
	else
	{
		$("select_sound").value='no';
		SetSoundCookie($("select_sound").value);
	}
}

function resetSound2(obj)
{
	if(SelectGoalSound)
	{
		obj.title = SOUND_CT;
		obj.className = "icon1 soundON";
		SetCookie('7mSoundCheckBox', '1{7mSoundCheckBox}');
	}
	else
	{
		obj.title = SOUND_OT;
		obj.className = "icon1 soundOFF";
		SetCookie('7mSoundCheckBox', '0{7mSoundCheckBox}');
	}
}

function SoundOnSelect(obj)
{
	if(!SelectGoalSound)
	{
		obj.title = SOUND_CT;
		obj.className = "icon1 soundON";
		resetSound();
		SelectGoalSound = true;
		SetCookie('7mSoundCheckBox', '1{7mSoundCheckBox}');
	}
	else
	{
		obj.title = SOUND_OT;
		obj.className = "icon1 soundOFF";
		resetSound();
		SelectGoalSound = false;
		SetCookie('7mSoundCheckBox', '0{7mSoundCheckBox}');
	}
}

function WinOnSelect(obj)
{
	if(!SelectGoalTips)
	{
		obj.title = WIN_CT;
		obj.className = "icon winON";
		SelectGoalTips = true;
		SetCookie('7mWinCheckBox', '1{7mWinCheckBox}');
	}
	else
	{
		obj.title = WIN_OT;
		obj.className = "icon winOFF";
		SelectGoalTips = false;
		SetCookie('7mWinCheckBox', '0{7mWinCheckBox}');
	}
}

function ReadSetting()
{
	if (typeof(select_sound) == "object")
	{
		if (document.cookie.indexOf("7mSound=") != -1)
		{
			var CookieValue = document.cookie.substring(document.cookie.indexOf("7mSound=")+8,document.cookie.indexOf("{7mSound}"));
			jqsy = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='1' HEIGHT='1'><param name='movie' value='http://en2.7m.cn/sound/" + CookieValue + ".swf'><param name='quality' value='high'><param name='wmode' value='transparent'><embed src='http://en2.7m.cn/sound/" + CookieValue + ".swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='1' height='1'></embed></object>";
			$("select_sound").value = CookieValue;
		}
		else
		{
			$("select_sound").value = "default";		
		}
	}
	if (typeof(select_Odds_sound) == "object")
	{
		if (document.cookie.indexOf("7mOddsSound=") != -1)
		{
			var CookieValue = document.cookie.substring(document.cookie.indexOf("7mOddsSound=")+12,document.cookie.indexOf("{7mOddsSound}"));
			swsound = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='1' HEIGHT='1'><param name='movie' value='http://en2.7m.cn/sound/" + CookieValue + ".swf'><param name='quality' value='high'><param name='wmode' value='transparent'><embed src='http://en2.7m.cn/sound/" + CookieValue + ".swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='1' height='1'></embed></object>";
			$("select_Odds_sound").value = CookieValue;
		}
		else
		{
			$("select_Odds_sound").value = "s2";		
		}
	}
	if (document.cookie.indexOf("7mSoundCheckBox=") != -1)
	{
		var sound_v = document.cookie.substring(document.cookie.indexOf("7mSoundCheckBox=")+16, document.cookie.indexOf("{7mSoundCheckBox}"));
		if (sound_v == "1")
		{
			$("sound").title = SOUND_CT;
			$("sound").className = "icon1 soundON";
			SelectGoalSound = true;
		}
		else
		{
			$("sound").title = SOUND_OT;
			$("sound").className = "icon1 soundOFF";
			SelectGoalSound = false;
		}
	}
	else
	{
		$("sound").title = SOUND_CT;
		$("sound").className = "icon1 soundON";
		SelectGoalSound = true;
	}
	if (document.cookie.indexOf("7mWinCheckBox=") != -1)
	{
		var win_v = document.cookie.substring(document.cookie.indexOf("7mWinCheckBox=")+14, document.cookie.indexOf("{7mWinCheckBox}"));
		if (win_v == "1")
		{
			$("win").title = WIN_CT;
			$("win").className = "icon winON";
			SelectGoalTips = true;
		}
		else
		{
			$("win").title = WIN_OT;
			$("win").className = "icon winOFF";
			SelectGoalTips = false;
		}
	}
	else
	{
		$("win").title = WIN_CT;
		$("win").className = "icon winON";
		SelectGoalTips = true;
	}
	if (typeof(pkChangeTips) == "object")
	{
		if (document.cookie.indexOf("7mPkWinCheckBox=") != -1)
			pkChangeTips.checked = (document.cookie.substring(document.cookie.indexOf("7mPkWinCheckBox=")+16, document.cookie.indexOf("{7mPkWinCheckBox}")) == "1") ? true : false;
	}
	if (LANGUAGE_INDEX == 0 && document.cookie.indexOf("voi_lng=") != -1)
		voi_lng = getCookie("voi_lng");
	if (document.cookie.indexOf("speak_away=") != -1)
		speak_away = getCookie("speak_away");
	if (document.cookie.indexOf("speak_red=") != -1)
		speak_red = getCookie("speak_red");
		
	if (LANGUAGE_INDEX == 0 || LANGUAGE_INDEX == 1) //big,gb
	{
		if (getCookie("lsfont") != "")
			setFONT(getCookie("lsfont"));
	}
	else
	{
		if (getCookie("lsfont_en") != "")
			setFONT(getCookie("lsfont_en"));
	}
	if (LANGUAGE_INDEX == 5)
	{
		$("etn").value = (getCookie("7mEtn") == "1") ? CONVERT2KR : CONVERT2EN;
	}
}

function ChangeTN(v)
{
	var vl = (v == CONVERT2EN) ? "1" : ""
	SetCookie("7mEtn", vl);
	live_f.location.reload();
}

function OrdMatch2(u, t)
{
	if (t == "1")
	{
		$("ord_time").style.display = "";
		$("ord_match").style.display = "none";
		var exp = new Date();
		exp.setTime(exp.getTime() + (365*24*60*60*1000));
		document.cookie = "7mScoreOrdType=1{7mScoreOrdType};expires=" + exp.toGMTString();
		live_f.location.href = u + "&ordType=" + t;
		order_type = t;
	}
	else
	{
		$("ord_time").style.display = "none";
		$("ord_match").style.display = "";
		var exp = new Date();
		exp.setTime(exp.getTime() + (365*24*60*60*1000));
		document.cookie = "7mScoreOrdType={7mScoreOrdType};expires=" + exp.toGMTString();
		live_f.location.href = u;
		order_type = "";
	}
}

function GetOrderType()
{
	if (document.cookie.indexOf("7mScoreOrdType=") != -1)
	{
		order_type = document.cookie.substring(document.cookie.indexOf("7mScoreOrdType=") + 15, document.cookie.indexOf("{7mScoreOrdType}"));
	}
	if (order_type == "")
	{
		$("ord_time").style.display = "none";
		$("ord_match").style.display = "";
	}
	else
	{
		$("ord_time").style.display = "";
		$("ord_match").style.display = "none";
	}
}

function ChangePkData(i)
{
	if (i > RQ_ARR.length)
		return "";
	return RQ_ARR[i];
}

function SetCookie(n,v)
{
	var exp = new Date();
	exp.setTime(exp.getTime() + (365*24*60*60*1000));
	document.cookie = n + "=" + v + ";expires=" + exp.toGMTString();
}


function ChangeState(startIndex)
{
	if (startIndex < 0 || startIndex > 18)
		startIndex = 0;
	return STATE_ARR[startIndex];
}

function updateRowColor()
{
	var obj = $("live_Table");
	var obj2 = $("left_live_Table");
	var obj3 = $("right_live_Table");
	if (obj != null && obj2 == null && obj3 == null)
	{
		var rowId = 0;
		for (var i=0;i<obj.rows.length;++i)
		{
			if (obj.rows[i].style.display == "" && obj.rows[i].id.substring(0, 2) == "bh")
			{
				obj.rows[i].className = (rowId % 2) ? "tbg1" : "tbg0";
				rowId++;
			}
		}
	}
	else
	{
		if (obj2 != null)
		{
			var rowId = 0;
			for (var i=0;i<obj2.rows.length;++i)
			{
				if (obj2.rows[i].style.display == "" && obj2.rows[i].id.substring(0, 2) == "bh")
				{
					obj2.rows[i].className = (rowId % 2) ? "tbg1" : "tbg0";
					rowId++;
				}
			}
		}
		if (obj3 != null)
		{
			var rowId = 0;
			for (var i=0;i<obj3.rows.length;++i)
			{
				if (obj3.rows[i].style.display == "" && obj3.rows[i].id.substring(0, 2) == "bh")
				{
					obj3.rows[i].className = (rowId % 2) ? "tbg1" : "tbg0";
					rowId++;
				}
			}
		}
	}
	if (typeof(updateRowColor_Timer) == "number")
		clearTimeout(updateRowColor_Timer);
	updateRowColor_Timer = setTimeout("updateRowColor()", 1800000);
}

function ShowWordAd()
{
	var obj = $("live_Table");
	var obj2 = $("left_live_Table");
	var obj3 = $("right_live_Table");
	if (obj != null && obj2 == null && obj3 == null)
	{
		if (typeof(topword2) == "string" && topword2 != "")
		{
			if ($("word_top") != null)
				obj.deleteRow($("word_top").rowIndex);
			var j = 0, i = 0;
			for (;i<obj.rows.length;++i)
			{
				if (j == 2)
					break;
					++j;
			}
			obj.insertRow(i);
			obj.rows[i].insertCell(0);
			obj.rows[i].id = "word_top";
			obj.rows[i].cells[0].colSpan = (obj.rows[0].cells.length > 1 ? obj.rows[0].cells.length : obj.rows[0].cells[0].colSpan);
			obj.rows[i].cells[0].bgColor = "#F7F8F3";
			obj.rows[i].cells[0].align = "center";
			obj.rows[i].cells[0].innerHTML = topword2;
		}
		if (typeof(wordAd) == "string" && wordAd != "")
		{
			if ($("word_b1") != null)
				obj.deleteRow($("word_b1").rowIndex);
			var j = 0, i = 0;
			for (;i<obj.rows.length;++i)
			{
				if (j == 3)
					break;
				if (obj.rows[i].id.indexOf("resume_") != -1)
					++j;
			}
			obj.insertRow(i);
			obj.rows[i].insertCell(0);
			obj.rows[i].id = "word_b1";
			obj.rows[i].cells[0].colSpan = (obj.rows[0].cells.length > 1 ? obj.rows[0].cells.length : obj.rows[0].cells[0].colSpan);
			obj.rows[i].cells[0].bgColor = "#F7F8F3";
			obj.rows[i].cells[0].align = "center";
			obj.rows[i].cells[0].innerHTML = wordAd;
		}
		if (typeof(wordAd2) == "string" && wordAd2 != "")
		{
			if ($("word_b2") != null)
				obj.deleteRow($("word_b2").rowIndex);
			var j = 0, i = 0;
			for (;i<obj.rows.length;++i)
			{
				if (j == 6)
					break;
				if (obj.rows[i].id.indexOf("resume_") != -1)
					++j;
			}
			obj.insertRow(i);
			obj.rows[i].insertCell(0);
			obj.rows[i].id = "word_b2";
			obj.rows[i].cells[0].colSpan = (obj.rows[0].cells.length > 1 ? obj.rows[0].cells.length : obj.rows[0].cells[0].colSpan);
			obj.rows[i].cells[0].bgColor = "#F7F8F3";
			obj.rows[i].cells[0].align = "center";
			obj.rows[i].cells[0].innerHTML = wordAd2;
		}
		if (typeof(wordAd3) == "string" && wordAd3 != "")
		{
			if ($("word_b3") != null)
				obj.deleteRow($("word_b3").rowIndex);
			var j = 0, i = 0;
			for (;i<obj.rows.length;++i)
			{
				if (j == 9)
					break;
				if (obj.rows[i].id.indexOf("resume_") != -1)
					++j;
			}
			obj.insertRow(i);
			obj.rows[i].insertCell(0);
			obj.rows[i].id = "word_b3";
			obj.rows[i].cells[0].colSpan = (obj.rows[0].cells.length > 1 ? obj.rows[0].cells.length : obj.rows[0].cells[0].colSpan);
			obj.rows[i].cells[0].bgColor = "#F7F8F3";
			obj.rows[i].cells[0].align = "center";
			obj.rows[i].cells[0].innerHTML = wordAd3;
		}
		if (typeof(wordAd4) == "string" && wordAd4 != "")
		{
			if ($("word_b4") != null)
				obj.deleteRow($("word_b4").rowIndex);
			var j = 0, i = 0;
			for (;i<obj.rows.length;++i)
			{
				if (j == 15)
					break;
				if (obj.rows[i].id.indexOf("resume_") != -1)
					++j;
			}
			obj.insertRow(i);
			obj.rows[i].insertCell(0);
			obj.rows[i].id = "word_b4";
			obj.rows[i].cells[0].colSpan = (obj.rows[0].cells.length > 1 ? obj.rows[0].cells.length : obj.rows[0].cells[0].colSpan);
			obj.rows[i].cells[0].bgColor = "#F7F8F3";
			obj.rows[i].cells[0].align = "center";
			obj.rows[i].cells[0].innerHTML = wordAd4;
		}
		if (typeof(wordAd5) == "string" && wordAd5 != "")
		{
			if ($("word_b5") != null)
				obj.deleteRow($("word_b5").rowIndex);
			var j = 0, i = 0;
			for (;i<obj.rows.length;++i)
			{
				if (j == 18)
					break;
				if (obj.rows[i].id.indexOf("resume_") != -1)
					++j;
			}
			obj.insertRow(i);
			obj.rows[i].insertCell(0);
			obj.rows[i].id = "word_b5";
			obj.rows[i].cells[0].colSpan = (obj.rows[0].cells.length > 1 ? obj.rows[0].cells.length : obj.rows[0].cells[0].colSpan);
			obj.rows[i].cells[0].bgColor = "#F7F8F3";
			obj.rows[i].cells[0].align = "center";
			obj.rows[i].cells[0].innerHTML = wordAd5;
		}
	}
	else
	{
		if (obj2 != null)
		{
			if (typeof(wordAd) == "string" && wordAd != "")
			{
				if ($("word_b1") != null)
					obj2.deleteRow($("word_b1").rowIndex);
				var j = 0, i = 0;
				for (;i<obj2.rows.length;++i)
				{
					if (j == 3)
						break;
					if (obj2.rows[i].id.indexOf("resume_") != -1)
						++j;
				}
				obj2.insertRow(i);
				obj2.rows[i].insertCell(0);
				obj2.rows[i].id = "word_b1";
				obj2.rows[i].cells[0].colSpan = obj2.rows[0].cells.length;
				obj2.rows[i].cells[0].bgColor = "#F7F8F3";
				obj2.rows[i].cells[0].align = "center";
				obj2.rows[i].cells[0].innerHTML = wordAd;
			}
			
			if (typeof(wordAd4) == "string" && wordAd4 != "")
			{
				if ($("word_b4") != null)
					obj2.deleteRow($("word_b4").rowIndex);
				var j = 0, i = 0;
				for (;i<obj2.rows.length;++i)
				{
					if (j == 13)
						break;
					if (obj2.rows[i].id.indexOf("resume_") != -1)
						++j;
				}
				obj2.insertRow(i);
				obj2.rows[i].insertCell(0);
				obj2.rows[i].id = "word_b4";
				obj2.rows[i].cells[0].colSpan = obj2.rows[0].cells.length;
				obj2.rows[i].cells[0].bgColor = "#F7F8F3";
				obj2.rows[i].cells[0].align = "center";
				obj2.rows[i].cells[0].innerHTML = wordAd4;
			}
		}
		if (obj3 != null)
		{
			if (typeof(wordAd2) == "string" && wordAd2 != "")
			{
				if ($("word_b2") != null)
					obj3.deleteRow($("word_b2").rowIndex);
				var j = 0, i = 0;
				for (;i<obj3.rows.length;++i)
				{
					if (j == 3)
						break;
					if (obj3.rows[i].id.indexOf("resume_") != -1)
						++j;
				}
				obj3.insertRow(i);
				obj3.rows[i].insertCell(0);
				obj3.rows[i].id = "word_b2";
				obj3.rows[i].cells[0].colSpan = obj3.rows[0].cells.length;
				obj3.rows[i].cells[0].bgColor = "#F7F8F3";
				obj3.rows[i].cells[0].align = "center";
				obj3.rows[i].cells[0].innerHTML = wordAd2;
			}
			
			if (typeof(wordAd3) == "string" && wordAd3 != "")
			{
				if ($("word_b3") != null)
					obj3.deleteRow($("word_b3").rowIndex);
				var j = 0, i = 0;
				for (;i<obj3.rows.length;++i)
				{
					if (j == 13)
						break;
					if (obj3.rows[i].id.indexOf("resume_") != -1)
						++j;
				}
				obj3.insertRow(i);
				obj3.rows[i].insertCell(0);
				obj3.rows[i].id = "word_b3";
				obj3.rows[i].cells[0].colSpan = obj3.rows[0].cells.length;
				obj3.rows[i].cells[0].bgColor = "#F7F8F3";
				obj3.rows[i].cells[0].align = "center";
				obj3.rows[i].cells[0].innerHTML = wordAd3;
			}
		}
	}
}

function ChangeRsmEncode(str, bh)
{
	if (str == "")
	{
		return "";
	}
	if (str == "[delmc]")
	{
		if ($("mc_" + bh) != null)
			$("mc_" + bh).style.display = "none";
		return "";
	}
	else if (str == "[showmc]")
	{
		if ($("mc_" + bh) != null)
			$("mc_" + bh).style.display = "";
		return "";
	}
	var rltstr = "";
	var tmpstr = new Array();
	var i=0;

	if (live_f.Encode != "big" && live_f.Encode != "gb" && str.substring(0, 1) == "*")
	{
		str = str.substring(1, str.length);
		if (str.indexOf("{") != -1 && str.indexOf("}") != -1)
		{
			str = str.substring(str.indexOf("{")+1, str.indexOf("}"));
			var tmpsource = str.split("|");
			if (live_f.Encode == "en")
				str = tmpsource[0];
			else if (live_f.Encode == "vn")
				str = (tmpsource.length > 1) ? tmpsource[1] : tmpsource[0];
			else if (live_f.Encode == "th")
				str = (tmpsource.length > 2) ? tmpsource[2] : tmpsource[0];
			else if (live_f.Encode == "kr")
				str = (tmpsource.length > 3) ? tmpsource[3] : tmpsource[0];
		}
		else
		{
			str = "";
		}
	}
	else
	{
		if (str.substring(0,1) == "*")
			str = str.substring(1, str.length);
		if (str.indexOf("{") != -1 && str.indexOf("}") != -1)
			str = str.replace(str.substring(str.indexOf("{"), str.indexOf("}")+1), "");
	}
	if (str == "" || str == "^")
		return "";
	tmpstr = str.split(",");
	for (i=0;i<tmpstr.length;i++)
	{
		if (tmpstr[i].substring(1,2) == "[")
		{
			var idx = tmpstr[i].substring(0,1);
			if (typeof(RESUME_ARR[idx]) != "undefined")
			{
				if (idx == "8")
				{
					if (live_f.Encode != "en")
					{
						var Links = tmpstr[i].substring(2,tmpstr[i].length - 1).split(';');
						var strLinks = "";
						for (var j = 0; j < Links.length; ++j)
						{
							if (j > 0)
								strLinks += ', ';
							strLinks += '<a href="' + Links[j] + '" target="_blank">' + RESUME_ARR[idx] + (Links.length > 1  ? (j + 1) : '') + '</a>';
						}
						tmpstr[i] = strLinks;
					}
					else
					{
						tmpstr[i] = "";
					}
				}
				else
				{
					tmpstr[i] = RESUME_ARR[idx] + tmpstr[i].substring(1,tmpstr[i].length);
				}
			}
		}
		if (i > 0)
			rltstr += ',';
		rltstr += tmpstr[i];
	}
	if (rltstr != "")
		rltstr = "<font color=blue>" + rltstr.substring(0,rltstr.length).replace("^", "") + "</font>";
	
	return rltstr
}

function hiderow(bh)
{
	var row = $("bh" + bh);
	if (row != null)
	{
		row.style.display = "none";
		$("resume_" + bh).style.display = "none";
		hideCount++;
		$("hider").innerHTML = hideCount;
		if ($("hider_lk").style.display != "")
			$("hider_lk").style.display = "";
	}
}

function HideMatch(obj)
{
	var Matchbody = obj.parentNode.parentNode.parentNode;
	for (var i = 0; i < Matchbody.childNodes.length; ++i)
	{
		if (Matchbody.childNodes[i].nodeName == "TR")
		{
			var row_id = Matchbody.childNodes[i].id;
			if (row_id.substring(0, 2) == "bh")
				hiderow(row_id.substring(2));
		}
	}
	obj.parentNode.parentNode.style.display = "none";
}

function CheckTR(bh)
{
	var Matchbody = $("bh" + bh).parentNode;
	var rowindex = 0;
	for (var i = 0; i < Matchbody.childNodes.length; ++i)
	{
		if (Matchbody.childNodes[i].nodeName == "TR")
		{
			if (Matchbody.childNodes[i].id.indexOf("bh") != -1)
			{
				if (Matchbody.childNodes[i].style.display == "")
				{
					return;
				}
			}
			else if (Matchbody.childNodes[i].id == "")
			{
				if (rowindex == 0)
					rowindex = i;
			}
		}
	}
	Matchbody.childNodes[rowindex].style.display = "none";
}

function ProcessTime()
{
	if (typeof(live_f.sDt2) == "object")
	{
		var AmountTime = 0;
		var objBssj = null;
		for (var i in live_f.sDt2)
		{
			if (live_f.sDt2[i][0] == 1)
			{
				AmountTime = parseInt((new Date() - Date.parse(live_f.sDt2[i][5])) / 1000 /60) + live_f.Timegap;
				if (AmountTime < 0) AmountTime = 0;
				if (AmountTime > 45) AmountTime = 45;
				objBssj = (typeof(live_f.ObjArr[i]) == "object" && live_f.ObjArr[i].row != null) ? live_f.ObjArr[i].ptime : $("bssj" + i);
				if (objBssj != null && objBssj.innerHTML != AmountTime + "'")
				{
					objBssj.innerHTML = AmountTime + "'";
				}
			}
			else if (live_f.sDt2[i][0] == 3)
			{
				AmountTime = parseInt((new Date() - Date.parse(live_f.sDt2[i][5])) / 1000 /60) + live_f.Timegap + 45;
				if (AmountTime < 46) AmountTime = 46;
				if (AmountTime > 90) AmountTime = 90;
				objBssj = (typeof(live_f.ObjArr[i]) == "object" && live_f.ObjArr[i].row != null) ? live_f.ObjArr[i].ptime : $("bssj" + i);
				if (objBssj != null && objBssj.innerHTML != AmountTime + "'")
				{
					objBssj.innerHTML = AmountTime + "'";
				}
			}
		}
	}
	if (typeof(ProcessTime_Timer) == "number")
		clearTimeout(ProcessTime_Timer);
	ProcessTime_Timer = setTimeout("ProcessTime()", 60000);
}

function PlaySound()
{
	$("bs").innerHTML = jqsy;
}

var xmlhttp = null;
var xmlhttp2 = null;
var xmlhttpPK = null;
var xmlhttpSearch = null;
var isIE = true;
var parser = null;
var oSerializer = null;
var XmlDoc = null;
var XmlDoc2 = null;
var PkXmlDoc = null;
var searchXmlDoc = null;

if(window.ActiveXObject)
{
	try
	{
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");
		xmlhttpPK = new ActiveXObject("Microsoft.XMLHTTP");
		xmlhttpSearch = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch(e)
	{ 
		xmlhttp = new ActiveXObject("MsXml2.XMLHTTP");
		xmlhttp2 = new ActiveXObject("MsXml2.XMLHTTP");
		xmlhttpPK = new ActiveXObject("MsXml2.XMLHTTP");
		xmlhttpSearch = new ActiveXObject("MsXml2.XMLHTTP");
	}
}
else
{
	xmlhttp = new XMLHttpRequest();
	xmlhttp2 = new XMLHttpRequest();
	xmlhttpPK = new XMLHttpRequest();
	xmlhttpSearch = new XMLHttpRequest();
	parser = new DOMParser();
	oSerializer = new XMLSerializer();
	isIE = false;
}

function OpenXml()
{
	try
	{
		xmlhttp.open("get", "http://en2.7m.cn/livedata/sxl.xml?" + Date.parse(new Date()), true);
		xmlhttp.onreadystatechange = livexmlonreadystatechange;
		xmlhttp.send(null);
	}
	catch(e)
	{
	}
	if (typeof(OpenXml_Timer) == "number")
		clearTimeout(OpenXml_Timer);
	OpenXml_Timer = setTimeout("OpenXml()", bfRefreshTime);
}

function livexmlonreadystatechange()
{
	if (xmlhttp.readyState != 4 || (xmlhttp.status != 200 && xmlhttp.status != 0))
		return;
	var newxml = "";
	if(isIE)
	{
		XmlDoc = xmlhttp.responseXML;
		newxml = XmlDoc.xml;
		if(newxml == "" || newxml == oldxml)
			return;
	}
	else
	{
		XmlDoc = parser.parseFromString(xmlhttp.responseText, "text/xml");
		if(XmlDoc.documentElement.tagName == "parsererror")
			return;
		newxml= oSerializer.serializeToString(XmlDoc.documentElement);
		if(newxml == "" || newxml == oldxml)
			return;
	}
	GoalTips = "";
	GoalTips_Count = 0;
	var root = XmlDoc.documentElement;
	var ResetPage = root.getElementsByTagName("Rst")[0].firstChild.nodeValue;
	if (!setRefreshValue)
	{
		reflag = ResetPage;
		setRefreshValue = true;
	}
	if (reflag != ResetPage)
	{
		setRefreshValue = false;
		var Rnd = Math.round(Math.random()*19000)+1000;
		setTimeout("live_f.location.reload()", Rnd);
		return;
	}
	var nextfn = parseInt(root.getElementsByTagName("fn")[0].firstChild.nodeValue);
	if ((nextfn - 1) > live_f.GetFlagNum)
	{
		OpenXml2();
		return;
	}
	var cNode = root.getElementsByTagName("C");
	for(var i=0;i<cNode.length;++i)
		eval('Update_Live(' + cNode[i].firstChild.nodeValue +')');
	oldxml = newxml;
	live_f.GetFlagNum++;
	if (SelectGoalSound)
	{
		if(GoalSound)
		{
			PlaySound();
			GoalSound = false;
		}
		if(ErrorGoalSound)
		{
			$("bs4").innerHTML = errjqsy;
			ErrorGoalSound = false;
		}
		if(RedSound)
		{
			$("bs3").innerHTML = redsy;
			RedSound = false;
		}
	}
	if (GoalTips_Count > 0)
	{
		ShowGoalTips();
	}
}

function OpenXml2()
{
	try
	{
		xmlhttp2.open("Get", "http://en2.7m.cn/livedata/sxl_" + live_f.GetFlagNum + ".xml?" + Date.parse(new Date()), true);
		xmlhttp2.onreadystatechange = livexmlonreadystatechange2;
		xmlhttp2.send(null);
	}
	catch(e)
	{
	}
}

function livexmlonreadystatechange2()
{
	if (xmlhttp2.readyState != 4 || (xmlhttp2.status != 200 && xmlhttp2.status != 0))
		return;
	if(isIE)
	{
		XmlDoc2 = xmlhttp2.responseXML;
		if(XmlDoc2.xml == "")
			return;
	}
	else
	{
		XmlDoc2 = parser.parseFromString(xmlhttp2.responseText, "text/xml");
		if(XmlDoc2.documentElement.tagName == "parsererror")
			return;
		
	}
	GoalTips = "";
	GoalTips_Count = 0;
	var root = XmlDoc2.documentElement;
	var cNode = root.getElementsByTagName("C");
	for(var i=0;i<cNode.length;++i)
		eval('Update_Live(' + cNode[i].firstChild.nodeValue +')');
	live_f.GetFlagNum =	parseInt(root.getElementsByTagName("fn")[0].firstChild.nodeValue);
	if (SelectGoalSound)
	{
		if(GoalSound)
		{
			PlaySound();
			GoalSound = false;
		}
		if(ErrorGoalSound)
		{
			$("bs4").innerHTML = errjqsy;
			ErrorGoalSound = false;
		}
		if(RedSound)
		{
			$("bs3").innerHTML = redsy;
			RedSound = false;
		}
	}
	if (GoalTips_Count > 0)
	{
		ShowGoalTips();
	}
}

function OpenPkXml(fn)
{
	try
	{
		xmlhttpPK.open("Get", fn + "?" + Date.parse(new Date()), true);
		xmlhttpPK.onreadystatechange = pkxmlonreadystatechange;
		xmlhttpPK.send(null);
	}
	catch(e)
	{
	}
	if (typeof(OpenPkXml_Timer) == "number")
		clearTimeout(OpenPkXml_Timer);
	OpenPkXml_Timer = setTimeout("OpenPkXml('" + fn + "')", pkRefreshTime);
}

function pkxmlonreadystatechange()
{
	if (xmlhttpPK.readyState != 4 || (xmlhttpPK.status != 200 && xmlhttpPK.status != 0))
		return;
	var v = "";
	if(isIE)
	{
		PkXmlDoc = xmlhttpPK.responseXML;
		new_Pk_xml = PkXmlDoc.xml;
		if(new_Pk_xml == "" || new_Pk_xml == old_Pk_xml)
			return;
	}
	else
	{
		PkXmlDoc = parser.parseFromString(xmlhttpPK.responseText, "text/xml");
		if(PkXmlDoc.documentElement.tagName == "parsererror")
			return;
		new_Pk_xml = oSerializer.serializeToString(PkXmlDoc.documentElement);
		if(new_Pk_xml == "" || new_Pk_xml == old_Pk_xml)
			return;
	}
	var root = PkXmlDoc.documentElement.getElementsByTagName("C");
	for(var i=0;i<root.length;++i)
		eval('Update_Pk(' + root[i].firstChild.nodeValue +')');
	
	//PK2
	root = PkXmlDoc.documentElement.getElementsByTagName("C2");
	for(var i=0;i<root.length;++i)
		eval('Update_Pk2(' + root[i].firstChild.nodeValue +')');
		
	old_Pk_xml = new_Pk_xml;
	if (chkpksound && SelectGoalSound)
	{
		$("pk").innerHTML = rqsound;
		chkpksound=false;
	}
	if (chkswsound && SelectGoalSound)
	{
		$("sw").innerHTML = swsound;
		chkswsound=false;
	}
}

function InsertInfo(c0,c1,c2,c3)
{
	$("last_info").insertRow(0);
	$("last_info").rows[0].insertCell(0);
	$("last_info").rows[0].cells[0].colSpan = 4;
	$("last_info").rows[0].cells[0].align = "center";
	$("last_info").rows[0].cells[0].innerHTML = "<img src=http://img.7m.cn/icon/shade.gif width=100% height=1>"
	$("last_info").insertRow(0);
	$("last_info").rows[0].insertCell(0);
	$("last_info").rows[0].insertCell(0);
	$("last_info").rows[0].insertCell(0);
	$("last_info").rows[0].insertCell(0);
	$("last_info").rows[0].cells[0].innerHTML = c0;
	$("last_info").rows[0].cells[1].innerHTML = c1;
	$("last_info").rows[0].cells[2].align = "center";
	$("last_info").rows[0].cells[2].innerHTML = c2;
	$("last_info").rows[0].cells[3].align = "right";
	$("last_info").rows[0].cells[3].innerHTML = c3;
	$("last_info").rows[0].cells[0].width = "9%";
	$("last_info").rows[0].cells[1].width = "38%";
	$("last_info").rows[0].cells[2].width = "15%";
	$("last_info").rows[0].cells[3].width = "38%";
	if ($("last_info").rows.length >= 70)
	{
		for(var i=0;i<4;i++)
			$("last_info").deleteRow($("last_info").rows.length - 1);
	}
}

function Replace_Team_name(str)
{
	var rltstr = str;
	if (live_f.Encode == "en" || live_f.Encode == "vn" || live_f.Encode == "th")
	{
		if (rltstr.length > 21)
			rltstr = rltstr.substring(0, 21);
	}
	else
	{
		if (rltstr.length > 8)
			rltstr = rltstr.substring(0, 8);
	}	
	return rltstr.replace("(中)", "").replace("(H)", "");
}

function MoveGame(bh)
{
	if ($("gameover") != null)
	{
		if ($("gameover").style.display == "none")
			$("gameover").style.display = "";
	}
	if (EndGamebh.indexOf("[" + bh + "]") == -1)
	{
		var row1 = $("bh" + bh);
		if (row1 == null)
			return;
		var row2 = $("resume_" + bh)
		row1.parentNode.appendChild(row1);
		row2.parentNode.appendChild(row2);
		EndGamebh += "[" + bh + "]";
		if (($("live_Table").rows[1].id == "" && $("live_Table").rows[2].id == "") || ($("live_Table").rows[1].id == "" && $("live_Table").rows[2].id == "gameover"))
			$("live_Table").deleteRow(1);
		ShowWordAd();
	}
}

function ChkIe()
{
	var isMinIE4 = (document.all) ? 1 : 0;
	var verDetail = 0;
	try{
		verDetail = parseFloat(navigator.appVersion.substring(navigator.appVersion.indexOf("MSIE")+4));
	}
	catch(e){
		verDetail = 0;
	}
	var isMinIE55 = (isMinIE4 && verDetail > 5) ? 1 : 0;
	var bcontinue = true;
	if(!isMinIE55){
		bcontinue = false;
	}
	return bcontinue;
}

function Gold(live,bf,an,bn,Class,glColor)
{
	GoalTips += '<div style="float: left; width: 100%; margin-top: 6px; font-size: 14px; background: #FFF;">'
				+ '<div style="float: left; height: 20px; line-height: 150%; width: 26%; font-family: Tahoma;color: #FFFFFF; text-align: center; font-weight: bold; background: ' + glColor + ';">' + Class + '</div>'
				+ '<div style="float: left; height: 20px; line-height: 150%; width: 31%; font-family: Tahoma;font-weight: bold; padding-left: 3px;text-align: right; word-break: break-all;overflow: hidden;">' + an + '</div>'
				+ '<div style="float: left; height: 20px; line-height: 20px; width: 9%; font-weight: bold; font-size: 16px; text-align: center; word-break: break-all;">' + bf + '</div>'
				+ '<div style="float: left; height: 20px; line-height: 150%; width: 31%; font-family: Tahoma;font-weight: bold; padding-left: 3px;text-align: left; word-break: break-all;overflow: hidden;">' + bn + '</div>'
				+ '</div>';
	GoalTips_Count++;
}

var TipsC = 30;
function ShowGoalTips()
{
	if (isIE)
	{
		if (TipsPopupS)
			PkTipsClose();
		tipswidth = GOAL_TIPS_WIDTH;
		tipsheight = GoalTips_Count * 27;
		var tips_ad = "";
		if (typeof(TipsAd) != "undefined" && TipsAd != "")
		{
			tipsheight += 26;
			tips_ad = '<div style="width: 100%; line-height: 21px; background-color: #FFE; text-align: center; color: #00F; font-weight: 700; margin-top: 5px;">' + TipsAd + '</div>';
		}
		GoalTips =	 '<div style="border: 1px solid #999999;width: ' + tipswidth + 'px;background: #FFFFFF;">'
					+ '<div style="float: left; border: 1px solid #FFFFFF;font-size: 12px;background: #EFEFEF;padding: 2px;">'
					+ '<div style="float: left; color: #FFFFFF;font-size: 12px;background: #006633;font-family: Tahoma;font-weight: bold;text-align: right;padding-top: 2px;padding-bottom: 2px;padding-right: 6px;width: 100%;height: 19px;">www.7m.cn</div>'
					+ GoalTips
					+ tips_ad
					+ '</div>'
					+ '</div>';
		sPopup = window.createPopup();
		sPopupBody = sPopup.document.body;
		sPopupBody.style.cursor="pointer";
		sPopupBody.innerHTML = GoalTips;
		sPopup.document.body.onmouseover = new Function("clearTimeout(topMost)");
		sPopup.document.body.onmouseout = PopupSoccerShow;
		sPopup.document.body.oncontextmenu = PopupSoccerClose;
		sPopup.document.body.onclick = PopupSoccerClose;
		TipsC = 30;
		PopupSoccerShow();
	}
}

function PopupSoccerShow()
{
	sPopup.show(screen.width / 2 - (tipswidth / 2), 0, tipswidth, 28 + tipsheight);
	if (typeof(topMost) == "number")
		clearTimeout(topMost);
	topMost=setTimeout("PopupSoccerShow()", 500);
	sPopupS = true;
	if (TipsC < 0)
		PopupSoccerClose();
	--TipsC;
}

function PopupSoccerClose()
{
	clearTimeout(topMost);
	sPopup.hide();
	sPopupS = false;
}

var jqsy2 = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="1" height="1" id="v' + 'o' + 'i" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="http://en2.7m.cn/img/v' + 'o' + 'i' + '.' + 's' + 'w' + 'f" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="http://en2.7m.cn/img/v' + 'o' + 'i' + '.' + 's' + 'w' + 'f" quality="high" bgcolor="#ffffff" width="1" height="1" name="v' + 'o' + 'i" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';var voiobj;function goaltips(){if ($("bs2").innerHTML == ""){$("bs2").innerHTML = jqsy2;}}var getcfed = false;function GetVoiOjb(){if (voiobj == null){voiobj = (document.embeds.length) ? document.embeds["voi"] : $("voi");}}function GetCF(){if (!getcfed){GetVoiOjb();voiobj.GCF(voi_lng);getcfed = true;}}function SetVoiLs(v){if (!getcfed){GetCF();}voiobj.SetList(v);}
var voiArr = new Array();
function SelectVoi(chkobj, bh)
{
	if (chkobj.className == "sOFF")
	{
		SetVoiLs(live_f.sDt[bh][9]);SetVoiLs("#VS");SetVoiLs(live_f.sDt[bh][10]);
		voiArr[bh] = 1;
		chkobj.className = "sON";
	}
	else
	{
		voiArr[bh] = null;
		chkobj.className = "sOFF";
	}
}

/**pk**/

function showwl()
{
	if (typeof(live_f.sDt) != "object") return;
	var visible = ($("worl").checked) ? "" : "none";
	for (var i in live_f.sDt)
	{
		$("wina" + i).style.display = visible;
		$("winb" + i).style.display = visible;
	}
}

function showpk()
{
	if (typeof(live_f.sDt) != "object") return;
	var visible = ($("pkchk").checked) ? "" : "none";
	for (var i in live_f.sDt)
	{
		if (live_f.sDt2[i][10] != "")
		{
			if ($("pk" + i) != null)
				$("pk" + i).style.display = visible;
			if ($("pk2_l_" + i) != null)
				$("pk2_l_" + i).style.display = visible;
			if ($("pk2_" + i) != null)
				$("pk2_" + i).style.display = visible;
			$("rqf1" + i).style.display = visible;
			$("rqf2" + i).style.display = visible;
			$("sw1" + i).style.display = visible;
			$("sw2" + i).style.display = visible;
		}
	}
}

var pkTipsC = 30;
function PkTips(Class,glColor,Code)
{
	if (sPopupS) return;
	var TipsPopText = '<table cellSpacing=0 cellPadding=0 width=250 border=0>' +
						  '<tr>'+
							  '<td width=1></td>' +
							  '<td width=248 bgcolor=#999999></td>'+
							  '<td width=1></td>'+
						  '</tr>'+
						  '<tr>' +
							  '<td width=1 bgcolor=#999999></td>'+
							  '<td bgcolor=#efefef>' +
								  '<table cellspacing=3 cellpadding=3 width="100%" border=1 style="border-collapse: collapse;font-size:12px;font-family: Tahoma;" bordercolor="#FFFFFF">' +
									  '<tr>' +
										  '<td bgcolor=' + glColor + '>' +
											  '<table border="0" cellpadding="2" cellspacing="0" width="100%" style="font-size:12px;font-family: Tahoma;">' +
												  '<tr>' +
													  '<td width="50%" style="color: #FFFFFF; font-weight: bold;">' + Class + '</td>' +
													  '<td width="50%" style="color: #FFFFFF; font-weight: bold;" align="right">WWW.7M.CN</td>' +
												  '</tr>' +
											  '</table>' +
										  '</td>' +
									  '</tr>' +
									  '<tr>' +
										  '<td bgcolor=#FFFFFF>' +
											  '<table style="font-family: Tahoma;font-size:12px" border="0" cellpadding="0" cellspacing="0" width=100%>'+
												Code+
											  '</table>' +
										  '</td>' +
									  '</tr>' +
								  '</table>' +
							  '</td>' +
							  '<td width=1 bgcolor=#999999></td>' +
						  '</tr>' +
						  '<tr>' +
							  '<td width=1></td>' +
							  '<td bgcolor=#999999></td>' +
							  '<td width=1></td>' +
						  '</tr>' +
					'</table>';
	if (isIE)
	{
		TipsPopup = window.createPopup();
		TipsPopupBody = TipsPopup.document.body;
		TipsPopupBody.style.cursor="pointer";
		TipsPopupBody.innerHTML = TipsPopText;
		TipsPopup.document.body.onmouseover = new Function("clearTimeout(TipstopMost)");
		TipsPopup.document.body.onmouseout = PkTipsShow;
		TipsPopup.document.body.oncontextmenu = PkTipsClose;
		TipsPopup.document.body.onclick = PkTipsClose;
		pkTipsC = 30;
		PkTipsShow();
	}
}

function PkTipsShow()
{
	TipsPopup.show(screen.width,0,250,90);
	if (typeof(TipstopMost) == "number")
		clearTimeout(TipstopMost);
	TipstopMost=setTimeout("PkTipsShow()",500);
	TipsPopupS = true;
	if (pkTipsC < 0)
		PkTipsClose();
	--pkTipsC;
}

function PkTipsClose()
{
	clearTimeout(TipstopMost);
	TipsPopup.hide();
	TipsPopupS = false;
}

function SpeakSetting(ecd)
{
	var obj = $("speak_setting");
	if (obj.innerHTML == "")
		obj.innerHTML = '<iframe src="http://en2.7m.cn/speak_setting_' + ecd + '.htm" frameborder="0" width="220" height="150" scrolling="no"></iframe>';
	with(obj.style)
	{
		left = (window.screen.width-parseInt(width))/2 + "px";
		top = (window.screen.height-parseInt(height))/3 + "px";
		display = "";
	}
}

function CloseSpeakSetting(ecd)
{
	$("speak_setting").style.display = "none";
}

function ChangeLine(n)
{
	var re = /http:\/\/(\S+?\.7m\.cn[^\/]*?)\/\S+/i;
	var u = top.location.href;
	if (re.test(u))
	{
		var h = u.replace(re, "$1");
		top.location.href = u.replace(h, "live" + n + ".7m.cn");
	}
}

function HideRank(tp)
{
	var rankObj = $("live_Table").getElementsByTagName("sup");
	var visible = (tp.checked) ? "" : "none";
	for (var i = 0; i < rankObj.length; ++i)
	{
		rankObj[i].style.display = visible;
	}
}

var sg_move = false;
var mb_pki = 18;
var cb_pki = 19;
function sg(bh, event)
{
	if (typeof(live_f.sDt2) != "object") return;
	if (typeof(live_f.sDt2[bh]) != "object") return;
	if (live_f.sDt2[bh][0] == 6 || live_f.sDt2[bh][0] == 13 || live_f.sDt2[bh][0] == 14)
		return;
	var ecd = live_f.Encode;
	if (ecd == "big")
		ecd = 'ft';
	else if (ecd == "gb")
		ecd = 'jt';
	$("sg").style.left =  (event.clientX + document.documentElement.scrollLeft - 170) + "px";
	$("sg").style.top = (event.clientY + document.documentElement.scrollTop + 20) + "px";
	sg_move = true;
	d_pi = undefined;
	var detail = $("goaldetail");
	var s = document.createElement("script");
	s.type = "text/javascript";
	s.src = "http://" + datahost + ":13000/goaldata/" + ecd + "/" + bh + ".js?" +Date.parse(new Date());
	detail.appendChild(s, "script");
	detail.removeChild(detail.firstChild);
	s.onload = s.onreadystatechange = function() {
		if(!this.readyState || this.readyState=="loaded" || this.readyState=="complete")
		{
			if (sg_move)
			{
				var ghtm = '';
				if ((typeof(live_f.sDt[bh][mb_pki]) != "undefined" && live_f.sDt[bh][mb_pki] != "") || (typeof(live_f.sDt[bh][cb_pki]) != "undefined" && live_f.sDt[bh][cb_pki] != ""))
				{
					if (live_f.sDt[bh][mb_pki] != '')
						ghtm += '<tr><td colspan="5" class="si_odds">' + BASE_HANDICAP + (parseFloat(live_f.sDt[bh][mb_pki]) > 0 ?  AWAY_HANDICAP_STR : HOME_HANDICAP_STR).replace("?", ChangePkData(Math.abs(live_f.sDt[bh][mb_pki]) * 4)) + '</td></tr>';
					else if (live_f.sDt[bh][cb_pki] != '')
						ghtm += '<tr><td colspan="5" class="si_odds">' + BASE_HANDICAP + (parseFloat(live_f.sDt[bh][cb_pki]) > 0 ?  AWAY_HANDICAP_STR : HOME_HANDICAP_STR).replace("?", ChangePkData(Math.abs(live_f.sDt[bh][cb_pki]) * 4)) + '</td></tr>';
				}
				else
				{
					if (live_f.sDt2[bh][0] == 17)
						return;
				}
				if (typeof(d_pi) != "undefined" && d_pi.length > 0)
				{
					for (var i = 0; i <d_pi.length; ++i)
					{
						if (d_sx[i] == 0)
							ghtm += '<tr><td width="10%"><img border="0" src="http://img.7m.cn/goal_img/s' + d_lx[i] + '.gif"></td><td width="35%">' + d_pn[i] + '</td><td width="10%" class="si_time">' + d_tm[i] + '\'</td><td width="35%"></td><td width="10%"></td></tr>';
						else
							ghtm += '<tr><td width="10%"></td><td width="35%"></td><td width="10%" class="si_time">' + d_tm[i] + '\'</td><td width="35%">' + d_pn[i] + '</td><td width="10%"><img border="0" src="http://img.7m.cn/goal_img/s' + d_lx[i] + '.gif"></td></tr>';
					}
					ghtm += '<tr><td colspan="5" class="si_tips">' + GOALDETAIL + '</td></tr>';
				}
				if (ghtm != '')
				{
					if (typeof(goalTipsAd) != "undefined" && goalTipsAd != "")
						ghtm += '<tr><td colspan="5" align="center">' + goalTipsAd + '</td></tr>';
					$("sg").innerHTML = '<table cellpadding="2" cellspacing="1" class="si_tb">' + ghtm + '</table>';
					$("sg").style.visibility = "visible";
				}
			}
		}
	};
}

function cg()
{
	sg_move = false;
	$("sg").innerHTML = "";
	$("sg").style.visibility = "hidden";
}

function SearchTeam(keyv)
{
	if (keyv != "")
	{
		ShowSearch();
		$("tList").innerHTML = '<div class="mloading"><img src="http://img.7m.cn/v2/mload.gif" /><br />Loading...</div>';
		$("tListCount").innerHTML = "0";
		var skeyv = 'k=' + keyv + '&e=' + LANGUAGE_INDEX;
		xmlhttpSearch.open("POST", "http://en2.7m.cn/query.aspx", true);
		xmlhttpSearch.onreadystatechange = SearchTeamReady;
		xmlhttpSearch.setRequestHeader("Content-Length", skeyv.length);   
		xmlhttpSearch.setRequestHeader("CONTENT-TYPE", "application/x-www-form-urlencoded");
		xmlhttpSearch.send(skeyv);
	}
}

function SearchTeamReady()
{
	if (xmlhttpSearch.readyState != 4 || (xmlhttpSearch.status != 200 && xmlhttpSearch.status != 0))
		return;

	if(isIE)
	{
		searchXmlDoc = xmlhttpSearch.responseXML;
		if(xmlhttpSearch.xml == "")
			return;
	}
	else
	{
		searchXmlDoc = parser.parseFromString(xmlhttpSearch.responseText, "text/xml");
		if(searchXmlDoc.documentElement.tagName == "parsererror")
			return;
	}
	var root = searchXmlDoc.documentElement;
	var cNode = root.getElementsByTagName("i");
	if (cNode.length > 0)
	{
		var strList = "";
		for(var i=0;i<cNode.length;++i)
		{
			strList += '<a href="javascript:" onclick="' + DETAILS_LINK_FUN_NAME + '(' + cNode[i].getAttribute("v") + ')">' + (cNode[i].getAttribute("s") != "17" ? '<strong>' + ChangeState(parseInt(cNode[i].getAttribute("s"))) + '</strong> ' : '') + cNode[i].getAttribute("a") + (cNode[i].getAttribute("sc") == "" ? ' VS ' : ' <strong>' + cNode[i].getAttribute("sc") + '</strong> ') + cNode[i].getAttribute("b")  + '</a>';
		}
		$("tList").innerHTML = strList;
	}
	else
	{
		$("tList").innerHTML = '<div class="rqs_none">' + NORECORED + '</div>';
	}
	$("tListCount").innerHTML = cNode.length;
}

function ShowSearch()
{
	$('sList').style.display = "block";
	if ($("select_sound") != null)
		$("select_sound").style.display = "none";
	if ($("select_Odds_sound") != null)
		$("select_Odds_sound").style.display = "none";
}

function HideSearch()
{
	$('sList').style.display = "none";
	if ($("select_sound") != null)
		$("select_sound").style.display = "";
	if ($("select_Odds_sound") != null)
		$("select_Odds_sound").style.display = "";
}
/*
function SearchMatch(bh, tp)
{
	hideCount = 0;
	var obj = $("live_Table");
	for (var i = 0; i < obj.rows.length; ++i)
	{
		if (obj.rows[i].id == "" || obj.rows[i].id.indexOf("word") != -1 || obj.rows[i].id.indexOf("gameover") != -1)
		{
			obj.rows[i].style.display = "none";
			continue;
		}
		if (obj.rows[i].id.indexOf("bh") != -1)
		{
			var live_bh = obj.rows[i].id.substr(2);
			var match_bh = live_f.sDt[live_bh][16];
			var sbh = (tp == 0) ? live_bh : match_bh;
			if (sbh != bh)
			{
				obj.rows[i].style.display = "none";
				obj.rows[i+1].style.display = "none";
				hideCount++;
			}
			else
			{
				obj.rows[i].style.display = "";
				if (obj.rows[i+1].cells[0].innerHTML != "")
					obj.rows[i+1].style.display = "";
				hideCount--;
			}
		}
	}
	if (hideCount  > 0)
	{
		$("hider").innerHTML = hideCount;
		if ($("hider_lk").style.display != "")
			$("hider_lk").style.display = "";
	}
}
*/

function mtab(index)
{
	switch(index) {
	case 0:
		$("stab0").className="select";
		$("stab1").className="unselect";
		$("stab2").className="unselect";
		$("gsbox0").className="block";
		$("gsbox1").className="unblock";
		break;
	case 1:
		$("stab0").className="unselect";
		$("stab1").className="select_m";
		$("stab2").className="unselect";
		$("gsbox0").className="unblock";
		$("gsbox1").className="block";
		break;
	case 2:
		$("stab0").className="unselect";
		$("stab1").className="unselect";
		$("stab2").className="select_r";
		$("gsbox0").className="unblock";
		$("gsbox1").className="block";
		break;
	}
}

function Hotmatches(s)
{
	var html = '';
	if (typeof(hotmatches) != "undefined")
	{
		html = '<tr>';
		for (var i = 0; i < hotmatches.length; ++i)
		{
			if (i > 0 && i % s == 0)
				html += '</tr><tr>';
			html += '<td><a href="javascript:' + ZLK_LINK_FUN_NAME + '(' + hotmatches[i][0] + ')" title="' + hotmatches[i][1] + '">' + hotmatches[i][2] + '</a></td>';
		}
		html += '</tr>';
	}
	return html;
}
