
// Search-related functions
//

// Build drop downs from js arrays
function BuildDD(array_to_build, regn_val, tube_val){
	
	var sprt_val = '1';  // football
	
	//alert(array_to_build);
	//alert(regn_val);
	//alert(tube_val);
	
	if(array_to_build == 'findregn'){
		
		var ChoicesArray = sport[sprt_val];
		var NewDropDownList = window.document.myform.findregn.options;
		NewDropDownList.length = 1;
		for (loop=0; loop < ChoicesArray.length; loop++) {
			NewDropDownList[loop] = new Option(ChoicesArray[loop]);
			NewDropDownList[loop].value = ChoicesArray[loop];
		}
		document.myform.findregn.value = regn_val;
		//NewDropDownList.selectedIndex = 0;

	}
	// Tube
	else {
		
		var ChoicesArray = sport[sprt_val][regn_val];
		var NewDropDownList = window.document.myform.findtube.options;		
		NewDropDownList.length = 1;
		for (loop=0; loop < ChoicesArray.length; loop++) {
			NewDropDownList[loop] = new Option(ChoicesArray[loop]);
			NewDropDownList[loop].value = ChoicesArray[loop];
		}
		document.myform.findtube.value = tube_val;
		//NewDropDownList.selectedIndex = 0;
	
	}
	
}
