window.onload = function(){
	ConvertRowsToLinks("table1");
	ConvertRowsToLinks("table2");
	ConvertRowsToLinks("table3");
	ConvertRowsToLinks("table4");
	ConvertRowsToLinks("table5");
	ConvertRowsToLinksB("table6");
}

function showText(thisDiv, mode) {
	document.getElementById(thisDiv).style.display = "none";
	if(mode == 0) {
		document.getElementById(thisDiv).style.display = "inline";
	}
}

function showResultsTabs(thisDiv) {
	daDiv = document.getElementById(thisDiv);
	
	document.getElementById('details').style.display = "none";
	document.getElementById('results').style.display = "none";
	document.getElementById('review').style.display = "none";
	document.getElementById('gallery').style.display = "none";
	daDiv.style.display = "inline";
	
}

function showAthletesTabs(thisDiv) {
	daDiv = document.getElementById(thisDiv);
	document.getElementById('profile').style.display = "none";	
	document.getElementById('results').style.display = "none";		
	document.getElementById('awards').style.display = "none";
	document.getElementById('gallery').style.display = "none";
	daDiv.style.display = "inline";
	
}

function showRankingsTabs(thisDiv) {
	daDiv = document.getElementById(thisDiv);
	document.getElementById('track').style.display = "none";	
	document.getElementById('field').style.display = "none";	
	document.getElementById('multi').style.display = "none";
	document.getElementById('road').style.display = "none";	
	daDiv.style.display = "inline";
	
}


function showSections(thisSect, thisDiv) {

	for(i=0;document.getElementById(thisSect+i) != null;i++) {
		document.getElementById(thisSect+i).style.display = "none";
		if(document.getElementById(thisSect+i+'_a')) {
			document.getElementById(thisSect+i+'_a').className = "sub_title";
		}
	}
	
	if(thisDiv != '') {
		document.getElementById(thisDiv).style.display = "inline";
		if(document.getElementById(thisDiv+'_a')) {
			document.getElementById(thisDiv+'_a').className = "sub_title_g";
		}
	}	

}



function ConvertRowsToLinks(xTableId){

	var rows = document.getElementById(xTableId).getElementsByTagName("tr");
   
	for(i=0;i<rows.length;i++){
		var link = rows[i].getElementsByTagName("a")
		if(link.length == 1){
			rows[i].onclick = new Function("document.location.href='" + link[0].href + "'");
			rows[i].onmouseover = new Function("this.className='highlight';  window.status='" + link[0].href + "';");
			rows[i].onmouseout = new Function("this.className='" + rows[i].className + "'; window.status='';");
		}
	}
}

function ConvertRowsToLinksB(xTableId){

	var rows = document.getElementById(xTableId).getElementsByTagName("tr");
   
	for(i=0;i<rows.length;i++){
		var link = rows[i].getElementsByTagName("a")
		if(link.length == 1){
			rows[i].onclick = new Function("window.open='" + link[0].href + "'");
			rows[i].onmouseover = new Function("this.className='highlight';  window.status='" + link[0].href + "';");
			rows[i].onmouseout = new Function("this.className='" + rows[i].className + "'; window.status='';");
		}
	}
}

function ConvertRowsToLinks2(xTableId){

	var rows = document.getElementById(xTableId).getElementsByTagName("tr");
   
	for(i=0;i<rows.length;i++){
		var link = rows[i].getElementsByTagName("a")
		if(link.length == 1){
			rows[i].onclick = new Function("document.location.href='" + link[0].href + "'");
			rows[i].onmouseover = new Function("this.className='highlight';  window.status='" + link[0].href + "';");
			rows[i].onmouseout = new Function("this.className='" + rows[i].className + "'; window.status='';");
			i = i + 1
			rows[i].onclick = new Function("document.location.href='" + link[0].href + "'");
			rows[i].onmouseover = new Function("this.className='highlight';  window.status='" + link[0].href + "';");
			rows[i].onmouseout = new Function("this.className='" + rows[i].className + "'; window.status='';");
		}
	}
}

function changeTo(myId) 
{
	document.getElementById(myId).className='highlight';
}
function changeBack(myId)
{
	document.getElementById(myId).className='';
}
