function CheckAverageStars()
{
	spavgStar =  document.getElementById("spanAvgStars");
	var currdate = new Date();
	var comparetodate = new Date('8/1/' + year);
	if (comparetodate > currdate)
		spavgStar.style["display"] = "inline";
	else
		spavgStar.style["display"] = "inline";
	
}
function drawTable(arr, tablename1, tablename2, direction)
{
	if (document.getElementById) 
	{
    	clearChildNodes(tablename1);
    	clearChildNodes(tablename2);
        finishDrawTable(arr,tablename1,tablename2,direction);
     }
      else 
     {
         alert("Sorry, dynamic table feature works with IE5 or later for Windows, and Netscape 6 or later.");
	}  
}

function DrawRowPage1(a, bgcolor, tb)
{
	var row = tb.insertRow(tb.rows.length);
	var col;
	var s = "";	

	if (bgcolor != "")
		row.setAttribute("bgcolor", bgcolor, false);
	s = "<font size=1><a href='viewprospect.asp?Sport=" + sport + "&pr_key=" + a[0] + "'><b>" + a[2] + "&nbsp;" + a[1] + "</b></a></font>";		
	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "left");
	col.innerHTML = s;

	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "center");
	s = "<font size=1>" + a[3] + "</font>";
	col.innerHTML = s;
			
	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "center");
	if (a[4] == "" || a[4] == "0")
	{
		s = "<font size=1>&nbsp;</font>";
	}
	else
	{
		s = "";
		for (i = 1; i <= parseInt(a[4]); ++i)
		{
			s += "<img border=0 src='http://vmedia.rivals.com/images/database/stargold.gif'>";
		}
	}
	col.innerHTML = s;

	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "center");
	s = "<font size=1>" + a[5] + "</font>";
	col.innerHTML = s;

	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "center");
	s = "<font size=1>" + a[6] + "</font>";
	col.innerHTML = s;
			
	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "center");
	s = "<font size=1>" + a[8] + "</font>";	
	col.innerHTML = s;

	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "center");
	if (a[9] == "1")
	{
		s = "<a class='hidelink' href=\"javascript:window.open('video.asp?section=bbrecruit&pkey=" + a[0] + "','video','height=850,width=812,toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, directories=no, status=no');void('');\">";
		s += "<img border=0 src='http://vmedia.rivals.com/images/database/mediaicons_video.gif'></a>";
	}
	else
	{
		s = "&nbsp;";
	}
	col.innerHTML = s;

	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "left");
	s = "<font size=1>" + a[10] + "</font>";
	col.innerHTML = s;
}


function DrawRowPage2(a, bgcolor, tb)
{
	var row = tb.insertRow(tb.rows.length);
	var col;
	var s = "";	

	if (bgcolor != "")
		row.setAttribute("bgcolor", bgcolor, false);
	s = "<font size=1><a href='viewprospect.asp?Sport=" + sport + "&pr_key=" + a[0] + "'><b>" + a[2] + "&nbsp;" + a[1] + "</b></a></font>";		
	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "left");
	col.innerHTML = s;
	
	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "center");
	s = "<font size=1>";
	if (a[12] == '-')
	{
		s += a[12];		
	}
	else
	{
		s += "<a href='/commitdate.asp?Year=" + year + "&SID=" + sid + "&Team=" + school + "&Sport=2' class='hidelink'>";
		s += a[12] + "</a>";
	}
	s += "</font>";
	col.innerHTML = s;
	
	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "center");
	s = "<font size=1>";
	if (a[13] == '-')
	{
		s += a[13];		
	}
	else
	{
		s += "<a href='/visit.asp?Year=" + year + "&SID=" + sid + "&Team=" + school + "&Sport=2' class='hidelink'>";
		s += a[13] + "</a>";
	}
	s += "</font>";
	col.innerHTML = s;
		
	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "center");
	s = "<font size=1>";
	if (a[14] != 'NR')
	{
		s += "<a href='/viewrank.asp?ra_key=" + a[26] + "' class='hidelink'>";
		s += a[14] + "</a>";
	}
	else
	{
		s += a[14];
	}
	s += "</font>";
	col.innerHTML = s;
				
	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "center");
	if (a[11] != "" && a[11] != "0")
	{
		s = "<a href='/cpevent.asp?key=" + a[25] + "' class='hidelink'>";
		s += "<img border=0 alt='Event Verified' src='http://vmedia.rivals.com/images/database/pdbase04_eventsr.gif'></a>";
	}
	else
	{
		s = "&nbsp;";
	}
	col.innerHTML = s;
	
	col = row.insertCell(row.cells.length);
	col.setAttribute("align", "left");
	s = "<font size=1>";
	var coach = "";
	if (a[16] != "")
	{
		coach = "1";
		s += "<a class='hidelink' href='viewcoach.asp?Year=" + year + "&Sport=" + sport + "&Coach=" + a[20] + "'>" + a[16] + " " + a[17] + "</a>";
	}
	if (a[18] != "")
	{	
		if (coach == "1")
			s += "<br>";
		s += "<a class='hidelink' href='viewcoach.asp?Year=" + year + "&Sport=" + sport + "&Coach=" + a[21] + "'>" + a[18] + " " + a[19] + "</a>";
	}
	s += "</font>";
	col.innerHTML = s;
}

function openHelp(lSport) 
{
	pop=window.open('/aboutrankings.asp?Sport=' + lSport,"Help","height=500,width=450,resizable=no,scrollbars=yes")
}
function openSchools(aKey) 
{
	pop=window.open('/schoolspop.asp?pr_key=' + aKey,"Help","height=500,width=450,resizable=no,scrollbars=yes")
}
