var soundflag=true;

function hide(id)
{
	var line = document.getElementById(id);
	line.style.display = "none";
	hide_count ++;
	
	var hider =  document.getElementById('hider');
	hider.innerText = hide_count;
}

function createTable()
{
	BulidTable();

	var hider = document.getElementById("hider");
	hider.innerText = allCount - showCount;		
	hide_count  = allCount - showCount;	
	
	
	change();
	
}

function history(scheduleid,companyid,kind)
{	
	var path;
	
	path = "odds_analysis/vary" + scheduleid + "-"+companyid+kind+".html";
	window.open(path,"","height=600px,width=520px,toolbar=no,scrollbars=yes,menubar=no");		
}


function goToPlayed()
{
	if (pId != null)
	{
		document.location.href = "played2_" + lang + ".shtml?pId=" + pId;
	}
}

function CetPkStr1(i)
{
	if (i > 40)
		return "";
	return RQ_ARR1[i];
}

function RetPkStr1(value)
{
	for (var i = 0; i < RQ_ARR1.length; i++ )
	{
		if ( value == RQ_ARR1[i] )
		{
			return i / 4;
		}
	}
	
	return "";
}

function CetPkStr2(i)
{
	if (i > 40)
		return "";
	return RQ_ARR2[i];
}

function RetPkStr2(value)
{
	for (var i = 0; i < RQ_ARR2.length; i++ )
	{
		if ( value ==  RQ_ARR2[i] )
		{
			return i / 4;
		}
	}
	
	return "";
}

function jingjian()
{	
	setCookie( "@matchsID","Simple");
	document.location.href = document.location.href;
}

function show()
{
	setCookie( "@matchsID","All");	
	var page = document.location.href;
	document.location.href = page;	
}

/* 选择赛事 */
function selectMatch(flag,page)
{
	document.getElementById("Selframe").src = "matchSelect.htm";
	document.getElementById("SelList_div").style.display = "";		
	
	var obj = document.getElementById("SelList_div");
	obj.style.top = (getElementPos("saishi").y + 20) + "px";
	obj.style.left =((document.body.clientWidth / 2) - 250 )+"px";	
}

/* 选择公司 */
function selectProvider(page)
{
	document.getElementById("Selframe").src = "companySelect.htm";
	document.getElementById("SelList_div").style.display = "";
	
	var obj = document.getElementById("SelList_div");
	obj.style.top = (getElementPos("saishi").y + 20) + "px";
	obj.style.left = ((document.body.clientWidth / 2) - 250 )+"px";	
}

function updateMatchs(value,page)
{	
	document.location.href = "index.htm";
}

function updateProviders(value,page)
{
	document.location.href = "index.htm";
}

function getCookie(name)
{
  var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
  if(arr != null) return unescape(arr[2]); return null;
}

function playPkSound()
{
	if (soundflag)
	{  
		var pk = document.getElementById("pk");
		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='images/s1.swf'><param name='quality' value='high'><param name='wmode' value='transparent'><embed src='images/s1.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='1' height='1'></embed></object>";
	}
		
}

function ShowSound(obj)
{	
	if(soundflag)
	{
		soundflag = false;		
			
	}
	else
	{
		soundflag = true;	
		
	}		
}