var subject_arr = new Array("Agricultural Science", "Biology", "Chemistry", "Commerce", "Christian Religion Knowledge", "Economics", "Fine Arts", "French", "Financial Accounting", "Further Mathematics", "Government", "Hausa", "Home Economics", "Igbo", "Literature", "Music", "Physics", "Yoruba", "Geography", "History", "Food and Nutrition","Technical Drawing","Wood Work","Metal Work","Building Construction","Bricklaying/Block Laying/Concreting","Plumbing","Joinery/Capentry","Walls/Floor and Ceiling Finishing","Fine Arts","Business Method","Statistics","Basic Surveying","Welding and Fabrication","Basic Electricity","Basic Electronics","Auto Mechanic","Typewriting","Health Science");

var jamb_arr = new Array("Agricultural Science", "Biology", "Chemistry", "Commerce", "Christian Religion Knowledge", "Economics", "Fine Arts", "French",  "Financial Accounting", "Further Mathematics", "Government", "Hausa", "Home Economics", "Igbo", "Literature", "Music", "Mathematics", "Physics", "Yoruba", "Geography", "History", "Food and Nutrition");

var grade_arr = new Array("A1", "A2", "B2", "A3", "B3", "C4", "C5", "C6", "D7", "P7", "E8", "P8", "F9", "AR");

var year_arr = new Array("1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017");						  

function print_subject(subject_id){
	// given the id of the <select> tag as function argument, it inserts <option> tags
	var option_str = document.getElementById(subject_id);
	option_str.length=0;
	// option_str.options[0] = new Option('','');
	option_str.selectedIndex = 0;
	for (var i=0; i<subject_arr.length; i++) {
		option_str.options[option_str.length] = new Option(subject_arr[i],subject_arr[i]);
	}
}

function print_jamb(jamb_id){
	// given the id of the <select> tag as function argument, it inserts <option> tags
	var option_str = document.getElementById(jamb_id);
	option_str.length=0;
	option_str.options[0] = new Option(' ','');
	option_str.selectedIndex = 0;
	for (var i=0; i<jamb_arr.length; i++) {
		option_str.options[option_str.length] = new Option(jamb_arr[i],jamb_arr[i]);
	}
}

function print_grade(grade_id){
	// given the id of the <select> tag as function argument, it inserts <option> tags
	var option_str = document.getElementById(grade_id);
	option_str.length=0;
	option_str.options[0] = new Option(' ','');
	option_str.selectedIndex = 0;
	for (var i=0; i<grade_arr.length; i++) {
		option_str.options[option_str.length] = new Option(grade_arr[i],grade_arr[i]);
	}
}

function print_year(year_id){
	// given the id of the <select> tag as function argument, it inserts <option> tags
	var option_str = document.getElementById(year_id);
	option_str.length=0;
	option_str.options[0] = new Option('','');
	option_str.selectedIndex = 0;
	for (var i=0; i<year_arr.length; i++) {
		option_str.options[option_str.length] = new Option(year_arr[i],year_arr[i]);
	}
}

function print_state(state_id, state_index){
	var option_str = document.getElementById(state_id);
	option_str.length=0;	// Fixed by Julian Woods
	option_str.options[0] = new Option('Select State','');
	option_str.selectedIndex = 0;
	var state_arr = s_a[state_index].split("|");
	for (var i=0; i<state_arr.length; i++) {
		option_str.options[option_str.length] = new Option(state_arr[i],state_arr[i]);
	}
}
