﻿
String.prototype.Trim = function(){return   this.replace(/(^\s*)|(\s*$)/g,"");}   
String.prototype.Ltrim = function(){return   this.replace(/(^\s*)/g,   "");}   
String.prototype.Rtrim = function(){return   this.replace(/(\s*$)/g,   "");} 

var coldXml = "";
var REFTIME = 10000;
var SHOWTIME = 180000;
var clTimeout = new Array(new Array(), new Array(), new Array(), new Array(), new Array(), new Array(), new Array(), new Array(), 
						new Array(), new Array(), new Array(), new Array(), new Array(), new Array(), new Array(), new Array(), 
						new Array(), new Array(), new Array(), new Array(), new Array(), new Array(), new Array(), new Array(), 
						new Array(), new Array(), new Array(), new Array(), new Array(), new Array(), new Array(), new Array());
						
var xmlhttp=null;
var isIE=true;
var parser=null;
var oSerializer=null;
var list = new Array();
var rebuilder;
var soundflag=true;


function ShowSound(obj,lan)
{	
		if(soundflag)
		{
			soundflag=false;
			obj.src="http://img.7m.cn/img2/lb_a2.gif";
		}
		else
		{
			soundflag=true;
			obj.src="http://img.7m.cn/img2/lb_a1.gif";
		}
		if(lan=="big")
			obj.title= soundflag?"點擊:關閉提示音":"點擊:開啟提示音";
		else if(lan=="gb")
			obj.title= soundflag?"点击，关闭提示音":"点击，开启提示音";
		else if(lan=="en")
			obj.title= soundflag?"Sound Off":"Sound On";	
}


if(window.ActiveXObject)
{         
	xmlhttp= new ActiveXObject("MSXML2.XMLHTTP.3.0");
}
else
{
	xmlhttp= new XMLHttpRequest();

	parser = new DOMParser();
	oSerializer = new XMLSerializer();
	isIE=false;
	
	
	 XMLDocument.prototype.selectNodes = function(cXPathString, xNode) 
   { 
      if( !xNode ) { xNode = this; }  
      var oNSResolver = this.createNSResolver(this.documentElement) 
      var aItems = this.evaluate(cXPathString, xNode, oNSResolver,  
                   XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null) 
      var aResult = []; 
      for( var i = 0; i < aItems.snapshotLength; i++) 
      { 
         aResult[i] =  aItems.snapshotItem(i); 
      } 
      return aResult; 
   } 

   // prototying the Element 
   Element.prototype.selectNodes = function(cXPathString) 
   { 
      if(this.ownerDocument.selectNodes) 
      { 
         return this.ownerDocument.selectNodes(cXPathString, this); 
      } 
      else{throw "For XML Elements Only";} 
   } 

	
	XMLDocument.prototype.selectSingleNode = function(cXPathString, xNode) 
   { 
      if( !xNode ) { xNode = this; }  
      var xItems = this.selectNodes(cXPathString, xNode); 
      if( xItems.length > 0 ) 
      { 
         return xItems[0]; 
      } 
      else 
      { 
         return null; 
      } 
   } 
    
   // prototying the Element 
   Element.prototype.selectSingleNode = function(cXPathString) 
   {     
      if(this.ownerDocument.selectSingleNode) 
      { 
         return this.ownerDocument.selectSingleNode(cXPathString, this); 
      } 
      else{throw "For XML Elements Only";} 
   } 

	
	
	
}						

function openData(flag)
{ 
	if(typeof(rebuilder)!="undefined")
		clearTimeout(rebuilder);
	try
	{
			xmlhttp.open("get","/xml/" + xml + "?"+Date.parse(new Date()),true);
			xmlhttp.onreadystatechange=LoadData ;
			xmlhttp.send(null);
	}catch(e)
{}
	if(flag)
 rebuilder=setTimeout("openData",600000);
}

function openGlobalData()
{
	xmlhttp.open("get", "/xml/odds_config.xml?" + Date.parse(new Date()), true);
	xmlhttp.onreadystatechange=loadGlobalData;
	xmlhttp.send(null);
}


function s_time(sDate)
{
	return sDate.substr(9,5);
}

function playPkSound()
{
	
	if (soundflag)
		pk.innerHTML = "<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='/sound/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>";
}

function playPlSound()
{
	if (soundflag)
		pl.innerHTML = "<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='/sound/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>";
		
}

function set_attribute(eid, attribute, color)
{
	if (document.getElementById(eid) != null)
		eval("document.getElementById(\"" + eid + "\")." + attribute + "=\"" + color + "\"");
}

function OverUnderLine(ID)
{
	var vTmp='';
	var vTmp1='';
	var vTmp2='';
	id=eval(ID);
	if (id >= 0)
	{
		vTmp1 = '' + (Math.floor(id / 2) / 2);
		if ((id % 2) == 1)
		{
			vTmp2 = ' / ' + (Math.ceil(id / 2.0) / 2);
		}
		else
		{
			if ((Math.ceil(vTmp1)) == vTmp1) {
				vTmp2 = '.0';
			}
		}
	}
	vTmp = vTmp1 + vTmp2;
	return vTmp;
}


/***********************************************************************************************************************/

function ModifyWinOddsData()
{
	try
	{
		xmlhttp.open("Get","/xml/winodds.xml?"+ Date.parse(new Date()), true);
		xmlhttp.onreadystatechange =WinOddsChange;
		xmlhttp.send(null);
	}
	catch(e){}
	//
	setTimeout("ModifyWinOddsData()", REFTIME);
}


function WinOddsChange()
{
	if(xmlhttp.readyState !=4) return;
	
	var xmldoc=null;
	var xml;
	if(isIE)
	{
		xmldoc=xmlhttp.responseXML;
		xml=xmldoc.xml;
		if(xml==""||xml==coldXml) return;
	}
	else
	{
		
		xmldoc= parser.parseFromString(xmlhttp.responseText,"text/xml");
		if(xmldoc.documentElement.tagName=="parsererror") return;
		xml = oSerializer.serializeToString(xmldoc.documentElement);
		
		if(xml==coldXml) return;
	}
	var root = xmldoc.documentElement.getElementsByTagName("Fixture");
	var pksound = false;
	var plsound = false;
	
	for (var i=0;i<root.length;++i)
	{
		var id = root[i].getAttribute("id");
		var gg = root[i].getAttribute("gg");
		var g = root[i].getAttribute("g");
		var ho = root[i].getAttribute("ho");
		var ao = root[i].getAttribute("ao");
		var kg ,tg;
		if (document.getElementById("r" + id) != null)
		{
			if ( arr["g" + id] != g || arr["gg" + id] != gg)
			{
				

				if (gg <= 1)
				{
					kg = "";
					tg = "";
				}
				else
				{
					kg = (g == "H") ? odds_r : odds_sr;
					tg = (kg == odds_r) ? odds_sr : odds_r;
				}
				
				
				document.getElementById("kg" + id).innerHTML = '[' + kg + convertGive(gg, kg) + ']';
				document.getElementById("tg" + id).innerHTML = '[' + tg + convertGive(gg, tg) + ']';
				
				var color = "";
				
				
				if (arr["gg" + id] < gg)
					color = "#FF6600";
				else if (arr["gg" + id] > gg)
					color = "#99CC00";
					
				if (color != "")
				{
					document.getElementById("kg" + id).style.backgroundColor = color;
					document.getElementById("tg" + id).style.backgroundColor = color;
					clearTimeout(clTimeout[0][id]);
					clearTimeout(clTimeout[1][id]);
					clTimeout[0][id] = setTimeout("set_attribute('kg" + id + "', 'style.backgroundColor', '')", SHOWTIME);
					clTimeout[1][id] = setTimeout("set_attribute('tg" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				}
				
				arr["g" + id] = g;
				arr["g" + id] = gg;

				pksound = true;
			}
			if (document.getElementById("ho" + id).innerHTML != ho || document.getElementById("ao" + id).innerHTML != ao)
			{
				if (parseFloat(document.getElementById("ho" + id).innerHTML) < ho)
					document.getElementById("ho" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("ho" + id).innerHTML) > ho)
					document.getElementById("ho" + id).style.backgroundColor = "#99CC00";
				if (parseFloat(document.getElementById("ao" + id).innerHTML) < ao)
					document.getElementById("ao" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("ao" + id).innerHTML) > ao)
					document.getElementById("ao" + id).style.backgroundColor = "#99CC00";
				document.getElementById("ho" + id).innerHTML = ho;
				document.getElementById("ao" + id).innerHTML = ao;
				clTimeout[2][id] = setTimeout("set_attribute('ho" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[3][id] = setTimeout("set_attribute('ao" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				plsound = true;
			}
		}

		var strs = root[i].getAttribute("var")!=null?root[i].getAttribute("var").split(","):"";
		if(strs=="") continue;
		
		
		var row = parseInt(strs.length/5);
	
		
		for(var j=0;j<row;j++)
		{
				if (document.getElementById("r" + id + "_" + j) == null) continue;
			
				g = strs[0+(j*5)];
	    	gg = strs[1+(j*5)];
	    	if( arr["g" + id + "_" + j] != g || arr["gg" + id + "_" + j] != gg)
	    	{
	    		if (gg <= 1)
					{
						kg = "";
						tg = "";
					}
					else
					{
						kg = (g == "H") ? odds_r : odds_sr;
						tg = (kg == odds_r) ? odds_sr : odds_r;
					}
					document.getElementById("kg" + id + "_" + j).innerHTML = '[' + kg + convertGive(gg, kg) + ']';
					document.getElementById("tg" + id + "_" + j).innerHTML = '[' + tg + convertGive(gg, tg) + ']';
					
					var color = "";
	
					if (arr["gg" + id + "_" + j] < gg)
						color = "#FF6600";
					else if (arr["gg" + id + "_" + j] > gg)
						color = "#99CC00";
						
					if (color != "")
					{
						clearTimeout(clTimeout[0][id+"_" + j]);
						clearTimeout(clTimeout[1][id + "_" + j]);
						document.getElementById("kg" + id + "_" + j).style.backgroundColor = color;
						document.getElementById("tg" + id + "_" + j).style.backgroundColor = color;
						clTimeout[0][id + "_" + j] = setTimeout("set_attribute('kg" + id + "_" + j + "' , 'style.backgroundColor', '')", SHOWTIME);
						clTimeout[1][id + "_" + j] = setTimeout("set_attribute('tg" + id + "_" + j + "' , 'style.backgroundColor', '')", SHOWTIME);
					}
					
					arr["g" + id + "_" + j] = g;
					arr["g" + id + "_" + j] = gg;
					pksound = true;
	    		
	    	}
	  
	    	ho = strs[2+(j*5)];
	    	ao = strs[3+(j*5)];
	
	  
	  
	    	if (document.getElementById("ho" + id + "_" + j).innerHTML != ho || document.getElementById("ao" + id + "_" + j).innerHTML != ao)
				{
					
					if (parseFloat(document.getElementById("ho" + id +"_" + j).innerHTML) < ho)
						document.getElementById("ho" + id + "_" + j).style.backgroundColor = "#FF6600";
					else if (parseFloat(document.getElementById("ho" + id + "_" + j).innerHTML) > ho)
						document.getElementById("ho" + id +"_" + j).style.backgroundColor = "#99CC00";
					if (parseFloat(document.getElementById("ao" + id +"_" + j).innerHTML) < ao)
						document.getElementById("ao" + id +"_" + j).style.backgroundColor = "#FF6600";
					else if (parseFloat(document.getElementById("ao" + id + "_" + j).innerHTML) > ao)
						document.getElementById("ao" + id + "_" + j).style.backgroundColor = "#99CC00";
						
					document.getElementById("ho" + id + "_" + j).innerHTML = ho;
					document.getElementById("ao" + id + "_" + j).innerHTML = ao;
					clTimeout[2][id + "_" + j] = setTimeout("set_attribute('ho" + id + "_" + j + "' , 'style.backgroundColor', '')", SHOWTIME);
					clTimeout[3][id + "_" + j] = setTimeout("set_attribute('ao" + id + "_" + j  + "', 'style.backgroundColor', '')", SHOWTIME);
					plsound = true;
				}
		}

	}
	if (pksound)
		playPkSound();
	if (plsound)
		playPlSound();
	coldXml = xml;
}


/***********************************************************************************************************************/



function ModifyOverUnder()
{
	try
	{
		xmlhttp.open("Get","/xml/overunder.xml?"+ Date.parse(new Date()), true);
		xmlhttp.onreadystatechange =OverUnderChange;
		xmlhttp.send(null);
	}
	catch(e){}
	setTimeout("ModifyOverUnder()", REFTIME);
}

function OverUnderChange()
{
	if(xmlhttp.readyState !=4) return;
	
	var xmldoc=null;
	var xml;
	if(isIE)
	{
		xmldoc=xmlhttp.responseXML;
		xml=xmldoc.xml;
		if(xml==""||xml==coldXml) return;
	}
	else
	{
		
		xmldoc= parser.parseFromString(xmlhttp.responseText,"text/xml");
		if(xmldoc.documentElement.tagName=="parsererror") return;
		xml = oSerializer.serializeToString(xmldoc.documentElement);
		
		if(xml==coldXml) return;
	}
	var sound = false;
	var root = xmldoc.documentElement.getElementsByTagName("Fixture");
	for (var i=0;i<root.length;++i)
	{
		var id = root[i].getAttribute("id");
		var oo = root[i].getAttribute("oo");
		var uo = root[i].getAttribute("uo");
		if (document.getElementById("r" + id) != null)
		{
			if (document.getElementById("oo" + id).innerHTML != oo || document.getElementById("uo" + id).innerHTML != uo)
			{
				if (parseFloat(document.getElementById("oo" + id).innerHTML) < oo)
					document.getElementById("oo" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("oo" + id).innerHTML) > oo)
					document.getElementById("oo" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("uo" + id).innerHTML) < uo)
					document.getElementById("uo" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("uo" + id).innerHTML) > uo)
					document.getElementById("uo" + id).style.backgroundColor = "#99CC00";
				document.getElementById("oo" + id).innerHTML = oo;
				document.getElementById("uo" + id).innerHTML = uo;
				clearTimeout(clTimeout[0][id]);
				clearTimeout(clTimeout[1][id]);
				clTimeout[0][id] = setTimeout("set_attribute('oo" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[1][id] = setTimeout("set_attribute('uo" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				sound = true;
			}
		}
	}
	if (sound)
		playPlSound();
	coldXml = xml;
}
/***********************************************************************************************************************/
		
function ModifyHalfFull()
{
	try
	{
		xmlhttp.open("Get","/xml/halffull.xml?"+ Date.parse(new Date()), true);
		xmlhttp.onreadystatechange =HalfFullChange;
		xmlhttp.send(null);
	}
	catch(e){}
	setTimeout("ModifyHalfFull()", REFTIME);
}

function HalfFullChange()
{
	if(xmlhttp.readyState !=4) return;
	
	var xmldoc=null;
	var xml;
	if(isIE)
	{
		xmldoc=xmlhttp.responseXML;
		xml=xmldoc.xml;
		if(xml==""||xml==coldXml) return;
	}
	else
	{
		
		xmldoc= parser.parseFromString(xmlhttp.responseText,"text/xml");
		if(xmldoc.documentElement.tagName=="parsererror") return;
		xml = oSerializer.serializeToString(xmldoc.documentElement);
		
		if(xml==coldXml) return;
	}
	var sound = false;
	var root = xmldoc.documentElement.getElementsByTagName("Fixture");
	for (var i=0;i<root.length;++i)
	{
		var id = root[i].getAttribute("id");
		var hh = root[i].getAttribute("hh");
		var hd = root[i].getAttribute("hd");
		var ha = root[i].getAttribute("ha");
		var dh = root[i].getAttribute("dh");
		var dd = root[i].getAttribute("dd");
		var da = root[i].getAttribute("da");
		var ah = root[i].getAttribute("ah");
		var ad = root[i].getAttribute("ad");
		var aa = root[i].getAttribute("aa");
		if (document.getElementById("r" + id) != null)
		{
			if (document.getElementById("hh" + id).innerHTML != hh || document.getElementById("hd" + id).innerHTML != hd ||
				document.getElementById("ha" + id).innerHTML != ha || document.getElementById("dh" + id).innerHTML != dh ||
				document.getElementById("dd" + id).innerHTML != dd || document.getElementById("da" + id).innerHTML != da ||
				document.getElementById("ah" + id).innerHTML != ah || document.getElementById("ad" + id).innerHTML != ad ||
				document.getElementById("aa" + id).innerHTML != aa)
			{
				if (parseFloat(document.getElementById("hh" + id).innerHTML) < hh)
					document.getElementById("hh" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("hh" + id).innerHTML) > hh)
					document.getElementById("hh" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("hd" + id).innerHTML) < hd)
					document.getElementById("hd" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("hd" + id).innerHTML) > hd)
					document.getElementById("hd" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("ha" + id).innerHTML) < ha)
					document.getElementById("ha" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("ha" + id).innerHTML) > ha)
					document.getElementById("ha" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("dh" + id).innerHTML) < dh)
					document.getElementById("dh" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("dh" + id).innerHTML) > dh)
					document.getElementById("dh" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("dd" + id).innerHTML) < dd)
					document.getElementById("dd" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("dd" + id).innerHTML) > dd)
					document.getElementById("dd" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("da" + id).innerHTML) < da)
					document.getElementById("da" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("da" + id).innerHTML) > da)
					document.getElementById("da" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("ah" + id).innerHTML) < ah)
					document.getElementById("ah" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("ah" + id).innerHTML) > ah)
					document.getElementById("ah" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("ad" + id).innerHTML) < ad)
					document.getElementById("ad" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("ad" + id).innerHTML) > ad)
					document.getElementById("ad" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("aa" + id).innerHTML) < aa)
					document.getElementById("aa" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("aa" + id).innerHTML) > aa)
					document.getElementById("aa" + id).style.backgroundColor = "#99CC00";
					
				document.getElementById("hh" + id).innerHTML = hh;
				document.getElementById("hd" + id).innerHTML = hd;
				document.getElementById("ha" + id).innerHTML = ha;
				document.getElementById("dh" + id).innerHTML = dh;
				document.getElementById("dd" + id).innerHTML = dd;
				document.getElementById("da" + id).innerHTML = da;
				document.getElementById("ah" + id).innerHTML = ah;
				document.getElementById("ad" + id).innerHTML = ad;
				document.getElementById("aa" + id).innerHTML = aa;

				clearTimeout(clTimeout[0][id]);
				clearTimeout(clTimeout[1][id]);
				clearTimeout(clTimeout[2][id]);
				clearTimeout(clTimeout[3][id]);
				clearTimeout(clTimeout[4][id]);
				clearTimeout(clTimeout[5][id]);
				clearTimeout(clTimeout[6][id]);
				clearTimeout(clTimeout[7][id]);
				clearTimeout(clTimeout[8][id]);
				
				clTimeout[0][id] = setTimeout("set_attribute('hh" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[1][id] = setTimeout("set_attribute('hd" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[2][id] = setTimeout("set_attribute('ha" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[3][id] = setTimeout("set_attribute('dh" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[4][id] = setTimeout("set_attribute('dd" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[5][id] = setTimeout("set_attribute('da" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[6][id] = setTimeout("set_attribute('ah" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[7][id] = setTimeout("set_attribute('ad" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[8][id] = setTimeout("set_attribute('aa" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				sound = true;
			}
		}
	}
	if (sound)
		playPlSound();
	coldXml = xml;
}
/***********************************************************************************************************************/

function ModifyWinDrawWin(fn)
{
	try
	{
		xmlhttp.open("Get","/xml/" + fn +"?"+ Date.parse(new Date()), true);
		xmlhttp.onreadystatechange =WinDrawWinChange;
		xmlhttp.send(null);
	}
	catch(e){}
	setTimeout("ModifyWinDrawWin('" + fn + "')", REFTIME);
}

function WinDrawWinChange()
{
	if(xmlhttp.readyState !=4) return;
	
	var xmldoc=null;
	var xml;
	if(isIE)
	{
		xmldoc=xmlhttp.responseXML;
		xml=xmldoc.xml;
		if(xml==""||xml==coldXml) return;
	}
	else
	{
		
		xmldoc= parser.parseFromString(xmlhttp.responseText,"text/xml");
		if(xmldoc.documentElement.tagName=="parsererror") return;
		xml = oSerializer.serializeToString(xmldoc.documentElement);
		
		if(xml==coldXml) return;
	}
	var sound = false;
	var root = xmldoc.documentElement.getElementsByTagName("Fixture");
	for (var i=0;i<root.length;++i)
	{
		var id = root[i].getAttribute("id");
		var ho = root[i].getAttribute("ho");
		var _do = root[i].getAttribute("do");
		var ao = root[i].getAttribute("ao");
		if (document.getElementById("r" + id) != null)
		{
			if (document.getElementById("ho" + id).innerHTML != ho || document.getElementById("do" + id).innerHTML != _do || document.getElementById("ao" + id).innerHTML != ao)
			{
				if (parseFloat(document.getElementById("ho" + id).innerHTML) < ho)
					document.getElementById("ho" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("ho" + id).innerHTML) > ho)
					document.getElementById("ho" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("do" + id).innerHTML) < _do)
					document.getElementById("do" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("do" + id).innerHTML) > _do)
					document.getElementById("do" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("ao" + id).innerHTML) < ao)
					document.getElementById("ao" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("ao" + id).innerHTML) > ao)
					document.getElementById("ao" + id).style.backgroundColor = "#99CC00";
				document.getElementById("ho" + id).innerHTML = ho;
				document.getElementById("do" + id).innerHTML = _do;
				document.getElementById("ao" + id).innerHTML = ao;
				clearTimeout(clTimeout[0][id]);
				clearTimeout(clTimeout[1][id]);
				clearTimeout(clTimeout[2][id]);
				clTimeout[0][id] = setTimeout("set_attribute('ho" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[1][id] = setTimeout("set_attribute('do" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[2][id] = setTimeout("set_attribute('ao" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				sound = true;
			}
		}
	}
	if (sound)
		playPlSound();
	coldXml = xml;
}
/***********************************************************************************************************************/
		
function ModifyCorrectScore()
{
	try
	{
		xmlhttp.open("Get","/xml/correctscore.xml?"+ Date.parse(new Date()), true);
		xmlhttp.onreadystatechange =CorrectScoreChange;
		xmlhttp.send(null);
	}
	catch(e){}
	setTimeout("ModifyCorrectScore()", REFTIME);
}

function CorrectScoreChange()
{
	if(xmlhttp.readyState !=4) return;
	
	var xmldoc=null;
	var xml;
	if(isIE)
	{
		xmldoc=xmlhttp.responseXML;
		xml=xmldoc.xml;
		if(xml==""||xml==coldXml) return;
	}
	else
	{
		
		xmldoc= parser.parseFromString(xmlhttp.responseText,"text/xml");
		if(xmldoc.documentElement.tagName=="parsererror") return;
		xml = oSerializer.serializeToString(xmldoc.documentElement);
		
		if(xml==coldXml) return;
	}
	var sound = false;
	var root = xmldoc.documentElement.getElementsByTagName("Fixture");
	for (var i=0;i<root.length;++i)
	{
		var id = root[i].getAttribute("id");
		var h1 = root[i].getAttribute("h1");
		var h2 = root[i].getAttribute("h2");
		var h3 = root[i].getAttribute("h3");
		var h4 = root[i].getAttribute("h4");
		var h5 = root[i].getAttribute("h5");
		var h6 = root[i].getAttribute("h6");
		var h7 = root[i].getAttribute("h7");
		var h8 = root[i].getAttribute("h8");
		var h9 = root[i].getAttribute("h9");
		var h10 = root[i].getAttribute("h10");
		var a1 = root[i].getAttribute("a1");
		var a2 = root[i].getAttribute("a2");
		var a3 = root[i].getAttribute("a3");
		var a4 = root[i].getAttribute("a4");
		var a5 = root[i].getAttribute("a5");
		var a6 = root[i].getAttribute("a6");
		var a7 = root[i].getAttribute("a7");
		var a8 = root[i].getAttribute("a8");
		var a9 = root[i].getAttribute("a9");
		var a10 = root[i].getAttribute("a10");
		var o11 = root[i].getAttribute("o11");
		var o12 = root[i].getAttribute("o12");
		var o13 = root[i].getAttribute("o13");
		var o14 = root[i].getAttribute("o14");
		var o15 = root[i].getAttribute("o15");
		var o16 = root[i].getAttribute("o16");

		if (document.getElementById("r" + id) != null)
		{
			if (document.getElementById("h1" + id).innerHTML != h1 || document.getElementById("h2" + id).innerHTML != h2 ||
				document.getElementById("h3" + id).innerHTML != h3 || document.getElementById("h4" + id).innerHTML != h4 ||
				document.getElementById("h5" + id).innerHTML != h5 || document.getElementById("h6" + id).innerHTML != h6 ||
				document.getElementById("h7" + id).innerHTML != h7 || document.getElementById("h8" + id).innerHTML != h8 ||
				document.getElementById("h9" + id).innerHTML != h9 || document.getElementById("h10" + id).innerHTML != h10 ||
				document.getElementById("a1" + id).innerHTML != a1 || document.getElementById("a2" + id).innerHTML != a2 ||
				document.getElementById("a3" + id).innerHTML != a3 || document.getElementById("a4" + id).innerHTML != a4 ||
				document.getElementById("a5" + id).innerHTML != a5 || document.getElementById("a6" + id).innerHTML != a6 ||
				document.getElementById("a7" + id).innerHTML != a7 || document.getElementById("a8" + id).innerHTML != a8 ||
				document.getElementById("a9" + id).innerHTML != a9 || document.getElementById("a10" + id).innerHTML != a10 ||
				document.getElementById("o11" + id).innerHTML != o11 || document.getElementById("o12" + id).innerHTML != o12 ||
				document.getElementById("o13" + id).innerHTML != o13 || document.getElementById("o14" + id).innerHTML != o14 ||
				document.getElementById("o15" + id).innerHTML != o15 || document.getElementById("o16" + id).innerHTML != o16)
			{
				if (parseFloat(document.getElementById("h1" + id).innerHTML) < h1)
					document.getElementById("h1" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h1" + id).innerHTML) > h1)
					document.getElementById("h1" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("h2" + id).innerHTML) < h2)
					document.getElementById("h2" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h2" + id).innerHTML) > h2)
					document.getElementById("h2" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("h3" + id).innerHTML) < h3)
					document.getElementById("h3" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h3" + id).innerHTML) > h3)
					document.getElementById("h3" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("h4" + id).innerHTML) < h4)
					document.getElementById("h4" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h4" + id).innerHTML) > h4)
					document.getElementById("h4" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("h5" + id).innerHTML) < h5)
					document.getElementById("h5" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h5" + id).innerHTML) > h5)
					document.getElementById("h5" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("h6" + id).innerHTML) < h6)
					document.getElementById("h6" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h6" + id).innerHTML) > h6)
					document.getElementById("h6" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("h7" + id).innerHTML) < h7)
					document.getElementById("h7" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h7" + id).innerHTML) > h7)
					document.getElementById("h7" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("h8" + id).innerHTML) < h8)
					document.getElementById("h8" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h8" + id).innerHTML) > h8)
					document.getElementById("h8" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("h9" + id).innerHTML) < h9)
					document.getElementById("h9" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h9" + id).innerHTML) > h9)
					document.getElementById("h9" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("h10" + id).innerHTML) < h10)
					document.getElementById("h10" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h10" + id).innerHTML) > h10)
					document.getElementById("h10" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("a1" + id).innerHTML) < a1)
					document.getElementById("a1" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a1" + id).innerHTML) > a1)
					document.getElementById("a1" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("a2" + id).innerHTML) < a2)
					document.getElementById("a2" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a2" + id).innerHTML) > a2)
					document.getElementById("a2" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("a3" + id).innerHTML) < a3)
					document.getElementById("a3" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a3" + id).innerHTML) > a3)
					document.getElementById("a3" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("a4" + id).innerHTML) < a4)
					document.getElementById("a4" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a4" + id).innerHTML) > a4)
					document.getElementById("a4" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("a5" + id).innerHTML) < a5)
					document.getElementById("a5" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a5" + id).innerHTML) > a5)
					document.getElementById("a5" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("a6" + id).innerHTML) < a6)
					document.getElementById("a6" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a6" + id).innerHTML) > a6)
					document.getElementById("a6" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("a7" + id).innerHTML) < a7)
					document.getElementById("a7" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a7" + id).innerHTML) > a7)
					document.getElementById("a7" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("a8" + id).innerHTML) < a8)
					document.getElementById("a8" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a8" + id).innerHTML) > a8)
					document.getElementById("a8" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("a9" + id).innerHTML) < a9)
					document.getElementById("a9" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a9" + id).innerHTML) > a9)
					document.getElementById("a9" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("a10" + id).innerHTML) < a10)
					document.getElementById("a10" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a10" + id).innerHTML) > a10)
					document.getElementById("a10" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("o11" + id).innerHTML) < o11)
					document.getElementById("o11" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o11" + id).innerHTML) > o11)
					document.getElementById("o11" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("o12" + id).innerHTML) < o12)
					document.getElementById("o12" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o12" + id).innerHTML) > o12)
					document.getElementById("o12" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("o13" + id).innerHTML) < o13)
					document.getElementById("o13" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o13" + id).innerHTML) > o13)
					document.getElementById("o13" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("o14" + id).innerHTML) < o14)
					document.getElementById("o14" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o14" + id).innerHTML) > o14)
					document.getElementById("o14" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("o15" + id).innerHTML) < o15)
					document.getElementById("o15" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o15" + id).innerHTML) > o15)
					document.getElementById("o15" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("o16" + id).innerHTML) < o16)
					document.getElementById("o16" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o16" + id).innerHTML) > o16)
					document.getElementById("o16" + id).style.backgroundColor = "#99CC00";
					
				document.getElementById("h1" + id).innerHTML = h1;
				document.getElementById("h2" + id).innerHTML = h2;
				document.getElementById("h3" + id).innerHTML = h3;
				document.getElementById("h4" + id).innerHTML = h4;
				document.getElementById("h5" + id).innerHTML = h5;
				document.getElementById("h6" + id).innerHTML = h6;
				document.getElementById("h7" + id).innerHTML = h7;
				document.getElementById("h8" + id).innerHTML = h8;
				document.getElementById("h9" + id).innerHTML = h9;
				document.getElementById("h10" + id).innerHTML = h10;
				
				document.getElementById("a1" + id).innerHTML = a1;
				document.getElementById("a2" + id).innerHTML = a2;
				document.getElementById("a3" + id).innerHTML = a3;
				document.getElementById("a4" + id).innerHTML = a4;
				document.getElementById("a5" + id).innerHTML = a5;
				document.getElementById("a6" + id).innerHTML = a6;
				document.getElementById("a7" + id).innerHTML = a7;
				document.getElementById("a8" + id).innerHTML = a8;
				document.getElementById("a9" + id).innerHTML = a9;
				document.getElementById("a10" + id).innerHTML = a10;
				
				document.getElementById("o11" + id).innerHTML = o11;
				document.getElementById("o12" + id).innerHTML = o12;
				document.getElementById("o13" + id).innerHTML = o13;
				document.getElementById("o14" + id).innerHTML = o14;
				document.getElementById("o15" + id).innerHTML = o15;
				document.getElementById("o16" + id).innerHTML = o16;

				clearTimeout(clTimeout[0][id]);
				clearTimeout(clTimeout[1][id]);
				clearTimeout(clTimeout[2][id]);
				clearTimeout(clTimeout[3][id]);
				clearTimeout(clTimeout[4][id]);
				clearTimeout(clTimeout[5][id]);
				clearTimeout(clTimeout[6][id]);
				clearTimeout(clTimeout[7][id]);
				clearTimeout(clTimeout[8][id]);
				clearTimeout(clTimeout[9][id]);
				
				clearTimeout(clTimeout[10][id]);
				clearTimeout(clTimeout[11][id]);
				clearTimeout(clTimeout[12][id]);
				clearTimeout(clTimeout[13][id]);
				clearTimeout(clTimeout[14][id]);
				clearTimeout(clTimeout[15][id]);
				clearTimeout(clTimeout[16][id]);
				clearTimeout(clTimeout[17][id]);
				clearTimeout(clTimeout[18][id]);
				clearTimeout(clTimeout[19][id]);
				
				clearTimeout(clTimeout[20][id]);
				clearTimeout(clTimeout[21][id]);
				clearTimeout(clTimeout[22][id]);
				clearTimeout(clTimeout[23][id]);
				clearTimeout(clTimeout[24][id]);
				clearTimeout(clTimeout[25][id]);
				
				clTimeout[0][id] = setTimeout("set_attribute('h1" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[1][id] = setTimeout("set_attribute('h2" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[2][id] = setTimeout("set_attribute('h3" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[3][id] = setTimeout("set_attribute('h4" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[4][id] = setTimeout("set_attribute('h5" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[5][id] = setTimeout("set_attribute('h6" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[6][id] = setTimeout("set_attribute('h7" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[7][id] = setTimeout("set_attribute('h8" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[8][id] = setTimeout("set_attribute('h9" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[9][id] = setTimeout("set_attribute('h10" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				
				clTimeout[10][id] = setTimeout("set_attribute('a1" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[11][id] = setTimeout("set_attribute('a2" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[12][id] = setTimeout("set_attribute('a3" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[13][id] = setTimeout("set_attribute('a4" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[14][id] = setTimeout("set_attribute('a5" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[15][id] = setTimeout("set_attribute('a6" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[16][id] = setTimeout("set_attribute('a7" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[17][id] = setTimeout("set_attribute('a8" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[18][id] = setTimeout("set_attribute('a9" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[19][id] = setTimeout("set_attribute('a10" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				
				clTimeout[20][id] = setTimeout("set_attribute('o11" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[21][id] = setTimeout("set_attribute('o12" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[22][id] = setTimeout("set_attribute('o13" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[23][id] = setTimeout("set_attribute('o14" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[24][id] = setTimeout("set_attribute('o15" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[25][id] = setTimeout("set_attribute('o16" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				sound = true;
			}
		}
	}
	if (sound)
		playPlSound();
	coldXml = xml;
}
/***********************************************************************************************************************/

function ModifyCorrectScoreSpecial()
{
	try
	{
		xmlhttp.open("Get","/xml/correctscorespecial.xml?"+ Date.parse(new Date()), true);
		xmlhttp.onreadystatechange =CorrectScoreSpecialChange;
		xmlhttp.send(null);
	}
	catch(e){}
	setTimeout("ModifyCorrectScoreSpecial()", REFTIME);
}

function CorrectScoreSpecialChange()
{
	if(xmlhttp.readyState !=4) return;
	var xmldoc=null;
	var xml;
	if(isIE)
	{
		xmldoc=xmlhttp.responseXML;
		xml=xmldoc.xml;
		if(xml==""||xml==coldXml) return;
	}
	else
	{
		
		xmldoc= parser.parseFromString(xmlhttp.responseText,"text/xml");
		if(xmldoc.documentElement.tagName=="parsererror") return;
		xml = oSerializer.serializeToString(xmldoc.documentElement);
		
		if(xml==coldXml) return;
	}
	var sound = false;
	var root = xmldoc.documentElement.getElementsByTagName("Fixture");
	for (var i=0;i<root.length;i+=6)
	{
		var id = root[i].getAttribute("id");
		var o1 = root[i].getAttribute("o");
		var o2 = root[i+1].getAttribute("o");
		var o3 = root[i+2].getAttribute("o");
		var o4 = root[i+3].getAttribute("o");
		var o5 = root[i+4].getAttribute("o");
		var o6 = root[i+5].getAttribute("o");
		if (document.getElementById("r" + id) != null)
		{
			if (document.getElementById("o1" + id).innerHTML != o1 || document.getElementById("o2" + id).innerHTML != o2 || 
				document.getElementById("o3" + id).innerHTML != o3 || document.getElementById("o4" + id).innerHTML != o4 || 
				document.getElementById("o5" + id).innerHTML != o5 || document.getElementById("o6" + id).innerHTML != o6)
			{
				if (parseFloat(document.getElementById("o1" + id).innerHTML) < o1)
					document.getElementById("o1" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o1" + id).innerHTML) > o1)
					document.getElementById("o1" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("o2" + id).innerHTML) < o2)
					document.getElementById("o2" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o2" + id).innerHTML) > o2)
					document.getElementById("o2" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("o3" + id).innerHTML) < o3)
					document.getElementById("o3" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o3" + id).innerHTML) > o3)
					document.getElementById("o3" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("o4" + id).innerHTML) < o4)
					document.getElementById("o4" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o4" + id).innerHTML) > o4)
					document.getElementById("o4" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("o5" + id).innerHTML) < o5)
					document.getElementById("o5" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o5" + id).innerHTML) > o5)
					document.getElementById("o5" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("o6" + id).innerHTML) < o6)
					document.getElementById("o6" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o6" + id).innerHTML) > o6)
					document.getElementById("o6" + id).style.backgroundColor = "#99CC00";
					
				document.getElementById("o1" + id).innerHTML = o1;
				document.getElementById("o2" + id).innerHTML = o2;
				document.getElementById("o3" + id).innerHTML = o3;
				document.getElementById("o4" + id).innerHTML = o4;
				document.getElementById("o5" + id).innerHTML = o5;
				document.getElementById("o6" + id).innerHTML = o6;
				
				clearTimeout(clTimeout[0][id]);
				clearTimeout(clTimeout[1][id]);
				clearTimeout(clTimeout[2][id]);
				clearTimeout(clTimeout[3][id]);
				clearTimeout(clTimeout[4][id]);
				clearTimeout(clTimeout[5][id]);
				clTimeout[0][id] = setTimeout("set_attribute('o1" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[1][id] = setTimeout("set_attribute('o2" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[2][id] = setTimeout("set_attribute('o3" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[3][id] = setTimeout("set_attribute('o4" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[4][id] = setTimeout("set_attribute('o5" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[5][id] = setTimeout("set_attribute('o6" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				sound = true;
			}
		}
	}
	if (sound)
		playPlSound();
	coldXml = xml;
}
/***********************************************************************************************************************/

function ModifyTotalgoals()
{
	try
	{
		xmlhttp.open("Get","/xml/totalgoals.xml?"+ Date.parse(new Date()), true);
		xmlhttp.onreadystatechange =TotalgoalsChange;
		xmlhttp.send(null);
	}
	catch(e){}
	setTimeout("ModifyTotalgoals()", REFTIME);
}

function TotalgoalsChange()
{
	if(xmlhttp.readyState !=4) return;
	var xmldoc=null;
	var xml;
	if(isIE)
	{
		xmldoc=xmlhttp.responseXML;
		xml=xmldoc.xml;
		if(xml==""||xml==coldXml) return;
	}
	else
	{
		
		xmldoc= parser.parseFromString(xmlhttp.responseText,"text/xml");
		if(xmldoc.documentElement.tagName=="parsererror") return;
		xml = oSerializer.serializeToString(xmldoc.documentElement);
		
		if(xml==coldXml) return;
	}
	var sound = false;
	var root = xmldoc.documentElement.getElementsByTagName("Fixture");
	for (var i=0;i<root.length;++i)
	{
		var id = root[i].getAttribute("id");
		var o0 = root[i].getAttribute("o0");
		var o2 = root[i].getAttribute("o2");
		var o4 = root[i].getAttribute("o4");
		var o7 = root[i].getAttribute("o7");
		if (document.getElementById("r" + id) != null)
		{
			if (document.getElementById("o0" + id).innerHTML != o0 || document.getElementById("o2" + id).innerHTML != o2 || 
				document.getElementById("o4" + id).innerHTML != o4 || document.getElementById("o7" + id).innerHTML != o7)
			{
				if (parseFloat(document.getElementById("o0" + id).innerHTML) < o0)
					document.getElementById("o0" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o0" + id).innerHTML) > o0)
					document.getElementById("o0" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("o2" + id).innerHTML) < o2)
					document.getElementById("o2" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o2" + id).innerHTML) > o2)
					document.getElementById("o2" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("o4" + id).innerHTML) < o4)
					document.getElementById("o4" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o4" + id).innerHTML) > o4)
					document.getElementById("o4" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("o7" + id).innerHTML) < o7)
					document.getElementById("o7" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o7" + id).innerHTML) > o7)
					document.getElementById("o7" + id).style.backgroundColor = "#99CC00";
					
				document.getElementById("o0" + id).innerHTML = o0;
				document.getElementById("o2" + id).innerHTML = o2;
				document.getElementById("o4" + id).innerHTML = o4;
				document.getElementById("o7" + id).innerHTML = o7;
				
				clearTimeout(clTimeout[0][id]);
				clearTimeout(clTimeout[1][id]);
				clearTimeout(clTimeout[2][id]);
				clearTimeout(clTimeout[3][id]);

				clTimeout[0][id] = setTimeout("set_attribute('o0" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[1][id] = setTimeout("set_attribute('o2" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[2][id] = setTimeout("set_attribute('o4" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[3][id] = setTimeout("set_attribute('o7" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				sound = true;
			}
		}
	}
	if (sound)
		playPlSound();
	coldXml = xml;
}
/***********************************************************************************************************************/

function ModifyOddEven()
{
	try
	{
		xmlhttp.open("Get","/xml/oddeven.xml?"+ Date.parse(new Date()), true);
		xmlhttp.onreadystatechange =OddEvenChange;
		xmlhttp.send(null);
	}
	catch(e){}
	setTimeout("ModifyOddEven()", REFTIME);
}

function OddEvenChange()
{
	if(xmlhttp.readyState !=4) return;
	var xmldoc=null;
	var xml;
	if(isIE)
	{
		xmldoc=xmlhttp.responseXML;
		xml=xmldoc.xml;
		if(xml==""||xml==coldXml) return;
	}
	else
	{
		
		xmldoc= parser.parseFromString(xmlhttp.responseText,"text/xml");
		if(xmldoc.documentElement.tagName=="parsererror") return;
		xml = oSerializer.serializeToString(xmldoc.documentElement);
		
		if(xml==coldXml) return;
	}
	var sound = false;
	var root = xmldoc.documentElement.getElementsByTagName("Fixture");
	for (var i=0;i<root.length;++i)
	{
		var id = root[i].getAttribute("id");
		var oo = root[i].getAttribute("oo");
		var eo = root[i].getAttribute("eo");
		if (document.getElementById("r" + id) != null)
		{
			if (document.getElementById("oo" + id).innerHTML != oo || document.getElementById("eo" + id).innerHTML != eo)
			{
				if (parseFloat(document.getElementById("oo" + id).innerHTML) < oo)
					document.getElementById("oo" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("oo" + id).innerHTML) > oo)
					document.getElementById("oo" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("eo" + id).innerHTML) < eo)
					document.getElementById("eo" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("eo" + id).innerHTML) > eo)
					document.getElementById("eo" + id).style.backgroundColor = "#99CC00";
				
				document.getElementById("oo" + id).innerHTML = oo;
				document.getElementById("eo" + id).innerHTML = eo;
				
				clearTimeout(clTimeout[0][id]);
				clearTimeout(clTimeout[1][id]);

				clTimeout[0][id] = setTimeout("set_attribute('oo" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[1][id] = setTimeout("set_attribute('eo" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				sound = true;
			}
		}
	}
	if (sound)
		playPlSound();
	coldXml = xml;
}
/***********************************************************************************************************************/

function ModifyNumberofgoals()
{
	
	try
	{
		xmlhttp.open("Get","/xml/numberofgoals.xml?"+ Date.parse(new Date()), true);
		xmlhttp.onreadystatechange =NumberofgoalsChange;
		xmlhttp.send(null);
	}
	catch(e){}
	setTimeout("ModifyNumberofgoals()", REFTIME);
}

function NumberofgoalsChange()
{
	if(xmlhttp.readyState !=4) return;
	var xmldoc=null;
	var xml;
	if(isIE)
	{
		xmldoc=xmlhttp.responseXML;
		xml=xmldoc.xml;
		if(xml==""||xml==coldXml) return;
	}
	else
	{
		
		xmldoc= parser.parseFromString(xmlhttp.responseText,"text/xml");
		if(xmldoc.documentElement.tagName=="parsererror") return;
		xml = oSerializer.serializeToString(xmldoc.documentElement);
		
		if(xml==coldXml) return;
	}
	var sound = false;
	var root = xmldoc.documentElement.getElementsByTagName("Fixture");
	for (var i=0;i<root.length;++i)
	{
		var id = root[i].getAttribute("id");
		var h1 = root[i].getAttribute("h1");
		var h2 = root[i].getAttribute("h2");
		var h3 = root[i].getAttribute("h3");
		var h4 = root[i].getAttribute("h4");
		var h5 = root[i].getAttribute("h5");
		var h6 = root[i].getAttribute("h6");
		var a1 = root[i].getAttribute("a1");
		var a2 = root[i].getAttribute("a2");
		var a3 = root[i].getAttribute("a3");
		var a4 = root[i].getAttribute("a4");
		var a5 = root[i].getAttribute("a5");
		var a6 = root[i].getAttribute("a6");
		if (document.getElementById("r" + id) != null)
		{
			if (document.getElementById("h1" + id).innerHTML != h1 || document.getElementById("h2" + id).innerHTML != h2 ||
				document.getElementById("h3" + id).innerHTML != h3 || document.getElementById("h4" + id).innerHTML != h4 ||
				document.getElementById("h5" + id).innerHTML != h5 || document.getElementById("h6" + id).innerHTML != h6 ||
				document.getElementById("a1" + id).innerHTML != a1 || document.getElementById("a2" + id).innerHTML != a2 ||
				document.getElementById("a3" + id).innerHTML != a3 || document.getElementById("a4" + id).innerHTML != a4 ||
				document.getElementById("a5" + id).innerHTML != a5 || document.getElementById("a6" + id).innerHTML != a6)
			{
				if (parseFloat(document.getElementById("h1" + id).innerHTML) < h1)
					document.getElementById("h1" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h1" + id).innerHTML) > h1)
					document.getElementById("h1" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("h2" + id).innerHTML) < h2)
					document.getElementById("h2" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h2" + id).innerHTML) > h2)
					document.getElementById("h2" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("h3" + id).innerHTML) < h3)
					document.getElementById("h3" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h3" + id).innerHTML) > h3)
					document.getElementById("h3" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("h4" + id).innerHTML) < h4)
					document.getElementById("h4" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h4" + id).innerHTML) > h4)
					document.getElementById("h4" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("h5" + id).innerHTML) < h5)
					document.getElementById("h5" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h5" + id).innerHTML) > h5)
					document.getElementById("h5" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("h6" + id).innerHTML) < h6)
					document.getElementById("h6" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("h6" + id).innerHTML) > h6)
					document.getElementById("h6" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("a1" + id).innerHTML) < a1)
					document.getElementById("a1" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a1" + id).innerHTML) > a1)
					document.getElementById("a1" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("a2" + id).innerHTML) < a2)
					document.getElementById("a2" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a2" + id).innerHTML) > a2)
					document.getElementById("a2" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("a3" + id).innerHTML) < a3)
					document.getElementById("a3" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a3" + id).innerHTML) > a3)
					document.getElementById("a3" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("a4" + id).innerHTML) < a4)
					document.getElementById("a4" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a4" + id).innerHTML) > a4)
					document.getElementById("a4" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("a5" + id).innerHTML) < a5)
					document.getElementById("a5" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a5" + id).innerHTML) > a5)
					document.getElementById("a5" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("a6" + id).innerHTML) < a6)
					document.getElementById("a6" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("a6" + id).innerHTML) > a6)
					document.getElementById("a6" + id).style.backgroundColor = "#99CC00";
				
				document.getElementById("h1" + id).innerHTML = h1;
				document.getElementById("h2" + id).innerHTML = h2;
				document.getElementById("h3" + id).innerHTML = h3;
				document.getElementById("h4" + id).innerHTML = h4;
				document.getElementById("h5" + id).innerHTML = h5;
				document.getElementById("h6" + id).innerHTML = h6;
				document.getElementById("a1" + id).innerHTML = a1;
				document.getElementById("a2" + id).innerHTML = a2;
				document.getElementById("a3" + id).innerHTML = a3;
				document.getElementById("a4" + id).innerHTML = a4;
				document.getElementById("a5" + id).innerHTML = a5;
				document.getElementById("a6" + id).innerHTML = a6;
				
				clearTimeout(clTimeout[0][id]);
				clearTimeout(clTimeout[1][id]);
				clearTimeout(clTimeout[2][id]);
				clearTimeout(clTimeout[3][id]);
				clearTimeout(clTimeout[4][id]);
				clearTimeout(clTimeout[5][id]);
				clearTimeout(clTimeout[6][id]);
				clearTimeout(clTimeout[7][id]);
				clearTimeout(clTimeout[8][id]);
				clearTimeout(clTimeout[9][id]);
				clearTimeout(clTimeout[10][id]);
				clearTimeout(clTimeout[11][id]);

				clTimeout[0][id] = setTimeout("set_attribute('h1" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[1][id] = setTimeout("set_attribute('h2" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[2][id] = setTimeout("set_attribute('h3" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[3][id] = setTimeout("set_attribute('h4" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[4][id] = setTimeout("set_attribute('h5" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[5][id] = setTimeout("set_attribute('h6" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[6][id] = setTimeout("set_attribute('a1" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[7][id] = setTimeout("set_attribute('a2" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[8][id] = setTimeout("set_attribute('a3" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[9][id] = setTimeout("set_attribute('a4" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[10][id] = setTimeout("set_attribute('a5" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[11][id] = setTimeout("set_attribute('a6" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				sound = true;
			}
		}
	}
	if (sound)
		playPlSound();
	coldXml = xml;
}
/***********************************************************************************************************************/

function ModifyHalffullTotalScore()
{
	try
	{
		xmlhttp.open("Get","/xml/halffulltotalscore.xml?"+ Date.parse(new Date()), true);
		xmlhttp.onreadystatechange =HalffullTotalScoreChange;
		xmlhttp.send(null);
	}
	catch(e){}
	setTimeout("ModifyHalffullTotalScore()", REFTIME);
}

function HalffullTotalScoreChange()
{
	if(xmlhttp.readyState !=4) return;
	var xmldoc=null;
	var xml;
	if(isIE)
	{
		xmldoc=xmlhttp.responseXML;
		xml=xmldoc.xml;
		if(xml==""||xml==coldXml) return;
	}
	else
	{
		
		xmldoc= parser.parseFromString(xmlhttp.responseText,"text/xml");
		if(xmldoc.documentElement.tagName=="parsererror") return;
		xml = oSerializer.serializeToString(xmldoc.documentElement);
		
		if(xml==coldXml) return;
	}
	var sound = false;
	var root = xmldoc.documentElement.getElementsByTagName("Fixture");
	for (var i=0;i<root.length;++i)
	{
		var id = root[i].getAttribute("id");
		var fo = root[i].getAttribute("fo");
		var _do = root[i].getAttribute("do");
		var so = root[i].getAttribute("so");
		
		if (document.getElementById("r" + id) != null)
		{
			if (document.getElementById("fo" + id).innerHTML != fo || document.getElementById("do" + id).innerHTML != _do || document.getElementById("so" + id).innerHTML != so)
			{
				if (parseFloat(document.getElementById("fo" + id).innerHTML) < fo)
					document.getElementById("fo" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("fo" + id).innerHTML) > fo)
					document.getElementById("fo" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("do" + id).innerHTML) < _do)
					document.getElementById("do" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("do" + id).innerHTML) > _do)
					document.getElementById("do" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("so" + id).innerHTML) < so)
					document.getElementById("so" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("so" + id).innerHTML) > so)
					document.getElementById("so" + id).style.backgroundColor = "#99CC00";
				
				document.getElementById("fo" + id).innerHTML = fo;
				document.getElementById("do" + id).innerHTML = _do;
				document.getElementById("so" + id).innerHTML = so;
				
				clearTimeout(clTimeout[0][id]);
				clearTimeout(clTimeout[1][id]);
				clearTimeout(clTimeout[2][id]);

				clTimeout[0][id] = setTimeout("set_attribute('fo" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[1][id] = setTimeout("set_attribute('do" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[2][id] = setTimeout("set_attribute('so" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				sound = true;
			}
		}
	}
	if (sound)
		playPlSound();
	coldXml =xml;
}
/***********************************************************************************************************************/

function ModifyFirstgoalTeam()
{
	try
	{
		xmlhttp.open("Get","/xml/firstgoalteam.xml?"+ Date.parse(new Date()), true);
		xmlhttp.onreadystatechange =FirstgoalTeamChange;
		xmlhttp.send(null);
	}
	catch(e){}
	setTimeout("ModifyFirstgoalTeam()", REFTIME);
}

function FirstgoalTeamChange()
{
	if(xmlhttp.readyState !=4) return;
	var xmldoc=null;
	var xml;
	if(isIE)
	{
		xmldoc=xmlhttp.responseXML;
		xml=xmldoc.xml;
		if(xml==""||xml==coldXml) return;
	}
	else
	{
		
		xmldoc= parser.parseFromString(xmlhttp.responseText,"text/xml");
		if(xmldoc.documentElement.tagName=="parsererror") return;
		xml = oSerializer.serializeToString(xmldoc.documentElement);
		
		if(xml==coldXml) return;
	}
	var sound = false;
	var root = xmldoc.documentElement.getElementsByTagName("Fixture");
	for (var i=0;i<root.length;++i)
	{
		var id = root[i].getAttribute("id");
		var ho = root[i].getAttribute("ho");
		var ao = root[i].getAttribute("ao");
		var no = root[i].getAttribute("no");
		
		if (document.getElementById("r" + id) != null)
		{
			if (document.getElementById("ho" + id).innerHTML != ho || document.getElementById("ao" + id).innerHTML != ao || document.getElementById("no" + id).innerHTML != no)
			{
				if (parseFloat(document.getElementById("ho" + id).innerHTML) < ho)
					document.getElementById("ho" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("ho" + id).innerHTML) > ho)
					document.getElementById("ho" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("ao" + id).innerHTML) < ao)
					document.getElementById("ao" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("ao" + id).innerHTML) > ao)
					document.getElementById("ao" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("no" + id).innerHTML) < no)
					document.getElementById("no" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("no" + id).innerHTML) > no)
					document.getElementById("no" + id).style.backgroundColor = "#99CC00";
				
				document.getElementById("ho" + id).innerHTML = ho;
				document.getElementById("ao" + id).innerHTML = ao;
				document.getElementById("no" + id).innerHTML = no;
				
				clearTimeout(clTimeout[0][id]);
				clearTimeout(clTimeout[1][id]);
				clearTimeout(clTimeout[2][id]);

				clTimeout[0][id] = setTimeout("set_attribute('ho" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[1][id] = setTimeout("set_attribute('ao" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[2][id] = setTimeout("set_attribute('no" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				sound = true;
			}
		}
	}
	if (sound)
		playPlSound();
	coldXml = xml;
}
/***********************************************************************************************************************/

function ModifyTeamCompare()
{
	try
	{
		xmlhttp.open("Get","/xml/teamcompare.xml?"+ Date.parse(new Date()), true);
		xmlhttp.onreadystatechange =TeamCompareChange;
		xmlhttp.send(null);
	}
	catch(e){}
	setTimeout("ModifyTeamCompare()", REFTIME);
}

function TeamCompareChange()
{
	if(xmlhttp.readyState !=4) return;
	var xmldoc=null;
	var xml;
	if(isIE)
	{
		xmldoc=xmlhttp.responseXML;
		xml=xmldoc.xml;
		if(xml==""||xml==coldXml) return;
	}
	else
	{
		
		xmldoc= parser.parseFromString(xmlhttp.responseText,"text/xml");
		if(xmldoc.documentElement.tagName=="parsererror") return;
		xml = oSerializer.serializeToString(xmldoc.documentElement);
		
		if(xml==coldXml) return;
	}
	var sound = false;
	var root = xmldoc.documentElement.getElementsByTagName("Fixture");
	for (var i=0;i<root.length;i+=4)
	{
		var id = root[i].getAttribute("id");
		var o1 = root[i].getAttribute("o");
		var o2 = root[i+1].getAttribute("o");
		var o4 = root[i+2].getAttribute("o");
		var o3 = root[i+3].getAttribute("o");
		
		if (document.getElementById("r" + id) != null)
		{
			if (document.getElementById("o1" + id).innerHTML != o1 || document.getElementById("o2" + id).innerHTML != o2 || 
				document.getElementById("o3" + id).innerHTML != o3 || document.getElementById("o4" + id).innerHTML != o4)
			{
				if (parseFloat(document.getElementById("o1" + id).innerHTML) < o1)
					document.getElementById("o1" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o1" + id).innerHTML) > o1)
					document.getElementById("o1" + id).style.backgroundColor = "#99CC00";
					
				if (parseFloat(document.getElementById("o2" + id).innerHTML) < o2)
					document.getElementById("o2" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o2" + id).innerHTML) > o2)
					document.getElementById("o2" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("o3" + id).innerHTML) < o3)
					document.getElementById("o3" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o3" + id).innerHTML) > o3)
					document.getElementById("o3" + id).style.backgroundColor = "#99CC00";
				
				if (parseFloat(document.getElementById("o4" + id).innerHTML) < o4)
					document.getElementById("o4" + id).style.backgroundColor = "#FF6600";
				else if (parseFloat(document.getElementById("o4" + id).innerHTML) > o4)
					document.getElementById("o4" + id).style.backgroundColor = "#99CC00";
				
				document.getElementById("o1" + id).innerHTML = o1;
				document.getElementById("o2" + id).innerHTML = o2;
				document.getElementById("o3" + id).innerHTML = o3;
				document.getElementById("o4" + id).innerHTML = o4;
				
				clearTimeout(clTimeout[0][id]);
				clearTimeout(clTimeout[1][id]);
				clearTimeout(clTimeout[2][id]);
				clearTimeout(clTimeout[3][id]);

				clTimeout[0][id] = setTimeout("set_attribute('o1" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[1][id] = setTimeout("set_attribute('o2" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[2][id] = setTimeout("set_attribute('o3" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				clTimeout[3][id] = setTimeout("set_attribute('o4" + id + "', 'style.backgroundColor', '')", SHOWTIME);
				sound = true;
			}
		}
	}
	if (sound)
		playPlSound();
	coldXml = xml;
}


function ModifyOddsData()
{
	try
	{
		xmlhttp.open("Get","/xml/odds.xml?"+ Date.parse(new Date()), true);
		xmlhttp.onreadystatechange =OddsDataChange;
		xmlhttp.send(null);
	}
	catch(e){}
	setTimeout("ModifyOddsData()", REFTIME);
}


function OddsDataChange()
{
	if(xmlhttp.readyState !=4) return;
	var xmldoc=null;
	var xml;
	if(isIE)
	{
		xmldoc=xmlhttp.responseXML;
		xml=xmldoc.xml;
		if(xml==""||xml==coldXml) return;
	}
	else
	{
		xmldoc= parser.parseFromString(xmlhttp.responseText,"text/xml");
		if(xmldoc.documentElement.tagName=="parsererror") return;
		xml = oSerializer.serializeToString(xmldoc.documentElement);
		if(xml==coldXml) return;
	}
	coldXml = xml;
	var sound = false;
	var root = xmldoc.documentElement.getElementsByTagName("Fixture");
	
	for (var i=0;i<root.length;i++)
	{
		var id = root[i].getAttribute("id");
		
		var g= root[i].getAttribute("g");
		var gg= root[i].getAttribute("gg");
		var li = OverUnderLine(root[i].getAttribute("li"));
		
		
		var ho = root[i].getAttribute("ho");
		var ao = root[i].getAttribute("ao");
		var oo = root[i].getAttribute("oo");
		var uo = root[i].getAttribute("uo");
		var wh = root[i].getAttribute("wh");
		var wd = root[i].getAttribute("wd");
		var wa = root[i].getAttribute("wa");
		
		if (document.getElementById("r" + id) == null) continue;

			
			if(document.getElementById("ho" +id).innerHTML != ho)
			{
					document.getElementById("ho" +id).className =	parseFloat(document.getElementById("ho" +id).innerHTML) < ho ? "r_rq2 u1" :"r_rq2 u2";		
					document.getElementById("ho" +id).innerHTML = ho;
					clearTimeout(clTimeout[0][id]);
					clTimeout[0][id] = setTimeout("set_attribute('ho" + id + "', 'className', 'r_rq2')", SHOWTIME);
					sound = true;
			}
			
			
			if(document.getElementById("ao" +id).innerHTML != ao)
			{
					document.getElementById("ao" +id).className =	parseFloat(document.getElementById("ao" +id).innerHTML) < ao ? "r_rq2 u1" :"r_rq2 u2";	
					document.getElementById("ao" +id).innerHTML = ao;
					clearTimeout(clTimeout[1][id]);
					clTimeout[1][id] = setTimeout("set_attribute('ao" + id + "', 'className', 'r_rq2')", SHOWTIME);
					sound = true;
			}
			
			if(document.getElementById("oo" +id).innerHTML != oo)
			{
					document.getElementById("oo" +id).className =	parseFloat(document.getElementById("oo" +id).innerHTML) < oo ? "r_sxr2 u1" :"r_sxr2 u2";		
					document.getElementById("oo" +id).innerHTML = oo;
					clearTimeout(clTimeout[2][id]);
					clTimeout[2][id] = setTimeout("set_attribute('oo" + id + "', 'className', 'r_sxr2')", SHOWTIME);
					sound = true;
			}
			
			if(document.getElementById("uo" +id).innerHTML != uo)
			{
					document.getElementById("uo" +id).className =	parseFloat(document.getElementById("uo" +id).innerHTML) < uo ? "r_sxr2 u1" :"r_sxr2 u2";		
					document.getElementById("uo" +id).innerHTML = uo;
					clearTimeout(clTimeout[3][id]);
					clTimeout[3][id] = setTimeout("set_attribute('uo" + id + "', 'className', 'r_sxr2')", SHOWTIME);
					sound = true;
			}
			
			if(document.getElementById("wh" +id).innerHTML != wh)
			{
					document.getElementById("wh" +id).className =	parseFloat(document.getElementById("wh" +id).innerHTML) < wh ? "r_rq3 u1" :"r_rq3 u2";		
					document.getElementById("wh" +id).innerHTML = wh;
					clearTimeout(clTimeout[4][id]);
					clTimeout[4][id] = setTimeout("set_attribute('wh" + id + "', 'className', 'r_rq3')", SHOWTIME);
					sound = true;
			}
			
			if(document.getElementById("wd" +id).innerHTML != wd)
			{
					document.getElementById("wd" +id).className =	parseFloat(document.getElementById("wd" +id).innerHTML) < wd ? "r_rq3 u1" :"r_rq3 u2";		
					document.getElementById("wd" +id).innerHTML = wd;
					clearTimeout(clTimeout[5][id]);
					clTimeout[5][id] = setTimeout("set_attribute('wd" + id + "', 'className', 'r_rq3')", SHOWTIME);
					sound = true;
			}
			
			if(document.getElementById("wa" +id).innerHTML != wa)
			{
					document.getElementById("wa" +id).className =	parseFloat(document.getElementById("wa" +id).innerHTML) < wa ? "r_rq3 u1" :"r_rq3 u2";		
					document.getElementById("wa" +id).innerHTML = wa;
					clearTimeout(clTimeout[6][id]);
					clTimeout[6][id] = setTimeout("set_attribute('wa" + id + "', 'className', 'r_rq3')", SHOWTIME);
					sound = true;
			}
			
			if(document.getElementById("li" +id).innerHTML != li)
			{
					document.getElementById("li" +id).className =	parseFloat(document.getElementById("li" +id).innerHTML) < li ? "r_sxr1 u1" :"r_sxr1 u2";		
					document.getElementById("li" +id).innerHTML = li;
					clearTimeout(clTimeout[7][id]);
					clTimeout[7][id] = setTimeout("set_attribute('li" + id + "', 'className', 'r_sxr1')", SHOWTIME);
					sound = true;
			}

			if (gg >=0)
			{
				if(g=="H")
				{

					document.getElementById("rqA" + id).innerHTML = "[" + convertGive(gg,odds_r) + "]";
					document.getElementById("rqB" + id).innerHTML = "";
				}
				else
				{
					document.getElementById("rqA" + id).innerHTML = "";
					document.getElementById("rqB" + id).innerHTML = "[" + convertGive(gg,odds_sr) + "]";
				}
			}

								
			
	}
	if (sound)
		playPlSound();
	

}

function ShowWordAd()
{
	var obj = document.getElementById("odds_tb");
	if (obj != null)
	{	
		
		var i;
		if (typeof(wordAd) == "string" && wordAd != "")
		{	
			if (typeof(document.all.ad1) == "object")
				obj.deleteRow(document.all.ad1.rowIndex);
			for (i=0;i<obj.rows.length;++i)
			{
				if(obj.rows[i].id=="") continue;
				i+= obj.rows[i].cells[0].rowSpan;
				break;
			}
			obj.insertRow(i);
			obj.rows[i].insertCell(0);
			obj.rows[i].id = "ad1";
			obj.rows[i].cells[0].colSpan = 100 ;
			obj.rows[i].cells[0].bgColor = "#FFFFFF";
			obj.rows[i].cells[0].align = "center";
			obj.rows[i].cells[0].innerHTML = wordAd;
		}
	
		if (typeof(wordAd2) == "string" && wordAd2 != "")
		{	
			if (typeof(document.all.ad2) == "object")
				obj.deleteRow(document.all.ad2.rowIndex);
			for (i=i+1;i<obj.rows.length;++i)
			{
				if(obj.rows[i].id=="") continue;
				i+= obj.rows[i].cells[0].rowSpan;
				break;
			}
			obj.insertRow(i);
			obj.rows[i].insertCell(0);
			obj.rows[i].id = "ad2";
			obj.rows[i].cells[0].colSpan = 100;
			obj.rows[i].cells[0].bgColor = "#FFFFFF";
			obj.rows[i].cells[0].align = "center";
			obj.rows[i].cells[0].innerHTML = wordAd2;
		}
	
		if (typeof(wordAd3) == "string" && wordAd3 != "")
		{	
			if (typeof(document.all.ad3) == "object")
				obj.deleteRow(document.all.ad3.rowIndex);
			for (i=i+1;i<obj.rows.length;++i)
			{
				if(obj.rows[i].id=="") continue;
				i+= obj.rows[i].cells[0].rowSpan;
				break;
			}
			obj.insertRow(i);
			obj.rows[i].insertCell(0);
			obj.rows[i].id = "ad3";
			obj.rows[i].cells[0].colSpan = 100;
			obj.rows[i].cells[0].bgColor = "#FFFFFF";
			obj.rows[i].cells[0].align = "center";
			obj.rows[i].cells[0].innerHTML = wordAd3;
		}
		
		if (typeof(wordAd4) == "string" && wordAd4 != "")
		{	
			if (typeof(document.all.ad4) == "object")
				obj.deleteRow(document.all.ad4.rowIndex);
			for (i=i+1;i<obj.rows.length;++i)
			{
				if(obj.rows[i].id=="") continue;
				i+= obj.rows[i].cells[0].rowSpan;
				break;
			}
			obj.insertRow(i);
			obj.rows[i].insertCell(0);
			obj.rows[i].id = "ad4";
			obj.rows[i].cells[0].colSpan = 100;
			obj.rows[i].cells[0].bgColor = "#FFFFFF";
			obj.rows[i].cells[0].align = "center";
			obj.rows[i].cells[0].innerHTML = wordAd4;
		}
		
		if (typeof(wordAd5) == "string" && wordAd5 != "")
		{	
			if (typeof(document.all.ad5) == "object")
				obj.deleteRow(document.all.ad5.rowIndex);
			for (i=i+1;i<obj.rows.length;++i)
			{
				if(obj.rows[i].id=="") continue;
				i+= obj.rows[i].cells[0].rowSpan;
				break;
			}
			obj.insertRow(i);
			obj.rows[i].insertCell(0);
			obj.rows[i].id = "ad5";
			obj.rows[i].cells[0].colSpan = 100;
			obj.rows[i].cells[0].bgColor = "#FFFFFF";
			obj.rows[i].cells[0].align = "center";
			obj.rows[i].cells[0].innerHTML = wordAd5;
		}
		
		if (typeof(wordAd6) == "string" && wordAd6 != "")
		{	
			if (typeof(document.all.ad6) == "object")
				obj.deleteRow(document.all.ad6.rowIndex);
			for (i=i+1;i<obj.rows.length;++i)
			{
				if(obj.rows[i].id=="") continue;
				i+= obj.rows[i].cells[0].rowSpan;
				break;
			}
			obj.insertRow(i);
			obj.rows[i].insertCell(0);
			obj.rows[i].id = "ad6";
			obj.rows[i].cells[0].colSpan = 100;
			obj.rows[i].cells[0].bgColor = "#FFFFFF";
			obj.rows[i].cells[0].align = "center";
			obj.rows[i].cells[0].innerHTML = wordAd6;
		}
		
		if (typeof(wordAd7) == "string" && wordAd7 != "")
		{
			if (typeof(document.all.ad7) == "object")
				obj.deleteRow(document.all.ad7.rowIndex);
			for (i=i+1;i<obj.rows.length;++i)
			{
				if(obj.rows[i].id=="") continue;
				i+= obj.rows[i].cells[0].rowSpan;
				break;
			}
			obj.insertRow(i);
			obj.rows[i].insertCell(0);
			obj.rows[i].id = "ad7";
			obj.rows[i].cells[0].colSpan = 100;
			obj.rows[i].cells[0].bgColor = "#FFFFFF";
			obj.rows[i].cells[0].align = "center";
			obj.rows[i].cells[0].innerHTML = wordAd7;
		
		}
	}
}



/***********************************************************************************************************************/


