﻿// JavaScript Document
var sPop = null;
document.write("<style type='text/css'>");
document.write(".cPopText { font-family: Tahoma, Verdana; background-color: #FFFFCC; border: 1px #000000 solid; font-size: 12px; padding-right: 4px; padding-left: 4px; line-height: 18px; padding-top: 2px; padding-bottom: 2px; visibility: hidden;}");
document.write("</style>");
document.write("<div id='tb_popLayer' style='position:absolute;z-index:1000' class='cPopText'></div>");

function showPopupText(event) {
	if(event.srcElement) o = event.srcElement; else o = event.target;
	MouseX=event.clientX;
	MouseY=event.clientY;
	if(o.alt!=null && o.alt!="") { o.pop=o.alt;o.alt="" }
	if(o.title!=null && o.title!=""){ o.pop=o.title;o.title="" }
	if(o.pop!=sPop) {
		sPop=o.pop;
		if(sPop==null || sPop=="") {
			document.getElementById("tb_popLayer").style.visibility="hidden";        
		} else {	
			if(sPop.indexOf('<br>') == -1){o.title=sPop;return;}
			if(o.dyclass!=null) popStyle=o.dyclass; else popStyle="cPopText";
			document.getElementById("tb_popLayer").style.visibility="visible";
			showIt();
		}
	}
}

function showIt() {
	document.getElementById("tb_popLayer").className=popStyle;
	document.getElementById("tb_popLayer").innerHTML=sPop.replace(/<(.*)>/g,"<$1>").replace(/\n/g,"<br>");;
	popWidth=document.getElementById("tb_popLayer").clientWidth;
	popHeight=document.getElementById("tb_popLayer").clientHeight;
	if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24; else popLeftAdjust=0;
	if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24; else popTopAdjust=0;
	document.getElementById("tb_popLayer").style.left = (MouseX + 12 + document.documentElement.scrollLeft + popLeftAdjust) + "px";
	document.getElementById("tb_popLayer").style.top = (MouseY + 12 + document.documentElement.scrollTop + popTopAdjust) + "px";
}
if(!document.onmouseover) {
	document.onmouseover = function(e) {
		if (!e)showPopupText(window.event); else showPopupText(e);
	};
}


function subMenu()
{
	var html = '<a href="#" onclick="match_Date();return false;" id="sz_gr_-1">'+ match_sub_arr[0] +'</a> | '+ match_sub_arr[2] +' ';
	if(typeof(isstart) != "undefined")
	{
		for(var i=0; i< isstart.length; i++)
		{
			if(isstart[i] == 1)
			{
				html += '<a href="#" onclick="match_info('+ i +');return false;" id="sz_gr_'+ i +'">'+ type_name[i][m_index] +'</a>';
			}
			else
			{
				html += '<span style="color:#666666;">'+ type_name[i][m_index] +'</span>';
			}
			if(i != isstart.length - 1)
			{
				html += '　<span style="color:#666666;">|</span>　';
			}
		}
	}
	html += '　<span style="color:#666666;">|</span>　<a href="promotion.shtml">'+ str_promotion +'</a>';
	document.getElementById("subMenu").innerHTML = html;
}
function selectTab(num)
{
	for(var i = -1; i < 6; i++)
	{
		if(document.getElementById("sz_gr_"+ i) != null)
		{
			with(document.getElementById("sz_gr_"+ i).style){
				color="#CCCCCC";
				fontWeight="bold";
				textDecoration="underline";
			}
		}
	}
	with(document.getElementById("sz_gr_"+ num).style){
		color="#FFFFFF";
		fontWeight="bold";
		textDecoration="underline";
	}

}
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 setCookie(n, v)
{
	var exp = new Date();
	exp.setTime(exp.getTime() + (365*24*60*60*1000));
	document.cookie = n + "=" + v + ";expires=" + exp.toGMTString();
}
var dstinfo = 0;
function gettimezone()
{
	tzinfo = GetCurrentTimeZone();
    if(getCookie("7mWorldCupDST") != "")
    {
        dstinfo = getCookie("7mWorldCupDST");
    }
	if(getCookie("7mWorldCupTZ") != "")
    {
        tzinfo = getCookie("7mWorldCupTZ");
    }
}
var time_type = 1;
function loadmatch()
{
	if(time_type == 0)
	{
		match_info(curr);
	}
	else
	{
		match_Date();
	}
}
function ElementObj(bh)
{
	
    this.row = document.getElementById("bh" + bh); //比赛ID
    if (this.row == null)
        return;
    this.stime = document.getElementById("sj" + bh);  //时间
    this.ptime = document.getElementById("bssj" + bh); //比赛时间
    this.pstatus = document.getElementById("isstart" + bh); //转台
    this.teamA = document.getElementById("t_at" + bh); //主场球队
    this.teamB = document.getElementById("t_bt" + bh); //客场球队
    this.score = document.getElementById("bf" + bh); //比分
    this.hscore = document.getElementById("bc" + bh); //半场
    this.lA = document.getElementById("la" + bh); //主队比分
    this.lB = document.getElementById("lb" + bh); //客队比分
    this.rA = document.getElementById("ra" + bh); //主队红牌
    this.rB = document.getElementById("rb" + bh); //客队红牌
    this.resume = document.getElementById("resume_" + bh); //备注 tr
    this.resume_td = document.getElementById("resume_td" + bh); //备注 td
}
var html_title ='<tr class="head_t">'+
				'	<td class="mat_c"></td>'+
				'	<td class="rounds">'+ match_arr[1] +'</td>'+
				'	<td class="time">'+ match_arr[2] +'</td>'+
				'	<td class="state">'+ match_arr[7] +'</td>'+
				'	<td class="team">'+ match_arr[3] +'</td>'+
				'	<td class="score">'+ match_arr[4] +'</td>'+
				'	<td class="team">'+ match_arr[5] +'</td>'+
				'	<td class="half">'+ match_arr[8] +'</td>'+
				'	<td class="ctrl_b"></td>';
if(lan == "big" || lan == "gb")
{
	html_title += '<td class="sound"><a href="#" onclick="SpeakSetting(\''+ lan +'\')"><img height="11" src="http://img.7m.cn/s_img/icon_sound.gif" width="10"></a></td>';
}
html_title += '</tr>';

function match_Date()
{
	selectTab(-1);
	time_type = 1;
	gettimezone();
	ObjArr.length = 0;
	document.getElementById("daohang").innerHTML = match_sub_arr[1];
    document.getElementById("TimeZone").innerHTML = 'GMT'+ tzinfo + ((dstinfo == 1)?"["+ strDst +"]":"");
	var w_html = new Array();
	var e_html = new Array();
    if(typeof(c_m) != "undefined")
    {
		var html = '';
        for(var n in c_m)
        {
			if(typeof(c_bf[n]) == "undefined")
			{
				continue;
			}
			var isstart = c_bf[n][0];
			var bssj = '';
			if (isstart == 1 || isstart == 3)
			{
				var p_ssj = c_bf[n][8].split(",");
				var p_sj = new Date(p_ssj[0], parseFloat(p_ssj[1])-1, p_ssj[2], p_ssj[3], p_ssj[4], p_ssj[5]);
				if (isstart == 1)
				{
					bssj = parseInt((new Date - Date.parse(p_sj)) / 1000 /60 + Timegap)
					if (bssj < 0)
						bssj = 0;
					if (bssj > 45)
						bssj = 45;
				}
				else
				{
					bssj = parseInt((new Date - Date.parse(p_sj)) / 1000 /60 + Timegap) + 45;
					if (bssj < 46)
						bssj = 46;
					if (bssj > 90)
						bssj = 90;
				}
				bssj += "'";
			}
			var zf = (c_bf[n][4] > 0)?"<img src=http://img.7m.cn/s_img/" + c_bf[n][4] + ".gif> ":"";
			var kf = (c_bf[n][5] > 0)?"<img src=http://img.7m.cn/s_img/" + c_bf[n][5] + ".gif> ":"";
			var pm1 = (c_m[n][5] != '')?'<sup>[' + c_m[n][5] + ']</sup>':"";
			var pm2 = (c_m[n][6] != '')?'<sup>[' + c_m[n][6] + ']</sup>':"";
			var bf = (c_bf[n][0] == 17)?'<span id="la'+ n +'"></span>-<span id="lb'+ n +'"></span>':'<span id="la'+ n +'">'+ c_bf[n][1] + '</span>-<span id="lb'+ n +'">' + c_bf[n][2] + '</span>';
			var bc = c_bf[n][3];
			if(bc == '')
			{
				if(c_m[n][12] != '')
				{
					bc += '<img src="http://img.7m.cn/s_img/tv_4.gif" title="'+ c_m[n][12] +'"/>';
				}
				if (c_m[n][8] != '')
				{
					(c_m[n][7] != "") ? gwd = "<br>" + c_m[n][7] : gwd = "";
					if (c_m[n][7] == " / "){gwd="";}
					var getweath = GetWeather(parseInt(c_m[n][8]));
					if (getweath != "")
					{
						if (bc != "")
							bc += "&nbsp;";
						bc += "<img src='http://img.7m.cn/weather_img/" + c_m[n][8] + ".gif' title='" + getweath + gwd + "' />";
					}
				}
			}
			var zd = (c_m[n][10] > 0)?'<a href="http://67.215.229.69/chart.htm?ecd='+ ((m_index >2)?2:m_index) +'&id='+ c_m[n][10] +'" target="_blank"><img src=http://img.7m.cn/s_img/birs.gif title="'+ match_arr[11] +'"></a>':"";
			var pl = (c_m[n][9] > 0)?' <a href="http://discuss.7msport.com/'+ lan +'/index.shtml?no='+ n +'" target="_blank"><img src="http://img.7m.cn/s_img/people.gif" title="'+ match_arr[12] +'" ></a>':"";
			var zb = (c_m[n][11] > 0)?'<strong id="mc_'+ n +'"><br><a href="http://wlive.7m.cn/fl/?id='+ n +'&lang='+ lan +'" target="_blank"><img src="http://img.7m.cn/s_img/mc_'+ lan +'.gif" class="cimg"></a></strong>':"";
			var qc = '';
			if(c_m[n][13] != "")
			{
				var qc_index = get_qc_index(c_m[n][13]);
				qc = '<a href="/'+ lan +'/city/city_'+ ((qc_index == 0)?8:qc_index) +'.shtml" title="'+ qc_arr[qc_index] +'" target="_blank"><span class="qc"></span></a>'
			}
			var tm_host = '<a href="/'+ lan +'/t_index.php?id='+ c_m[n][2] +'" target="_blank" style="background:url(http://img.7m.cn/s_img/flag_s/'+ c_m[n][2] +'.gif) no-repeat right;">'+ c_m[n][0] +'</a>'; 
			if(c_m[n][2] > 1000)
			{
				tm_host = '<span>'+ c_m[n][0] +'</span>';
			}
			var tm_away = '<a href="/'+ lan +'/t_index.php?id='+ c_m[n][3] +'" target="_blank" style="background:url(http://img.7m.cn/s_img/flag_s/'+ c_m[n][3] +'.gif) no-repeat left;">'+ c_m[n][1] +'</a>';
			if(c_m[n][3] > 1000)
			{
				tm_away = '<span>'+ c_m[n][1] +'</span>';
			}
            html = '<tr id="bh'+ n +'"><td><a href="#" onclick="hiderow('+ n +');return false;"><img src="http://img.7m.cn/s_img/close.gif"></a></td>'+
			 		'<td>'+ c_m[n][4] +'</td>'+
					'<td class="dtime" id="sj'+ n +'">'+ time(c_bf[n][6],tzinfo,dstinfo) +'</td>'+
					'<td><span id="bssj'+ n +'" class="rfont">'+ bssj +'</span><span id="isstart'+ n +'">'+ start_arr[c_bf[n][0]] +'</span></td>'+
					'<td class="tr" id="t_at'+ n +'"><span id="ra'+ n +'">'+ zf + '</span>' +  pm1 + tm_host +'</td>'+
					'<td><a href="#" onclick="ShowDetails('+ n +');return false;"><span id="bf'+ n +'">'+ bf +'</span></a></td>'+
					'<td class="tl" id="t_bt'+ n +'">'+ tm_away + pm2 + '<span id="rb'+ n +'">'+ kf + '</span></td>'+
					'<td class="half" id="bc'+ n +'">'+ bc +'</td>'+
					'<td class="ctrl_b"><a href="/analyse/'+ lan +'.shtml?id='+ n +'" title="'+ match_arr[6] +'" target="_blank"><span class="analyse"></span></a> <a href="http://1x2.7m.hk/list_'+ lan +'.shtml?id='+ n +'" title="'+ match_arr[9] +'"  target="_blank"><span class="show1x2"></span></a> '+ qc + zd + pl + zb +'</td>';
					if(lan == "gb" || lan == "big")
					{
						if(c_bf[n][9] == 1)
						{
							html += '<td><span class="'+ ((speak_all == 1)?"sound onS":"sound noS") +'" title="'+ match_arr[10] +'" id="' + n + '" onclick="SelectVoi(this, ' + n + ')"></span></td>';
						}
						else
						{
							html += '<td>&nbsp;</td>';
						}
					}
			html += '</tr>';
			if(lan == "gb" || lan == "big")
			{
				voiArr[n] = null;
			}
			if(c_bf[n][7] != '' && ChangeRsmEncode(c_bf[n][7],n) != '')
			{
				html += '<tr class="gameover" id="resume_'+ n +'"><td colspan="10" id="resume_td'+ n +'">'+ ChangeRsmEncode(c_bf[n][7],n) +'</td></tr>';
			}
			else
			{
				html += '<tr style="display:none;" id="resume_'+ n +'"><td colspan="10" id="resume_td'+ n +'"></td></tr>';
			}
			if(c_bf[n][0] == 17 || (c_bf[n][0] >= 1 && c_bf[n][0] <= 3) || c_bf[n][0] == 8 || c_bf[n][0] == 11 || c_bf[n][0] == 5)
			{
				w_html[w_html.length] = html;
			}
			else
			{
				e_html[e_html.length] = html;
			}
        }
    }
	html = '';
	if(w_html.length > 0)
	{
		html += w_html.join('');
	}
	html += '<tr class="gameover" id="gameover" '+ ((e_html.length > 0)?'':'style="display:none;"') +'><td colspan="10">'+ str_end_data +'</td></tr>';
	if(e_html.length > 0)
	{
		html += e_html.join('');
	}
    document.getElementById("match_list").innerHTML = '<table cellspacing="0" cellpadding="0" border="1" class="mtbox" id="live_Table">' + html_title + html +'</table>';
	getcfed = false;
    setRefreshValue = false;
    reflag = 0;
    ProcessTime_Timer = setTimeout("ProcessTime()", 30000);
    oldxml = "";
    OpenXml_Timer = setTimeout("OpenXml()",bfRefreshTime);
	updateRowColor_Timer = setTimeout("parent.updateRowColor()", 500);
}
var Timegap = parseInt((serverdate - new Date()) / 1000 / 60);
function times(str)
{
    var times = str.split(","); 
    return times[0] + "/" + times[1] + "/" + times[2] + " " + times[3] + ":" + times[4] + ":" + times[5]; 
}
function match_info(num)
{
	selectTab(num);
	time_type = 0;
	gettimezone();
	ObjArr.length = 0;
	document.getElementById("daohang").innerHTML = s_name_arr[num];
    document.getElementById("TimeZone").innerHTML = 'GMT'+ tzinfo + ((dstinfo == 1)?"["+ strDst +"]":"");
	var m_html = "";
    if(typeof(live_arr[num]) != "undefined")
    {
        var gro = null;
        for(var n in live_arr[num])
        {
            if(groupss_arr[num][n] != gro)
            {
				var curr_class = 'g';
				if(curr_groups != '')
				{
					if(curr_groups.indexOf(groupss_arr[num][n]) > -1)
					{
						curr_class = "b";
					}
				}
				else
				{
					curr_class = (n == 0)?"b":"g";
				}
				if(groupss_arr[num][n] != '')
				{
                	m_html += '<tr><td colspan="10" class="groups_name">'+ (((lan == "th") || (lan == "en") || (lan == "vn"))?match_arr[0] + " ":"") + groupss_arr[num][n] + (((lan != "th") && (lan != "en") && (lan != "vn"))?match_arr[0]:"") +'</tr>';			
				}
				m_html += html_title;
                gro = groupss_arr[num][n];
            }
			var i = live_arr[num][n];
			if(typeof(c_bf[i]) == "undefined")
			{
				continue;
			}
			var isstart = c_bf[i][0];
			var bssj = '';
			if (isstart == 1 || isstart == 3)
			{
				var p_ssj = c_bf[i][8].split(",");
				var p_sj = new Date(p_ssj[0], parseFloat(p_ssj[1])-1, p_ssj[2], p_ssj[3], p_ssj[4], p_ssj[5]);
				if (isstart == 1)
				{
					bssj = parseInt((new Date - Date.parse(p_sj)) / 1000 /60 + Timegap)
					if (bssj < 0)
						bssj = 0;
					if (bssj > 45)
						bssj = 45;
				}
				else
				{
					bssj = parseInt((new Date - Date.parse(p_sj)) / 1000 /60 + Timegap) + 45;
					if (bssj < 46)
						bssj = 46;
					if (bssj > 90)
						bssj = 90;
				}
				bssj += "'";
			}
			var zf = (c_bf[i][4] > 0)?"<img src=http://img.7m.cn/s_img/" + c_bf[i][4] + ".gif> ":"";
			var kf = (c_bf[i][5] > 0)?"<img src=http://img.7m.cn/s_img/" + c_bf[i][5] + ".gif> ":"";
			var pm1 = (c_m[i][5] != '')?'<sup>[' + c_m[i][5] + ']</sup>':"";
			var pm2 = (c_m[i][6] != '')?'<sup>[' + c_m[i][6] + ']</sup>':"";
			var bf = (c_bf[i][0] == 17)?'<span id="la'+ i +'"></span>-<span id="lb'+ i +'"></span>':'<span id="la'+ i +'">'+ c_bf[i][1] + '</span>-<span id="lb'+ i +'">' + c_bf[i][2] + '</span>';
			var bc = c_bf[i][3];
			if(bc == '')
			{
				if(c_m[i][12] != '')
				{
					bc += '<img src="http://img.7m.cn/s_img/tv_4.gif" title="'+ c_m[i][12] +'"/>';
				}
				if (c_m[i][8] != '')
				{
					(c_m[i][7] != "") ? gwd = "<br>" + c_m[i][7] : gwd = "";
					if (c_m[i][7] == " / "){gwd="";}
					var getweath = GetWeather(parseInt(c_m[i][8]));
					if (getweath != "")
					{
						if (bc != "")
							bc += "&nbsp;";
							bc += "<img src='http://img.7m.cn/weather_img/" + c_m[i][8] + ".gif' title='" + getweath + gwd + "' />";
					}
				}
			}
			var zd = (c_m[i][10] > 0)?'<a href="http://67.215.229.69/chart.htm?ecd='+ ((m_index >2)?2:m_index) +'&id='+ c_m[i][10] +'" target="_blank"><img src=http://img.7m.cn/s_img/birs.gif title="'+ match_arr[11] +'"></a>':"";
			var pl = (c_m[i][9] > 0)?' <a href="http://discuss.7msport.com/'+ lan +'/index.shtml?no='+ i +'" target="_blank"><img src="http://img.7m.cn/s_img/people.gif" title="'+ match_arr[12] +'"></a>':"";
			var zb = (c_m[i][11] > 0)?'<strong id="mc_'+ i +'"><br><a href="http://wlive.7m.cn/fl/?id='+ n +'&lang='+ lan +'" target="_blank"><img src="http://img.7m.cn/s_img/mc_'+ lan +'.gif" class="cimg"></a></strong>':"";
			var qc = '';
			if(c_m[i][13] != "")
			{
				var qc_index = get_qc_index(c_m[i][13]);
				qc = '<a href="/'+ lan +'/city/city_'+ ((qc_index == 0)?8:qc_index) +'.shtml" title="'+ qc_arr[qc_index] +'" target="_blank"><span class="qc"></span></a>'
			}
           	m_html += '<tr id="bh'+ i +'"><td><a href="#" onclick="hiderow('+ i +');return false;"><img src="http://img.7m.cn/s_img/close.gif"></a></td>'+
			 		'<td>'+ c_m[i][4] +'</td>'+
					'<td class="dtime" id="sj'+ i +'">'+ time(c_bf[i][6],tzinfo,dstinfo) +'</td>'+
					'<td><span id="bssj'+ i +'" class="rfont">'+ bssj +'</span><span id="isstart'+ i +'">'+ start_arr[c_bf[i][0]] +'</span></td>'+
					'<td class="tr" id="t_at'+ i +'"><span id="ra'+ i +'">'+ zf + '</span>' +  pm1 +'<a href="/'+ lan +'/t_index.php?id='+ c_m[i][2] +'" target="_blank" style="background:url(http://img.7m.cn/s_img/flag_s/'+ c_m[i][2] +'.gif) no-repeat right;">'+ c_m[i][0] +'</a></td>'+
					'<td><a href="#" onclick="ShowDetails('+ i +');return false;"><span id="bf'+ i +'">'+ bf +'</span></a></td>'+
					'<td class="tl" id="t_bt'+ i +'"><a href="/'+ lan +'/t_index.php?id='+ c_m[i][3] +'" target="_blank" style="background:url(http://img.7m.cn/s_img/flag_s/'+ c_m[i][3] +'.gif) no-repeat left;">'+ c_m[i][1] +'</a>'+ pm2 + '<span id="rb'+ i +'">'+ kf + '</span></td>'+
					'<td class="half" id="bc'+ i +'">'+ bc +'</td>'+
					'<td class="ctrl_b"><a href="/analyse/'+ lan +'.shtml?id='+ i +'" title="'+ match_arr[6] +'" target="_blank"><span class="analyse"></span></a> <a href="http://1x2.7m.hk/list_'+ lan +'.shtml?id='+ i +'" title="'+ match_arr[9] +'"  target="_blank"><span class="show1x2"></span></a> '+ qc + zd + pl + zb +'</td>';
			if(lan == "gb" || lan == "big")
			{
				if(c_bf[i][9] == 1)
				{
					m_html +='<td><span class="'+ ((speak_all == 1)?"sound onS":"sound noS") +'" title="'+ match_arr[10] +'" id="' + i + '" onclick="SelectVoi(this, ' + i + ')"></span></td>';
				}
				else
				{
					m_html +='<td></td>';
				}
			}
			m_html +='</tr>';
			if(lan == "gb" || lan == "big")
			{
				voiArr[n] = null;
			}
			if(c_bf[i][7] != '' && ChangeRsmEncode(c_bf[i][7],i) != '')
			{
				m_html += '<tr id="resume_'+ i +'"><td colspan="10" id="resume_td'+ i +'">'+ ChangeRsmEncode(c_bf[i][7],i) +'</td></tr>';
			}
			else
			{
				m_html += '<tr style="display:none;" id="resume_'+ i +'"><td colspan="10" id="resume_td'+ i +'"></td></tr>';
			}
        }   
    }
    document.getElementById("match_list").innerHTML = '<table cellspacing="0" cellpadding="0" border="1" class="mtbox" id="live_Table">' + m_html;
	updateRowColor_Timer = setTimeout("parent.updateRowColor()", 500);
}

function time(strTime,tz,dst)
{
    var arrTime = strTime.split(',');
    if(tz != "+0800" || dst != 0)
    {
        var dt = new Date(arrTime[0] + '/' + arrTime[1] + '/' + arrTime[2] + ' ' + arrTime[3] + ':' + arrTime[4]);
        if(tz != "+0800")
        {
            dt.setHours(dt.getHours() - 8);
            var dbHour = parseFloat(tz.substring(0, 3));
            var dbMin = parseFloat(tz.substring(3, 5));
            if(tz < 0)
            {
                dt.setHours(dt.getHours() - dbHour);
                dt.setMinutes(dt.getMinutes() - dbMin);   
            }
            else
            {
                dt.setHours(dt.getHours() + dbHour);
                dt.setMinutes(dt.getMinutes() + dbMin);
            }
        }
        if(dst == 1)
        {
            dt.setHours(dt.getHours() + 1);
        }
        return timeFormatLan(dt.getFullYear(),timeformat(dt.getMonth() + 1),timeformat(dt.getDate()),timeformat(dt.getHours()),timeformat(dt.getMinutes()));
    }
	
    return timeFormatLan(arrTime[0],arrTime[1],arrTime[2],arrTime[3],arrTime[4]);   
}
function timeFormatLan(y,m,d,h,i)
{
	if(lan == 'en' || lan == 'vn' || lan == 'th')
	{
		return  h + ':' + i + '<br>' + d + '/' + m; 
	}
	return m + '-' + d + '<br>' + h + ':' + i; 
}
function timeformat(num)
{
    if(num < 10)
    {
        return "0" + num;
    }
    return num;
}
//function live_info()
//{
//	$.ajax({ 
//		url:"/bf.xml?"+ new Date, 
//		type: 'GET', 
//		dataType: 'xml', 
//		success: function(xml)
//		{ 
//			if($(xml).find("live").length > 0)
//			{
//			   $(xml).find("live").each(
//					function()
//					{ 
//						$("#bf_" + $(this).attr("id")).html('<b>' + $(this).attr("af") + ' - ' + $(this).attr("bf") + '</b>');
//					}
//				); 
//			}
//		} 
//	});
//}
function updateTimeZone(tz,dst)
{
	setCookie('7mWorldCupDST', dst);
	setCookie('7mWorldCupTZ', tz);
	loadmatch();
}

function loadData(num)
{
	selectOption(num);
	subMenu();
}
function get_qc_index(num)
{
	switch(num)
	{
		case '33':
	        return 1;
		case '38':
	       	return 2;
		case '34':
	        return 3;
		case '36':
			return 4;
		case '37':
			return 5;
		case '35':
	        return 6;
		case '39':
	       	return 7;
		case '31':
	        return 8;
		case '32':
			return 0;
		case '40':
			return 9;
	   default:
	       return;
	} 
}
function LoadJS(fileUrl,callback) 
{ 
    var oHead = document.getElementsByTagName('HEAD').item(0); 
    var oScript= document.createElement("script"); 
    oScript.type = "text/javascript"; 
    oScript.src=fileUrl ; 
	oHead.appendChild(oScript); 
	if(document.addEventListener)
	{
		oScript.onload = callback;   
	}
	else
	{
		oScript.onreadystatechange =function(){ LoadJsReady(oScript,callback);}; 
	}

}


function LoadJsReady(obj,callBack)
{
	if(obj.readyState=="loaded")
	{
		callBack();
	}
	
}
