// Created by Bugbottle
// Copyright 2005 Sports Resumes Forum
var birthyears = new Array();
birthyears[0] = "1985-1992,1985 - 1992";
birthyears[1] = "1980-1984,1980 - 1984";
birthyears[2] = "1975-1979,1975 - 1979";
birthyears[3] = "1970-1974,1970 - 1974";
birthyears[4] = "1-1970,Before 1970";
birthyears[5] = "2-1992,1992";
birthyears[6] = "2-1991,1991";
birthyears[7] = "2-1990,1990";
birthyears[8] = "2-1989,1989";
birthyears[9] = "2-1988,1988";
birthyears[10] = "2-1987,1987";
birthyears[11] = "2-1986,1986";
birthyears[12] = "2-1985,1985";
birthyears[13] = "2-1984,1984";
birthyears[14] = "2-1983,1983";
birthyears[15] = "2-1982,1982";
birthyears[16] = "2-1981,1981";
birthyears[17] = "2-1980,1980";
birthyears[18] = "2-1979,1979";
birthyears[19] = "2-1978,1978";
birthyears[20] = "2-1977,1977";
birthyears[21] = "2-1976,1976";
birthyears[22] = "2-1975,1975";
birthyears[23] = "2-1974,1974";
birthyears[24] = "2-1973,1973";
birthyears[25] = "2-1972,1972";
birthyears[26] = "2-1971,1971";
birthyears[27] = "2-1970,1970";
var byearCount = birthyears.length;

var states = new Array();
states[0] = "Alabama";
states[1] = "Alaska";
states[2] = "Arizona";
states[3] = "Arkansas";
states[4] = "California";
states[5] = "Colorado";
states[6] = "Connecticut";
states[7] = "Delaware";
states[8] = "Florida";
states[9] = "Georgia";
states[10] = "Hawaii";
states[11] = "Idaho";
states[12] = "Illinois";
states[13] = "Indiana";
states[14] = "Iowa";
states[15] = "Kansas";
states[16] = "Kentucky";
states[17] = "Louisiana";
states[18] = "Maine";
states[19] = "Maryland";
states[20] = "Massachusetts";
states[21] = "Michigan";
states[22] = "Minnesota";
states[23] = "Mississippi";
states[24] = "Missouri";
states[25] = "Montana";
states[26] = "Nebraska";
states[27] = "Nevada";
states[28] = "New Hampshire";
states[29] = "New Jersey";
states[30] = "New Mexico";
states[31] = "New York";
states[32] = "North Carolina";
states[33] = "North Dakota";
states[34] = "Ohio";
states[35] = "Oklahoma";
states[36] = "Oregon";
states[37] = "Pennsylvania";
states[38] = "Rhode Island";
states[39] = "South Carolina";
states[40] = "South Dakota";
states[41] = "Tennessee";
states[42] = "Texas";
states[43] = "Utah";
states[44] = "Vermont";
states[45] = "Virginia";
states[46] = "Washington";
states[47] = "West Virginia";
states[48] = "Wisconsin";
states[49] = "Wyoming";
states[50] = "";
states[51] = "Alberta";
states[52] = "British Columbia";
states[53] = "Manitoba";
states[54] = "New Brunswick";
states[55] = "Newfoundland";
states[56] = "Nova Scotia";
states[57] = "Ontario";
states[58] = "Prince Edward Island";
states[59] = "Quebec";
states[60] = "Saskatchewan";
var statesCount = states.length;

var positions = new Array();
positions["sport35n26"] = "Pitcher,Catcher,1st Base,2nd Base,3rd Base,Short Stop,Outfielder";
positions["sport1n27"] = "Pitcher,1st Base,2nd Base,3rd Base,Short Stop,Outfielder,Designated Hitter";
positions["sport2t5"] = "Center,Point Guard,Shooting Guard,Small Forward,Power Forward";
positions["sport9t10"] = "Quarterback,Running Back,Wide Receiver,Center,Guard,Tackle,Tight End,Linebacker,Cornerback,Safety,Defensive End,Defensive Tackle,Nose Tackle,Kicker,Punter,Kick/Punt Returner";
positions["sport13t17"] = "Center,Left Wing,Right Wing,Defense,Forward,Goalie";
positions["sport18t21"] = "Midfield,Long Stick Midfield,Defense,Attack,Goalie";
positions["sport22t25"] = "Defender,Midfielder,Forward,Goalkeeper";
positions["sport32t33"] = "Middle Blocker,Outside Hitter,Setter,Libero,Defensive Specialist";

var layerGuides = new Array() // KEY:  sportNumber,Sport-Position-Category,LayerJSCode
layerGuides[0] = "DUMMY";
layerGuides[1] = "1,sport1n27,GenericPro";
layerGuides[2] = "2,sport2t5,GenericCollege";
layerGuides[3] = "3,sport2t5,GenericCollege";
layerGuides[4] = "4,sport2t5,GenericPro";
layerGuides[5] = "5,sport2t5,GenericPro";
layerGuides[6] = "6,NONE,GenericNoPos";
layerGuides[7] = "7,NONE,GenericNoPos";
// NOT YET DONE
layerGuides[8] = "8,UNDEFINED,GenericCollege";
// END NOT YET DONE
layerGuides[9] = "9,sport9t10,GenericCollege";
layerGuides[10] = "10,sport9t10,GenericPro";
layerGuides[11] = "11,NONE,GenericNoPos";
layerGuides[12] = "12,NONE,GenericNoPos";
layerGuides[13] = "13,sport13t17,SpecialJunHockey";
layerGuides[14] = "14,sport13t17,GenericCollege";
layerGuides[15] = "15,sport13t17,GenericCollege";
layerGuides[16] = "16,sport13t17,GenericPro";
layerGuides[17] = "17,sport13t17,GenericPro";
layerGuides[18] = "18,sport18t21,GenericCollege";
layerGuides[19] = "19,sport18t21,GenericCollege";
layerGuides[20] = "20,sport18t21,GenericPro";
layerGuides[21] = "21,sport18t21,GenericPro";
layerGuides[22] = "22,sport22t25,GenericCollege";
layerGuides[23] = "23,sport22t25,GenericCollege";
layerGuides[24] = "24,sport22t25,GenericPro";
layerGuides[25] = "25,sport22t25,GenericPro";
layerGuides[26] = "26,sport35n26,GenericCollege";
layerGuides[27] = "27,sport1n27,GenericPro";
// NOT YET DONE
layerGuides[28] = "28,UNDEFINED,GenericCollege";
layerGuides[29] = "29,UNDEFINED,GenericCollege";
// END NOT YET DONE
layerGuides[30] = "30,NONE,GenericNoPos";
layerGuides[31] = "31,NONE,GenericNoPos";
layerGuides[32] = "32,sport32t33,GenericCollege";
layerGuides[33] = "33,sport32t33,GenericCollege";
layerGuides[34] = "34,NONE,SpecialWrestling";
layerGuides[35] = "35,sport35n26,GenericCollege";

var switcher = 0;

var layerNames = new Array();
layerNames[0] = "layer_GenericCollege";
layerNames[1] = "layer_GenericPro";
layerNames[2] = "layer_GenericNoPos";
layerNames[3] = "layer_SpecialJunHockey";
layerNames[4] = "layer_SpecialWrestling";

function reSet(){
	if (document.forms['searchsports'].sport.selectedIndex != 0) {
		if (document.forms['searchsports'].advanced.checked) {
		var listo = document.forms['searchsports'].sport;
		var selectedValue = listo.options[listo.selectedIndex].value;
		var valueParts = selectedValue.split("_");
		var sportNumber = valueParts[1];
		var sportParts = layerGuides[sportNumber].split(",");
		var positionCat = sportParts[1];
			if (positionCat != "NONE") {
			var positionList = positions[positionCat];
			var positionArray = positionList.split(",");
			var positionCount = positionArray.length;
			}
		var layerWhat = sportParts[2];
		var posname;
		var h;
		var byearPair;
		var byearParts;
		var statename;
			switch(layerWhat) {
				case "GenericCollege":
					document.form_GenericCollege.sportlayer.value=sportNumber;
					document.form_GenericCollege.position.options.length = 1;
					for (i=1; i<=positionCount; i++) {
					h = i-1;
					posname = positionArray[h];
					document.form_GenericCollege.position.options[i] = new Option(posname);
					}
					for (i=1; i<=byearCount; i++) {
					h=(i-1);
					byearPair = birthyears[h];
					byearParts = byearPair.split(",");
					document.form_GenericCollege.byear.options[i] = new Option(byearParts[1]);
					document.form_GenericCollege.byear.options[i].value = byearParts[0];
					}
					for (i=1; i<=statesCount; i++) {
					h=(i-1);
					statename = states[h];
					document.form_GenericCollege.state.options[i] = new Option(statename);
					}
					break;
				case "GenericPro":
					document.form_GenericPro.sportlayer.value=sportNumber;
					document.form_GenericPro.sportlayer.value=sportNumber;
					document.form_GenericPro.position.options.length = 1;
					for (i=1; i<=positionCount; i++) {
					h=(i-1);
					posname = positionArray[h];
					document.form_GenericPro.position.options[i] = new Option(posname);
					}
					for (i=1; i<=byearCount; i++) {
					h=(i-1);
					byearPair = birthyears[h];
					byearParts = byearPair.split(",");
					document.form_GenericPro.byear.options[i] = new Option(byearParts[1]);
					document.form_GenericPro.byear.options[i].value = byearParts[0];
					}
					break;
				case "GenericNoPos":
					document.form_GenericNoPos.sportlayer.value=sportNumber;
					for (i=1; i<=byearCount; i++) {
					h=(i-1);
					byearPair = birthyears[h];
					byearParts = byearPair.split(",");
					document.form_GenericNoPos.byear.options[i] = new Option(byearParts[1]);
					document.form_GenericNoPos.byear.options[i].value = byearParts[0];
					}
					for (i=1; i<=statesCount; i++) {
					h=(i-1);
					statename = states[h];
					document.form_GenericNoPos.state.options[i] = new Option(statename);
					}
					break;
				case "SpecialJunHockey":
					document.form_SpecialJunHockey.sportlayer.value=sportNumber;
					document.form_SpecialJunHockey.sportlayer.value=sportNumber;
					document.form_SpecialJunHockey.position.options.length = 1;
					for (i=1; i<=positionCount; i++) {
					h=(i-1);
					posname = positionArray[h];
					document.form_SpecialJunHockey.position.options[i] = new Option(posname);
					}
					for (i=1; i<=statesCount; i++) {
					h=(i-1);
					statename = states[h];
					document.form_SpecialJunHockey.state.options[i] = new Option(statename);
					}
					break;
				case "SpecialWrestling":			
					document.form_SpecialWrestling.sportlayer.value=sportNumber;
					for (i=1; i<=byearCount; i++) {
					h=(i-1);
					byearPair = birthyears[h];
					byearParts = byearPair.split(",");
					document.form_SpecialWrestling.byear.options[i] = new Option(byearParts[1]);
					document.form_SpecialWrestling.byear.options[i].value = byearParts[0];
					}
					for (i=1; i<=statesCount; i++) {
					h=(i-1);
					statename = states[h];
					document.form_SpecialWrestling.state.options[i] = new Option(statename);
					}
					break;					
			}		
		var layerType = "layer_" + layerWhat;
			for (var i=0; i<= 4; i++) {
			var layhide = layerNames[i];
			document.getElementById(layhide).style.display = (layhide == layerType ? "block" : "none");
			}
		document.getElementById('blank').style.display = "none";
		document.getElementById('simple').style.display = "none";
		}
		else {
			for (var i=0; i<= 4; i++) {
			var layhide = layerNames[i];
			document.getElementById(layhide).style.display = "none";
			}
		document.getElementById('blank').style.display = "none";
		document.getElementById('simple').style.display = "block";
		}
	}
	else {
		for (var i=0; i<= 4; i++) {
		var layhide = layerNames[i];
		document.getElementById(layhide).style.display = "none";
		}
	document.getElementById('simple').style.display = "none";
	document.getElementById('blank').style.display = "block";
	}
}
function yesJS() {
document.getElementById('simple').style.display = "none";
document.getElementById('advsearch').style.display = "block";
document.getElementById('blank').style.display = "block";
}