//a function to reset the popup lists and radio buttons during loading
function reset_popups()
{
	for ( var i = 0; i <= 3; i++ )
		{
			with(document.traillist.rad[i])
			{
				checked = false;
			}
		}
clear_hapopup();
//self.resizeTo(640,610);
with(document.traillist.trails.options[0])
{
selected = true;
text="Select";
value=""; 
}
}

//a function to clear the hiking area popuplist
function clear_hapopup()
{
for ( var i = 0; i < document.traillist.trails.length; i++ )
{
with(document.traillist.trails.options[i])
{
text=""; value = "";
}
}
}

// a function to determine which radio button is checked
function set_hike(n)
{
	clear_hapopup();
  if(document.traillist.rad[0].checked) sp();
  if(document.traillist.rad[1].checked) na();
	if(document.traillist.rad[2].checked) wild();
	if(document.traillist.rad[3].checked) nf();
}

// a function to assign State Parks options
function sp()
{
  var sptexts = new Array("Select State Parks..." , "Castlewood", "Hawn", "Meramec", "St. Francois", "Taum Sauk", "Washington" );
	var spvalues = new Array("", "castlewoodsp", "hawnsp", "meramecsp", "stfrancoissp", "taumsaukmountainsp", "washingtonsp" );
{
for ( var i = 0; i <= sptexts.length-1; i++)
{
with(document.traillist.trails.options[i])
{
if ( i == 0 ) selected = true;
text=sptexts[i]; value=spvalues[i]; 
}
}
}
}

// a function to assign wilderness park options
function wild()
{
  var wildtexts = new Array("Select Wilderness..." , "Bell Mountain", "Devils Backbone", "Hercules Glades", "Irish Wilderness", "Paddy Creek", "Piney Creek", "Rock Pile Mountain" );
	var wildvalues = new Array("", "bellmountain", "devilsbackbone", "herculesglades", "irishwilderness", "paddycreek", "pineycreek" )
{
for ( var i = 0; i <= wildtexts.length-1; i++)
{
with(document.traillist.trails.options[i])
{
if ( i == 0 ) selected = true;
text=wildtexts[i]; value=wildvalues[i]; 
}
}
}
}

// a function to assign natural areas options
function na()
{
  var natexts = new Array("Select Natural Area..." , "Big Barren Creek", "Coward's Hollow", "JamUp Cave", "Prairie Hollow Gorge", "Rocky Creek" );
	var navalues = new Array("", "naturalareas", "naturalareas", "naturalareas", "eminencearea", "eminencearea" )
{
for ( var i = 0; i <= natexts.length-1; i++)
{
with(document.traillist.trails.options[i])
{
if ( i == 0 ) selected = true;
text=natexts[i]; value=navalues[i]; 
}
}
}
}

// a function to assign other options
function nf()
{
  var nftexts = new Array("Select Other..." , "Audubon", "Forest 44", "Leatherwood Creek", "Lower Rock Creek", "St. Francis River Shutins" );
	var nfvalues = new Array("", "audubon", "conservationareas", "leatherwoodcreek", "lowerrockcreek", "stfrancisrivershutins" )
{
for ( var i = 0; i <= nftexts.length-1; i++)
{
with(document.traillist.trails.options[i])
{
if ( i == 0 ) selected = true;
text=nftexts[i]; value=nfvalues[i]; 
}
}
}
}

// a function to display the selected list option
function show_value()
{
	document.traillist.trails.value=document.traillist.trails.options[document.traillist.trails.selectedIndex].value;

}

//a function to navigate to the selected list option
function LinkUp()
{
var number = document.traillist.trails.selectedIndex;
var trail = document.traillist.trails.options[number].value;
if ( trail != "")
	{
	location.href = "scienceclub/resources/trails.htm#" + trail;
	}
}

//a function to navigate to the science club information page
function go_innerinfo()
{
var infovalues = new Array("", "conductandsafetycode.htm", "equipmentandfirstaid.htm", "backpackingtips.htm", "cavingtips.htm", "coldweathercamping.htm", "dayhikingtips.htm", "knots.htm",  "mapncompass.htm", "outdoorethics.htm", "recycling.htm" );
var choice = document.insideinfo.inner.selectedIndex;
var infochoice = infovalues [ choice ];
if ( infochoice != "" ) location.href="scienceclub/resources/" + infochoice;
}


//a function to navigate to the external information page
function go_outerinfo()
{
var infovalues = new Array("", "http://www.stlbsa.org", "http://www.lnt.org", "http://www.ozarktrail.com" );
var choice = document.outsideinfo.outer.selectedIndex;
var infochoice = infovalues [ choice ];
if ( infochoice != "" ) location.href=infochoice;
}
