function showhide(id,status)
     { 
		if (status=='hide')
	    {
			document.getElementById(id).style.display = 'none'; 
			document.getElementById(id+1).onclick = function(){showhide(id,'show');};
			document.getElementById('img'+id).onclick=function(){showhide(id,'show');};
			document.getElementById('img'+id).src = IMGPATH+'/yl_frarrow.gif';
			if(navigator.appName == "Microsoft Internet Explorer")
			{
				if(document.getElementById('ads_exp_Middle'))
				{
					setto = parseInt(document.getElementById('ads_exp_Middle').style.top.replace('px',''))-85;
					document.getElementById('ads_exp_Middle').style.top = setto+'px';
				}
			}
        }
	   	else
	    {
			document.getElementById(id+1).onclick = function(){showhide(id,'hide');};
			document.getElementById('img'+id).src = IMGPATH+'/yl_dnarrow.gif';   
			document.getElementById('img'+id).onclick=function(){showhide(id,'hide');};
            document.getElementById(id).style.display = '';	
			if(navigator.appName == "Microsoft Internet Explorer")
			{
				if(document.getElementById('ads_exp_Middle'))
				{
					setto = parseInt(document.getElementById('ads_exp_Middle').style.top.replace('px',''))+85;
					document.getElementById('ads_exp_Middle').style.top = setto+'px';
				}
			}
			
	    }	             
      }



function printticker(tickerjson){
  totaltickerematches = tickerjson.length;
  var cricketscoreticker = '';
  if(totaltickerematches > 0){
  cricketscoreticker += "<font color='e84c00'> Live Score : </font>";
  
  for(i=0; i<totaltickerematches; i++)
	{
	  if(i != 0)
      cricketscoreticker += " | ";

	cricketscoreticker += "<a href="+CRICKET_SERVER_URL+"/scorecard/cricket-scores-"+tickerjson[i].id+".php  target='_blank'>"+tickerjson[i].team1+" Vs "+tickerjson[i].team2;
	if(tickerjson[i].batteamname != '')
	cricketscoreticker += " - "+tickerjson[i].batteamname+": "+tickerjson[i].batteamruns+"/ "+tickerjson[i].batteamwkts+" ("+tickerjson[i].batteamovers+" Ovs.).";
	cricketscoreticker += "</a>";

	}
  document.getElementById("matchscore").style.display = '';
	//document.getElementById("cg_wcticker").innerHTML = cricketscoreticker;
}
else{    
	if(document.getElementById("matchscore"))
	 document.getElementById("matchscore").style.display = 'none';

}



}


function printlivescore(data){
  if(data.scorecard.livescore)
	totallivematches = data.scorecard.livescore.length;
  else
	totallivematches = 0;

  var livescoreboard = '';



  if(totallivematches > 0){
	livescoreboard += '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="cribor02"><tr><td height="27" colspan="2" align="left" valign="middle" bgcolor="#e01a00" class="colWh txt21px disL"><strong>Live Matches</strong></td></tr><tr><td height="1" colspan="2" bgcolor="#777777"><img src="'+IMGPATH+'/spacer.gif" width="1" height="1" /></td></tr><tr>';

  for(i=0; i<totallivematches; i++){
	  var fmatch,fstatus;

	//   if(i!=0){
	//	fmatch="display:none; overflow:hidden;"; 
	//	fstatus="show";
	//	}
	
	//	else {
	fstatus="hide";
	//}
	livescoreboard +='<td width="89%" height="25" align="left" valign="middle" bgcolor="#000000" class="yelTxt11p disL"><span><a id="'+data.scorecard.livescore[i].id+1+'" onclick="javascript:showhide(\''+data.scorecard.livescore[i].id+'\',\''+fstatus+'\')" href="javascript:void(0)">'+data.scorecard.livescore[i].team1+' vs '+data.scorecard.livescore[i].team2+'</a></span></td><td width="11%" align="center" bgcolor="#000000" class="gameName_blu"><a href="#"></a> <img onclick="javascript:showhide(\''+data.scorecard.livescore[i].id+'\',\''+fstatus+'\')" id="img'+data.scorecard.livescore[i].id+'" src="'+IMGPATH+'/yl_dnarrow.gif" width="9" height="9" border="0" /></td></tr>';
	
	livescoreboard += '<tr><td height="58" colspan="2" align="left" valign="top" bgcolor="#f2f2f2" class="disL" id="'+data.scorecard.livescore[i].id+'" style="'+fmatch+'" height="58"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td colspan="2" align="left" valign="top" class="txt25p"><strong>'+data.scorecard.livescore[i].batteamname+':'+data.scorecard.livescore[i].batteamruns+'/'+data.scorecard.livescore[i].batteamwkts+'</strong></td></tr><tr><td width="40%" style="padding-bottom:3px;" align="left" valign="top" class="colOr txt18px"><strong>'+data.scorecard.livescore[i].batteamovers+' Overs</strong></td><td width="60%" align="center" style="padding-bottom:3px;" valign="bottom" class="bodyTxt01"><a href="'+CRICKET_SERVER_URL+'/scorecard/cricket-scores-'+data.scorecard.livescore[i].id+'.php" style="text-decoration:underline">View Detailed Score</a></td></tr></table></td></tr><tr><td colspan="2" bgcolor="#777777" height="1"><img src="'+IMGPATH+'/spacer.gif" width="1" height="1"></td></tr>';

  }
  livescoreboard += '</td></tr></table><div id="expshosh"></div>';



  if(document.getElementById("livescore"))
	document.getElementById("livescore").innerHTML = livescoreboard;
  }
  //setshosh(totallivematches);
}
