//==========================================================================
// modifyPlayers(): Updates the Player select box options.
//==========================================================================
function modifyCardList() {
	var cat = document.forms[0].ddlCategory.selectedIndex;
	var crd = document.forms[0].ddlCard.selectedIndex;
	var url = "nhl94_cards.php";
	if (cat > 0) {
		url = url + "?cat=" + document.forms[0].ddlCategory.options[cat].value;
		if (crd > 0) {
			url = url + "&crd=" + document.forms[0].ddlCard.options[crd].value;
		}
	}
	window.location = url;
}

//==========================================================================
// modifyPlayers(): Updates the Player select box options.
//==========================================================================
function modifyCard(objElem) {
	var strCategory = objElem.options[objElem.selectedIndex].value;
	var objCard = document.forms[0].ddlCard;
	var intLen = objCard.length;
	
	// Clear options
	for ( i = 0 ; i < intLen ; i++ ) {
		objCard.options[0] = null;
	}

	// Set options
	objCard.options[0] = new Option('(Select a Card)','0');
	for ( i = 0 ; i < aCategoryValue[strCategory].length ; i++ ) {
		strValue = aCategoryValue[strCategory][i];
		strLabel = aCategoryLabel[strCategory][i];

		j = i+1
		objCard.options[j] = new Option(strLabel,strValue);
	}
	objCard.selectedIndex = 0;
}


//==========================================================================
// loadCard(): reloads the page so that the new card chosen can be
//		displayed.
//==========================================================================
function loadCard(objElem) {
	var strCardNum = objElem.options[objElem.selectedIndex].value;
	
	document.forms[0].hTeamIndex.value = document.forms[0].lbxTeam.selectedIndex;
	document.forms[0].hPlayerIndex.value = objElem.selectedIndex;
	document.forms[0].hPlayerCardNum.value = strCardNum;
	document.forms[0].submit();
}
