
/****************************************************************************

  This file is part of the EnemyTerritory.tv Content Management System

	EnemyTerritory.tv CMS by Steve "GreasedScotsman" Huff, 
	Copyright 2009 Steve Huff
	
	It is distributed under the terms of the 
	GNU General Public License

	This file drives the form validation for the 
	makestats.php page.
		
***************************************************************************/

function scoreShow(match, round, roundtotal, dir) {

	// hide the "current" match's prev/next links, scores and map divs
	if (dir == "next") {
		rnd = parseInt(round)-1;
		if (rnd > 0) { document.getElementById("match"+match+"PrevLink"+(rnd)).style.visibility = "hidden"; }
		document.getElementById("match"+match+"Map"+(rnd)).style.visibility = "hidden";
		document.getElementById("match"+match+"Score"+(rnd)).style.visibility = "hidden";
		if (rnd < roundtotal) { document.getElementById("match"+match+"NextLink"+(rnd)).style.visibility = "hidden"; }
	}

	if (dir == "prev") {
		rnd = parseInt(round)+1;
		if (round+1 > 0) { document.getElementById("match"+match+"PrevLink"+(rnd)).style.visibility = "hidden"; }
		document.getElementById("match"+match+"Map"+(rnd)).style.visibility = "hidden";
		document.getElementById("match"+match+"Score"+(rnd)).style.visibility = "hidden";
		if (rnd < roundtotal) { document.getElementById("match"+match+"NextLink"+(rnd)).style.visibility = "hidden"; }
	}
	
	// then show just the new one just clicked by the prev/next link
	if (round > 0) { document.getElementById("match"+match+"PrevLink"+round).style.visibility = "visible"; }
	document.getElementById("match"+match+"Map"+round).style.visibility = "visible";
	document.getElementById("match"+match+"Score"+round).style.visibility = "visible";
	if (round < roundtotal) { document.getElementById("match"+match+"NextLink"+round).style.visibility = "visible"; }

};

// EOF
