window.onload = init;

// Initializes the contents of the Web page
function init(){
	// allSelect references all of the select elements in the page
	var allSelect = document.getElementsByTagName("select");

	// For each item in teh allSelect object collection, add an 
	// onchange event to call loadLink() whenever the selection list changes
	for (var i = 0; i < allSelect.length; i++) {
		allSelect[i].onchange = loadLink;
	}
}

// Opens a Web page based on the value property of
// the selected option from a selection list
function loadLink(){
	// sIndex points to the selected option in the current selection list
	var sIndex = this.selectedIndex;
	
	// Loads the web page url stored in the value of the currently selected option
	location.href = this.options[sIndex].value;
}