var objRequest=false;
var objRequest1=false;
var objRequest2=false;
var objRequest3=false;

function createXMLHttp()
{
		
	if(window.XMLHttpRequest)
	{
		objRequest=new XMLHttpRequest();
		
		if(objRequest==null)
			objRequest=new ActiveXObject("Microsoft.XMLHTTP");
		if(objRequest==null)
			objRequest=new ActiveXObject("MSXML2.XMLHTTP");
		if(objRequest==null)
			objRequest=new ActiveXObject("MSXML2.XMLHTTP.3.0");
		if(objRequest==null)
			objRequest=new ActiveXObject("Msxml2.XMLHTTP.4.0");
		if(objRequest==null)
			objRequest=new ActiveXObject("Msxml2.XMLHTTP.5.0");
		if(objRequest==null)
			objRequest=new ActiveXObject("Msxml2.XMLHTTP.6.0");
		if(objRequest==null)
			objRequest=new ActiveXObject("Msxml2.XMLHTTP.7.0")
		//objRequest.overrideMimeType("text/xml");
		
	}
	else if(window.ActiveXObject)
	{

		objRequest=new ActiveXObject("Microsoft.XMLHTTP");
		if(objRequest==null)
			objRequest=new ActiveXObject("MSXML2.XMLHTTP");
		if(objRequest==null)
			objRequest=new ActiveXObject("MSXML2.XMLHTTP.3.0");
		if(objRequest==null)
			objRequest=new ActiveXObject("Msxml2.XMLHTTP.4.0");
		if(objRequest==null)
			objRequest=new ActiveXObject("Msxml2.XMLHTTP.5.0");
		if(objRequest==null)
			objRequest=new ActiveXObject("Msxml2.XMLHTTP.6.0");
		if(objRequest==null)
			objRequest=new ActiveXObject("Msxml2.XMLHTTP.7.0");

	}
	
}

function createXMLHttp1()
{
		
	if(window.XMLHttpRequest)
	{
		objRequest1=new XMLHttpRequest();
		
		if(objRequest1==null)
			objRequest1=new ActiveXObject("Microsoft.XMLHTTP");
		if(objRequest1==null)
			objRequest1=new ActiveXObject("MSXML2.XMLHTTP");
		if(objRequest1==null)
			objRequest1=new ActiveXObject("MSXML2.XMLHTTP.3.0");
		if(objRequest1==null)
			objRequest1=new ActiveXObject("Msxml2.XMLHTTP.4.0");
		if(objRequest1==null)
			objRequest1=new ActiveXObject("Msxml2.XMLHTTP.5.0");
		if(objRequest1==null)
			objRequest1=new ActiveXObject("Msxml2.XMLHTTP.6.0");
		if(objRequest1==null)
			objRequest1=new ActiveXObject("Msxml2.XMLHTTP.7.0")
		//objRequest.overrideMimeType("text/xml");
		
	}
	else if(window.ActiveXObject)
	{

		objRequest1=new ActiveXObject("Microsoft.XMLHTTP");
		if(objRequest1==null)
			objRequest1=new ActiveXObject("MSXML2.XMLHTTP");
		if(objRequest1==null)
			objRequest1=new ActiveXObject("MSXML2.XMLHTTP.3.0");
		if(objRequest1==null)
			objRequest1=new ActiveXObject("Msxml2.XMLHTTP.4.0");
		if(objRequest1==null)
			objRequest1=new ActiveXObject("Msxml2.XMLHTTP.5.0");
		if(objRequest1==null)
			objRequest1=new ActiveXObject("Msxml2.XMLHTTP.6.0");
		if(objRequest1==null)
			objRequest1=new ActiveXObject("Msxml2.XMLHTTP.7.0");

	}
	
}

function createXMLHttp2()
{
		
	if(window.XMLHttpRequest)
	{
		objRequest2=new XMLHttpRequest();
		
		if(objRequest2==null)
			objRequest2=new ActiveXObject("Microsoft.XMLHTTP");
		if(objRequest2==null)
			objRequest2=new ActiveXObject("MSXML2.XMLHTTP");
		if(objRequest2==null)
			objRequest2=new ActiveXObject("MSXML2.XMLHTTP.3.0");
		if(objRequest2==null)
			objRequest2=new ActiveXObject("Msxml2.XMLHTTP.4.0");
		if(objRequest2==null)
			objRequest2=new ActiveXObject("Msxml2.XMLHTTP.5.0");
		if(objRequest2==null)
			objRequest2=new ActiveXObject("Msxml2.XMLHTTP.6.0");
		if(objRequest2==null)
			objRequest2=new ActiveXObject("Msxml2.XMLHTTP.7.0")
		//objRequest.overrideMimeType("text/xml");
		
	}
	else if(window.ActiveXObject)
	{

		objRequest2=new ActiveXObject("Microsoft.XMLHTTP");
		if(objRequest2==null)
			objRequest2=new ActiveXObject("MSXML2.XMLHTTP");
		if(objRequest2==null)
			objRequest2=new ActiveXObject("MSXML2.XMLHTTP.3.0");
		if(objRequest2==null)
			objRequest2=new ActiveXObject("Msxml2.XMLHTTP.4.0");
		if(objRequest2==null)
			objRequest2=new ActiveXObject("Msxml2.XMLHTTP.5.0");
		if(objRequest2==null)
			objRequest2=new ActiveXObject("Msxml2.XMLHTTP.6.0");
		if(objRequest2==null)
			objRequest2=new ActiveXObject("Msxml2.XMLHTTP.7.0");

	}
	
}

function createXMLHttp3()
{
		
	if(window.XMLHttpRequest)
	{
		objRequest3=new XMLHttpRequest();
		
		if(objRequest3==null)
			objRequest3=new ActiveXObject("Microsoft.XMLHTTP");
		if(objRequest3==null)
			objRequest3=new ActiveXObject("MSXML2.XMLHTTP");
		if(objRequest3==null)
			objRequest3=new ActiveXObject("MSXML2.XMLHTTP.3.0");
		if(objRequest3==null)
			objRequest3=new ActiveXObject("Msxml2.XMLHTTP.4.0");
		if(objRequest3==null)
			objRequest3=new ActiveXObject("Msxml2.XMLHTTP.5.0");
		if(objRequest3==null)
			objRequest3=new ActiveXObject("Msxml2.XMLHTTP.6.0");
		if(objRequest3==null)
			objRequest3=new ActiveXObject("Msxml2.XMLHTTP.7.0")
		//objRequest.overrideMimeType("text/xml");
		
	}
	else if(window.ActiveXObject)
	{

		objRequest3=new ActiveXObject("Microsoft.XMLHTTP");
		if(objRequest3==null)
			objRequest3=new ActiveXObject("MSXML2.XMLHTTP");
		if(objRequest3==null)
			objRequest3=new ActiveXObject("MSXML2.XMLHTTP.3.0");
		if(objRequest3==null)
			objRequest3=new ActiveXObject("Msxml2.XMLHTTP.4.0");
		if(objRequest3==null)
			objRequest3=new ActiveXObject("Msxml2.XMLHTTP.5.0");
		if(objRequest3==null)
			objRequest3=new ActiveXObject("Msxml2.XMLHTTP.6.0");
		if(objRequest3==null)
			objRequest3=new ActiveXObject("Msxml2.XMLHTTP.7.0");

	}
	
}

function convertBallsToOvers(balls)
{
	
	var a=Math.floor(balls/6);
	var b=balls-(a*6);
	var c=a+(b/10);
	return c.toFixed(1);
}

function setValue(str,typ)
{
	switch(typ)
	{
		case 1:
			document.getElementById("txttournament").value=str;
			break;
		case 2:
			document.getElementById("txtgroup").value=str;
			break;
		
	}
}

function showClub(id)
{	
	
	if(document.getElementById("table"+id).style.display=="none")
	{
		document.getElementById("div"+id).style.backgroundImage="url('image/arrow-up.gif')";
		document.getElementById("table"+id).style.display="block";
	}
	else
	{
		document.getElementById("div"+id).style.backgroundImage="url('image/arrow-down.gif')";
		document.getElementById("table"+id).style.display="none";
	}
}


function showplayerstogroups()
{
		document.getElementById("toparea1").innerHTML=strtournamentlabel;
		document.getElementById("toparea2").innerHTML=strtournament;
		document.getElementById("toparea3").innerHTML=strgroups;
}

function showplayerstogroupswithoutdetail()
{
		document.getElementById("toparea1").innerHTML=strtournamentlabel;
		document.getElementById("toparea2").innerHTML=strtournament;
		document.getElementById("toparea3").innerHTML=strgroupswithoutdetail;
}

function getprofiletoshowplayers()
{
	document.getElementById("toparea1").innerHTML=strshowplayerslabel;
	document.getElementById("toparea2").innerHTML="";
	document.getElementById("toparea3").innerHTML=strshowplayers;
}

function matchdetailtoschedule()
{
	document.getElementById("toparea1").innerHTML=strtournamentlabel;
	document.getElementById("toparea2").innerHTML=strtournament;
	document.getElementById("toparea3").innerHTML=strschedule;
}

function matchdetailtoscore()
{
	document.getElementById("toparea1").innerHTML=strtournamentlabel;
	document.getElementById("toparea2").innerHTML=strtournament;
	document.getElementById("toparea3").innerHTML=strscore;
}

function matchdetailtosingleschedule()
{
	
	document.getElementById("toparea1").innerHTML=strtournamentlabel;
	document.getElementById("toparea2").innerHTML=strtournament;
	document.getElementById("toparea3").innerHTML=strsingleschedule;
}

function aboutus()
{
	 var strtitle="";
	 strtitle=strtitle+"<table width='0' border='0' cellspacing='0'><tr height='14'>";
	 strtitle=strtitle+"<td width='26' style='background-color:#d6d6d6;'></td>";
	 strtitle=strtitle+"<td style='color:#c9ff00; font-size:10pt; font-weight:bold;'>&nbsp;About Us&nbsp;</td>";
	 strtitle=strtitle+"<td width='345' style='background-image:url(image/line.jpg);'></td>";
	 strtitle=strtitle+"</tr></table>";
	 
	 var str="<div class='groups'><div id='header'  style='background-color:#000000; height:30px; margin-bottom:7px;'><div  class='caption1'>History</div></div><table width='515' border='0' cellspacing='0' cellpadding='0' align='center' style='text-align: justify;'><tr><td><p><strong>Victo Club</strong></font> was founded in the year 1993 under the able leadership of <strong>Rupesh Miharia</strong>.Initially in the year 1993 the club launched an Outdoor Cricket Tournament in which 16 Teams participated and finally the tournamnet was won by the Body Line Club.</p><p align='justify'>The inaugural Tournament itself received an overwhelming response which made our founder member Mr. <strong>Rupesh Miharia </strong> to further enhance the tournament . Thus the journey of the rising <strong>Victo Club</strong></font> started with the next years tournament organized in a much bigger scale , and comprising of whopping 36 Teams in totals. The finals was played under floodlights at the S.T.S which at those times was quite a big event on its own. It should also be noted here that the flood lights tournaments was introduced for the first time in the history of Kolkata by <strong>Victo Club</strong></font> itself. </p><p align='justify'>Since then onwards the Club has never looked back and has left no stone unturned to make the tournament reach to the zeniths of the Game. Every year the tournament is being organized and every time different jewels were added to the crown of the club. Now <strong>Victo Club</strong></font> is known very well in the cricketing fraternity with more and more professionalism and dedication enhancing the levels of the games. The organizers have also been calling upon the cricketing heros like Kapil Dev to vouch the finals and give attractive prizes.</p></td></tr></table></div><div class='groups'><div id='header'  style='background-color:#000000; height:30px; margin-bottom:7px;'><div class='caption1'>The Mission</div></div><table width='515' border='0' cellspacing='0' cellpadding='0' align='center' style='text-align: justify;'><tr><td><p align='justify'>The main motto of <strong>Mr. Rupesh</strong> behind forming the club was to promote cricket and other sporting activities among the amateurs and non professionals. With the current hype for Cricket , it becomes a very difficult platform for non professionals to get a competitive and professional environment to rejuvenate the spirits of the game and Victo as a non profit making organization has been successfully doing the same for Years. </p><p align='justify'>The club’s other objectives were to develop leadership qualities among youngsters and also provide social development to the society </p><p align='justify'>Victo has been regularly making donations and organizing social activities to enhance the society. One such event has been the 51 day Anti Drug Campaign which even attracted participations of Dr. Devi Shetty , Kiran More , The West Bengal Government and many other dignitaries. Victo has also been organizing Leadership training events like “JAM-E-XAM” which was a interschool Just a Minute Competition.</p></td></tr></table></div><div class='groups'><div id='header' style='background-color:#000000; height:30px; margin-bottom:7px;'><div class='caption1'>People</div></div><table width='515' border='0' cellspacing='0' cellpadding='0' align='center' style='text-align: justify;'><tr><td><p></strong>Some of the dedicated members of the club are <br />&bull;Anil Miharia<br />&bull;Rupesh Miharia<br />&bull;Sanjay Agarwal<br />&bull;Pravin<br />&bull;Ajay Haritwal<br />&bull;Sandeep Modi <br />&bull;Gautam Bansal<br />&bull;Gaurav Bansal<br />&bull;Bharat Shah<br />&bull;Narayan Beriwala </p></td></tr></table></div></div>";
	 
	 document.getElementById("topindex").style.display="block";
	 document.getElementById("toparea2").innerHTML="";
	 document.getElementById("toparea3").innerHTML="";
	 document.getElementById("toparea1").innerHTML=strtitle;
	 document.getElementById("toparea2").innerHTML=str;
}

function organizers()
{
	var strtitle="";
	strtitle=strtitle+"<table width='600' border='0' cellspacing='0' cellpadding='0' style='text-align:left;'>";
	strtitle=strtitle+"<tr height='14'>";
	strtitle=strtitle+"<td width='15' bgcolor='#69c6c7'>&nbsp;</td>";
	strtitle=strtitle+"<td width='125' align='center'><strong>Organizers</strong></td>";
	strtitle=strtitle+"<td width='460' background='image/line.jpg'>&nbsp;</td>";
	strtitle=strtitle+"</tr>";
	strtitle=strtitle+"</table>";
	
	var str="<br/><br/><div align='left'>&nbsp;&nbsp;&raquo;<strong><u>Governing Council:</u></strong></div><table border='0' align='center' cellpadding='0' cellspacing='4' width='95%' style='margin-top:20px; text-align:center;'><tr><td  style='padding-bottom:5px;'><img src='organizer/noimage.gif' width='125' height='162' style='border:2px solid #FFFFFF;' /></td><td width='5'></td><td style='padding-bottom:5px;'><img src='organizer/noimage.gif' width='125' height='162' style='border:2px solid #FFFFFF;' /></td><td width='5'></td><td style='padding-bottom:5px;'><img src='organizer/AnilMeharia.jpg' width='125' height='162' style='border:2px solid #FFFFFF;' /></td></tr><tr height='25'><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Devang Gandhi</b></td><td width='5'></td><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Sambaran Banerjee</b></td><td width='5'></td><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Anil Miharia</b></td></tr><tr height='20'><tr><td style='padding-bottom:5px;'><img src='organizer/RupeshMeharia.jpg' width='125' height='162' style='border:2px solid #FFFFFF;' /></td><td width='5'></td><td style='padding-bottom:5px;'><img src='organizer/noimage.gif' width='125' height='162' style='border:2px solid #FFFFFF;'/></td><td width='5'></td><td style='padding-bottom:5px;'>&nbsp;</td></tr><tr height='25'><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Rupesh Miharia</b></td><td width='5'></td><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Mahesh Tekriwal</b></td><td width='5'></td><td >&nbsp;</td></tr><tr height='20'></table><div align='left'>&nbsp;&nbsp;&raquo;<strong><u>Management Council:</u></strong></div><table border='0' align='center' cellpadding='0' cellspacing='4' width='95%' style='margin-top:20px; text-align:center;'><tr><td  style='padding-bottom:5px;'><img src='organizer/SanjayAgarwal.jpg' width='125' height='162' style='border:2px solid #FFFFFF;' /></td><td width='5'></td><td style='padding-bottom:5px;'><img src='organizer/Amit-Khemka.jpg' width='125' height='162' style='border:2px solid #FFFFFF;' /></td><td width='5'></td><td style='padding-bottom:5px;'><img src='organizer/NarayanBeriwala.jpg' width='125' height='162' style='border:2px solid #FFFFFF;' /></td></tr><tr height='25'><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Sanjay Agarwal</b></td><td width='5'></td><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Amit Khemka</b></td><td width='5'></td><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Narayan Beriwala</b></td></tr><tr height='20'><tr><td style='padding-bottom:5px;'><img src='organizer/noimage.gif' width='125' height='162' style='border:2px solid #FFFFFF;' /></td><td width='5'></td><td style='padding-bottom:5px;'>&nbsp;</td><td width='5'></td><td style='padding-bottom:5px;'>&nbsp;</td></tr><tr height='25'><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Vikas Bhartia</b></td><td width='5'></td><td>&nbsp;</td><td width='5'></td><td >&nbsp;</td></tr><tr height='20'></table><div align='left'>&nbsp;&nbsp;&raquo;<strong><u>Advisory Council:</u></strong></div><table border='0' align='center' cellpadding='0' cellspacing='4' width='95%' style='margin-top:20px; text-align:center;'><tr><td  style='padding-bottom:5px;'><img src='organizer/GautamBansal.jpg' width='125' height='162' style='border:2px solid #FFFFFF;' /></td><td width='5'></td><td style='padding-bottom:5px;'><img src='organizer/noimage.gif' width='125' height='162' style='border:2px solid #FFFFFF;' /></td><td width='5'></td><td style='padding-bottom:5px;'><img src='organizer/AjayHaritwal.jpg' width='125' height='162' style='border:2px solid #FFFFFF;' /></td></tr><tr height='25'><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Gautam Bansal</b></td><td width='5'></td><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Sandeep Modi</b></td><td width='5'></td><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Ajay Haritwal</b></td></tr><tr height='20'><tr><td style='padding-bottom:5px;'><img src='organizer/GauravBansal.jpg' width='125' height='162' style='border:2px solid #FFFFFF;' /></td><td width='5'></td><td style='padding-bottom:5px;'><img src='organizer/noimage.gif' alt='' width='125' height='162' style='border:2px solid #FFFFFF;'/></td><td width='5'></td><td style='padding-bottom:5px;'></td></tr><tr height='25'><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Gaurav Bansal</b></td><td width='5'></td><td bgcolor='#000' style='color:#FFCC00; border-left:3px solid #CCCCCC; border-right:3px solid #CCCCCC;'><b>Mr. Som Prakash Singh</b></td><td width='5'></td><td>&nbsp;</td></tr><tr height='20'></table>";
	
	
	document.getElementById("toparea2").innerHTML="";
	document.getElementById("toparea3").innerHTML="";
	document.getElementById("toparea1").innerHTML=strtitle;
	document.getElementById("toparea2").innerHTML=str;
}


function gallery()
{
	var strtitle="";
	strtitle=strtitle+"<table width='0' border='0' cellspacing='0'><tr height='14'>";
	strtitle=strtitle+"<td width='26' style='background-color:#d6d6d6;'></td>";
	strtitle=strtitle+"<td style='color:#c9ff00; font-size:10pt; font-weight:bold;'>&nbsp;Photo Gallery&nbsp;</td>";
	strtitle=strtitle+"<td width='345' style='background-image:url(image/line.jpg);'></td>";
	strtitle=strtitle+"</tr></table>";
	var str="<table cellpadding='3' cellspacing='3' class='style2' style='width: 100%'><tr><td class='style1' style='width: 179px'><a href='Gallery/1.jpg' target='_blank'><img src='Gallery/1-thumb.jpg' width='150' height='96' border='0' alt=''/></a></td><td class='style1' style='width: 192px'><a href='Gallery/2.jpg' target='_blank'><img src='Gallery/2-thumb.jpg' width='150' height='96' border='0' /></a></td><td class='style1'><a href='Gallery/3.jpg' target='_blank'><img src='Gallery/3-thumb.jpg' width='68' height='96' border='0'  /></a></td></tr><tr><td class='style1' style='width: 179px'><a href='Gallery/4.jpg' target='_blank'><img src='Gallery/4-thumb.jpg' width='150' height='106' border='0'  /></a></td><td class='style1' style='width: 192px'><a href='Gallery/5.jpg' target='_blank'><img src='Gallery/5-thumb.jpg' width='150' height='107' border='0'  /></a></td><td class='style1'><a href='Gallery/6.jpg' target='_blank'><img src='Gallery/6-thumb.jpg' width='150' height='106' border='0'  /></a></td></tr><tr><td class='style1' style='width: 179px'><a href='Gallery/7.jpg' target='_blank'><img src='Gallery/7-thumb.jpg' width='150' height='107' border='0'  /></a></td><td class='style1' style='width: 192px'><a href='Gallery/8.jpg' target='_blank'><img src='Gallery/8-thumb.jpg' width='150' height='107' border='0'  /></a></td><td class='style1'><a href='Gallery/9.jpg' target='_blank'><img src='Gallery/9-thumb.jpg' width='150' height='107' border='0'  /></a></td></tr><tr><td class='style1' style='width: 179px'><a href='Gallery/10.jpg' target='_blank'><img src='Gallery/10-thumb.jpg' width='150' height='107' border='0'  /></a></td><td class='style1' style='width: 192px'><a href='Gallery/11.jpg' target='_blank'><img src='Gallery/11-thumb.jpg' width='150' height='108' border='0'  /></a></td><td class='style1'><a href='Gallery/12.jpg' target='_blank'><img src='Gallery/12-thumb.jpg' width='150' height='106' border='0'  /></a></td></tr><tr><td class='style1' style='width: 179px'><a href='Gallery/13.jpg' target='_blank'><img src='Gallery/13-thumb.jpg' width='150' height='108' border='0'  /></a></td><td class='style1' style='width: 192px'><a href='Gallery/14.jpg' target='_blank'><img src='Gallery/14-thumb.jpg' width='150' height='107' border='0'  /></a></td><td class='style1'><a href='Gallery/15.jpg' target='_blank'><img src='Gallery/15-thumb.jpg' width='150' height='109' border='0'  /></a></td></tr><tr><td class='style1' style='width: 179px'><a href='Gallery/16.jpg' target='_blank'><img src='Gallery/16-thumb.jpg' width='150' height='108' border='0'  /></a></td><td class='style1' style='width: 192px'><a href='Gallery/17.jpg' target='_blank'><img src='Gallery/17-thumb.jpg' width='150' height='108' border='0'  /></a></td><td class='style1'><a href='Gallery/18.jpg' target='_blank'><img src='Gallery/18-thumb.jpg' width='150' height='108' border='0'  /></a></td></tr></table>";
	
	document.getElementById("topindex").style.display="block";
	document.getElementById("toparea2").innerHTML="";
	document.getElementById("toparea3").innerHTML="";
	document.getElementById("toparea1").innerHTML=strtitle;
	document.getElementById("toparea2").innerHTML=str;
}




function getFrontGroups(id)
{
	
	createXMLHttp1();
	if(objRequest1)
	{
		objRequest1.open("POST","frontgroup.php?r="+ new Date().getTime());
		objRequest1.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objRequest1.onreadystatechange=function()
		{
		if(objRequest1.readyState==4 && objRequest1.status==200)
			{
				var doc=objRequest1.responseXML;
				
				var groupsNode=doc.documentElement;
				if(groupsNode)
				{
					var str="";
					
					var groupNode=groupsNode.getElementsByTagName("group");
					
					str=str+"<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
					str=str+"<tr>"
					str=str+"<td width='20%' align='center'><b><font color='#ffff00'>Group</font></b></td>"
					str=str+"<td width='40%' align='center'><b><font color='#ffff00'>Team</font></b></td>"
					str=str+"<td width='20%' align='center'><b><font color='#ffff00'>Points</font></b></td>"
					str=str+"<td width='20%' align='right'><b><font color='#ffff00'>Net R/R</font>&nbsp;</b></td>"
					str=str+"</tr>"
					
					for(var i=0;i<groupNode.length;i++)
					{
						var idNode=groupNode[i].firstChild;
						var gid=idNode.childNodes[0].nodeValue;
						
						var groupnameNode=idNode.nextSibling;
						var groupname=groupnameNode.childNodes[0].nodeValue;
						var clubNode=groupnameNode.childNodes[0].nextSibling;
						var tournamentidnode=groupnameNode.nextSibling;
						var tournamentid=tournamentidnode.childNodes[0].nodeValue;
						
						var cnt=clubNode.childNodes.length;
						var clubidNode;
						var clubid;
						var clubnameNode;
						var clubname;
						var matchplayedNode;
						var matchplayed;
						var matchwonNode;
						var matchwon;
						var matchlostNode;
						var matchlost;
						var matchdrawnNode;
						var matchdrawn;
						var matchnoresultNode;
						var matchnoresult;
						var matchpointNode;
						var matchpoint;
						var clubcount=0;
						
						
						//str=str+"<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
              			//str=str+"<tr><td><strong> Group - "+groupname+"</strong></td></tr>"
                        //str=str+"</table>"
						//str=str+"<br />"
						
						if(cnt>0)
						{
							/*str=str+"<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
							str=str+"<tr>"
							str=str+"<td width='60%' align='center'><b>Team</b></td>"
							str=str+"<td width='20%' align='center'><b>Pts.</b></td>"
							str=str+"<td width='20%' align='center'><b>R/R</b></td>"
							str=str+"</tr>"*/
													
							var isOddRow=true
							
							for(var j=0;j<clubNode.childNodes.length;j=j+9)
							{
								
								var color=""							
								clubidNode=clubNode.childNodes[j];
								clubid=clubidNode.childNodes[0].nodeValue;
								clubnameNode=clubidNode.nextSibling
								clubname=clubnameNode.childNodes[0].nodeValue;
								matchplayedNode=clubnameNode.nextSibling;
								matchplayed=matchplayedNode.childNodes[0].nodeValue;
								matchwonNode=matchplayedNode.nextSibling;
								matchwon=matchwonNode.childNodes[0].nodeValue;
								matchlostNode=matchwonNode.nextSibling;
								matchlost=matchlostNode.childNodes[0].nodeValue;
								matchdrawnNode=matchlostNode.nextSibling;
								matchdrawn=matchdrawnNode.childNodes[0].nodeValue;
								matchnoresultNode=matchdrawnNode.nextSibling;
								matchnoresult=matchnoresultNode.childNodes[0].nodeValue;

								matchpointNode=matchnoresultNode.nextSibling;
								matchpoint=matchpointNode.childNodes[0].nodeValue;
								netrunrateNode=matchpointNode.nextSibling;
								netrunrate=netrunrateNode.childNodes[0].nodeValue;
								
								if(matchplayed>0)
								{
									clubcount=clubcount+1;
								}
								
								if(matchplayed>0 && clubcount<=2)
								{
									if(isOddRow)
									{
										color="style='background-color:#000000;'"
									}
									str=str+"<tr>"
									str=str+"<td valign='top' align='center'>"+groupname+"</td>"
									str=str+"<td valign='top' align='center'>"+clubname+"</td>"
									str=str+"<td valign='top' align='center'>"+matchpoint+"</td>"
									str=str+"<td valign='top' align='right'>"+netrunrate+"&nbsp;</td>"
									str=str+"</tr>"

									isOddRow=!isOddRow
								}
								
							}
							
														
						}
							
											
					}
					str=str+"</table>"
					
					document.getElementById("frontgroup").innerHTML=str;
					
				}
			}
		}
		objRequest1.send('tid='+id);
	}
}



function getFrontSchedule(id)
{
	
	createXMLHttp();	
	if(objRequest)
	{
		objRequest.open("POST","frontschedule.php?r="+ new Date().getTime());
		objRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objRequest.onreadystatechange=function()
		{
		if(objRequest.readyState==4 && objRequest.status==200)
			{
				var doc=objRequest.responseXML;
				var scheduleNode=doc.documentElement;
				if(scheduleNode)
				{
					var str="";

					var dateNode=scheduleNode.getElementsByTagName("dates");
					var p=0;
					for(var i=0;i<dateNode.length;i++)
					{	
			
						var idNode=dateNode[i].firstChild;
												
												
						str=str+"<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
              			str=str+"<tr><td><strong><font color='#00fe00'>&nbsp;"+dateNode[i].childNodes[0].nodeValue+"</font></strong></td></tr>"
                        str=str+"</table>"
            
            			
						str=str+"<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
     					
						var isOddRow=true
						var matchesNode=dateNode[i].getElementsByTagName("matches")
						
						for(var j=0;j<matchesNode.length;j++)
						{
							
							p=p+1;
							var color=""
							if(isOddRow)
							{
								color="style='background-color:#000000;'"
							}
							str=str+"<tr>"
							str=str+"<td valign='top'>&nbsp;&nbsp;&bull;</td>"
							/*if(matchesNode[j].childNodes[7].childNodes[0].nodeValue=="Semi Final")
							{
								str=str+"<td valign='top' align='left'>Semi Final  at "+matchesNode[j].childNodes[8].childNodes[0].nodeValue+"&nbsp;&nbsp;"+matchesNode[j].childNodes[5].childNodes[0].nodeValue+" hours</td>"
							}
							else
							{
								str=str+"<td valign='top' align='left'>"+matchesNode[j].childNodes[1].childNodes[0].nodeValue+" takes "+matchesNode[j].childNodes[2].childNodes[0].nodeValue+" at "+matchesNode[j].childNodes[8].childNodes[0].nodeValue+"&nbsp;&nbsp;"+matchesNode[j].childNodes[5].childNodes[0].nodeValue+" hours</td>"
							}*/
							
							str=str+"<td valign='top' align='left'>"+matchesNode[j].childNodes[1].childNodes[0].nodeValue+" takes "+matchesNode[j].childNodes[2].childNodes[0].nodeValue+" at "+matchesNode[j].childNodes[8].childNodes[0].nodeValue+"&nbsp;&nbsp;"+matchesNode[j].childNodes[5].childNodes[0].nodeValue+" hours</td>"
                        	
							str=str+"</tr>"
							
							isOddRow=!isOddRow
						}
						str=str+"</table><br/>";
						
					}
				}
				
				document.getElementById("frontschedule").innerHTML=str
				

			}
		}
		objRequest.send('tid='+id);
	}
}


function showFrontMatchDetail(matchid,tournamentid,typ)
{
	
	createXMLHttp2();
	if(objRequest2)
	{
		objRequest2.open("POST","frontmatchscore.php?r="+ new Date().getTime());
		objRequest2.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objRequest2.onreadystatechange=function()
		{
		
		if(objRequest2.readyState==4 && objRequest2.status==200)
			{
				
				var doc=objRequest2.responseXML;
				var matchesNode=doc.documentElement;
				
				var club1substitute=new Array();
				var club2substitute=new Array();
				
				if(matchesNode)
				{
					var str="";
					str="<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
					for(a=0;a<matchesNode.childNodes.length;a++)
					{
						var matchNode=matchesNode.childNodes[a];
						var idNode=matchNode.childNodes[0];
						var matchid=idNode.childNodes[0].nodeValue;
						var club1id=matchNode.childNodes[16].childNodes[0].childNodes[1];
						var club1name=club1id.childNodes[0].nodeValue;
						var club2id=matchNode.childNodes[16].childNodes[1].childNodes[1];
						var club2name=club2id.childNodes[0].nodeValue;
						
						var club1totalrun=matchNode.childNodes[16].childNodes[2].childNodes[0].nodeValue
						var club2totalrun=matchNode.childNodes[16].childNodes[7].childNodes[0].nodeValue
						var club1totalwkt=matchNode.childNodes[16].childNodes[3].childNodes[0].nodeValue
						var club2totalwkt=matchNode.childNodes[16].childNodes[9].childNodes[0].nodeValue
						var club1ovrtaken=matchNode.childNodes[16].childNodes[4].childNodes[0].nodeValue
						var club2ovrtaken=matchNode.childNodes[16].childNodes[8].childNodes[0].nodeValue
						
						var result=""
						var manofthematch=""
						var pNodes=matchNode.getElementsByTagName("player");
						for(b=0;b<pNodes.length;b++)
						{
							if(pNodes[b].childNodes[7].childNodes[0].nodeValue==1)
							{
								manofthematch=pNodes[b].childNodes[1].childNodes[0].nodeValue
								if(pNodes[b].childNodes[4].childNodes[0].nodeValue!="DNB")
								{
									manofthematch=manofthematch+" "+pNodes[b].childNodes[2].childNodes[0].nodeValue+"("+pNodes[b].childNodes[3].childNodes[0].nodeValue+")"
								}
								
								if(!(pNodes[b].childNodes[19].childNodes[0].nodeValue==0 && pNodes[b].childNodes[21].childNodes[0].nodeValue==0))
								{
									if(pNodes[b].childNodes[4].childNodes[0].nodeValue=="DNB")
									{
										manofthematch=manofthematch+" "+pNodes[b].childNodes[18].childNodes[0].nodeValue+"/"+pNodes[b].childNodes[21].childNodes[0].nodeValue
									}
									else
									{
										manofthematch=manofthematch+", "+pNodes[b].childNodes[18].childNodes[0].nodeValue+"/"+pNodes[b].childNodes[21].childNodes[0].nodeValue
									}
									
								}
								break;
							}
						}
						//alert(manofthematch)
						
						
						if(matchNode.childNodes[10].childNodes.length>0) // if result is not null
						{
															
							if(matchNode.childNodes[10].childNodes[0].nodeValue=="R") // if result is win
							{
								if(matchNode.childNodes[10].childNodes.length>0 && matchNode.childNodes[14].childNodes.length) // if description & won clubname is available
								{
									
									if(matchNode.childNodes[9].childNodes[0].nodeValue==club1name)
									{
										if(matchNode.childNodes[14].childNodes[0].nodeValue.indexOf("Wicket")==-1)
										{
											result="<b><font color='#00fe00'>"+club1name+" beats "+club2name+ " by "+matchNode.childNodes[14].childNodes[0].nodeValue+"</font></b> <br/> " + club1name + " "+club1totalrun +"/" +club1totalwkt + " in "+parseFloat(club1ovrtaken).toFixed(1)+" Overs, "+ club2name + " " + club2totalrun +"/" +club2totalwkt + " in "+parseFloat(club2ovrtaken).toFixed(1)+" Overs <br /> Player of the Match:- "+manofthematch
										}
										else
										{
											result="<b><font color='#00fe00'>"+club1name+" overcame "+club2name+ " by "+matchNode.childNodes[14].childNodes[0].nodeValue+"</font></b> <br/> " + club2name + " "+club2totalrun +"/" +club2totalwkt + " in "+parseFloat(club2ovrtaken).toFixed(1)+" Overs, "+ club1name + " " + club1totalrun +"/" +club1totalwkt + " in "+parseFloat(club1ovrtaken).toFixed(1)+" Overs <br /> Player of the Match:- "+manofthematch
										}
										
									}
									else
									{
										if(matchNode.childNodes[14].childNodes[0].nodeValue.indexOf("Wicket")==-1)
										{
											result="<b><font color='#00fe00'>"+club2name+" beats "+club1name+ " by "+matchNode.childNodes[14].childNodes[0].nodeValue+"</font></b> <br/> " + club2name + " "+club2totalrun +"/" +club2totalwkt + " in "+parseFloat(club2ovrtaken).toFixed(1)+" Overs, "+ club1name + " " + club1totalrun +"/" +club1totalwkt + " in "+parseFloat(club1ovrtaken).toFixed(1)+" Overs <br /> Player of the Match:- "+manofthematch
										}
										else
										{
											result="<b><font color='#00fe00'>"+club2name+" overcame "+club1name+ " by "+matchNode.childNodes[14].childNodes[0].nodeValue+"</font></b> <br/> " + club1name + " "+club1totalrun +"/" +club1totalwkt + " in "+parseFloat(club1ovrtaken).toFixed(1)+" Overs, "+ club2name + " " + club2totalrun +"/" +club2totalwkt + " in "+parseFloat(club2ovrtaken).toFixed(1)+" Overs <br /> Player of the Match:- "+manofthematch
										}
									}
									
								}
								
							}
							else // if result is draw or no result
							{
								if(matchNode.childNodes[14].childNodes.length>0) // if description is available
								{
									result=matchNode.childNodes[14].childNodes[0].nodeValue
								}
								
							}
						}
						
						str=str+"<tr>"
						str=str+"<td valign='top'>&nbsp;&nbsp;</td>"
						str=str+"<td valign='top'><font color='#00fe00'>&bull;</font></td>"
						
						str=str+"<td  valign='top'>"+result+"</td>"
						str=str+"</tr>"
						str=str+"<tr style='height:5px'>"
						str=str+"<td>&nbsp;</td>"
						str=str+"</tr>"
						
						
					}
					str=str+"</table>"
					document.getElementById("frontmatchdetail").innerHTML=str
				}
	
			}
		}
		objRequest2.send('mid='+matchid+'&tid='+tournamentid);
	}
}



function getFrontPerformance(id)
{
	createXMLHttp3()
		
	if(objRequest3)
	{
		objRequest3.open("POST","frontperformance.php?r="+ new Date().getTime());
		objRequest3.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objRequest3.onreadystatechange=function()
		{
		if(objRequest3.readyState==4 && objRequest3.status==200)
			{
				var doc=objRequest3.responseXML;
				var performanceNode=doc.documentElement;
				if(performanceNode)
				{
					
					//str=str+"<div id='header' style='background-color:#000000; height:30px;width:528px;margin: 20px 0px 0px 12px;padding-bottom:5px;'>";
					//str=str+"<div class='caption1'>"+document.getElementById("txttournament").value+"</div>";
					//str=str+"</div><br/>";
					var typeNode=performanceNode.getElementsByTagName("type");
					
					if(typeNode[0].getElementsByTagName("player").length==0) // if first performance does not contain players then assume tournamnt has not started
					{
						
					}
					
					else
					{
						
						str="<b>&nbsp;<font color='#ffff00'>Batting:</font><br/></b>"
						str=str+"<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
						str=str+"<tr>"
						str=str+"<td width='35%'>&nbsp;&nbsp;Runs Scored - </td>"
						str=str+"<td width='33%'>"+typeNode[0].getElementsByTagName("player")[0].childNodes[1].childNodes[0].nodeValue+"</td>"
						str=str+"<td width='32%'>"+typeNode[0].getElementsByTagName("player")[0].childNodes[5].childNodes[0].nodeValue+" Runs</td>"
						str=str+"</tr>"
						str=str+"<tr>"
						str=str+"<td>&nbsp;&nbsp;Strike Rate - </td>"
						str=str+"<td>"+typeNode[1].getElementsByTagName("player")[0].childNodes[1].childNodes[0].nodeValue+"</td>"
						str=str+"<td>"+typeNode[1].getElementsByTagName("player")[0].childNodes[7].childNodes[0].nodeValue+"</td>"
						str=str+"</tr>"
						str=str+"<tr>"
						str=str+"<td>&nbsp;&nbsp;Sixes - </td>"
						str=str+"<td>"+typeNode[4].getElementsByTagName("player")[0].childNodes[1].childNodes[0].nodeValue+"</td>"
						str=str+"<td>"+typeNode[4].getElementsByTagName("player")[0].childNodes[5].childNodes[0].nodeValue+" Sixes</td>"
						str=str+"</tr>"
						str=str+"</table><br/>"
						
						str=str+"<b>&nbsp;<font color='#ffff00'>Bowling:</font><br/></b>"
						str=str+"<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
						str=str+"<tr>"
						str=str+"<td width='35%'>&nbsp;&nbsp;Wicket - </td>"
						str=str+"<td width='33%'>"+typeNode[2].getElementsByTagName("player")[0].childNodes[1].childNodes[0].nodeValue+"</td>"
						str=str+"<td width='32%'>"+typeNode[2].getElementsByTagName("player")[0].childNodes[6].childNodes[0].nodeValue+" Wkts</td>"
						str=str+"</tr>"
						str=str+"<tr>"
						str=str+"<td>&nbsp;&nbsp;Economy - </td>"
						str=str+"<td>"+typeNode[3].getElementsByTagName("player")[0].childNodes[1].childNodes[0].nodeValue+"</td>"
						str=str+"<td>"+typeNode[3].getElementsByTagName("player")[0].childNodes[7].childNodes[0].nodeValue+"</td>"
						str=str+"</tr>"
						str=str+"</table>"
						
					}
					
				}
				
				
				document.getElementById("frontperformers").innerHTML=str;
				
				
				
			}
		}
		objRequest3.send('tid='+id);
	}
}


